From f2d3a2f6e2e6cc0144dc7a3c05d753a9ba8a2f35 Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Wed, 15 Apr 2026 17:45:14 -0600 Subject: [PATCH] fix(infra): skip codspeed for partners without benchmarks (#36775) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CodSpeed workflow was failing on partner PRs because `check_diff.py` added every partner to the `codspeed` matrix unconditionally — even when no `tests/benchmarks/` directory exists. The workflow then ran an empty shell block for those partners, CodSpeed saw zero benchmarks, and marked the check as failed. Currently no partner package has benchmarks, so this affected every partner PR. --- .github/scripts/check_diff.py | 9 +++++++-- .github/workflows/codspeed.yml | 4 +--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/scripts/check_diff.py b/.github/scripts/check_diff.py index 04ec627eb2a..bf7dc8b8757 100644 --- a/.github/scripts/check_diff.py +++ b/.github/scripts/check_diff.py @@ -316,8 +316,13 @@ if __name__ == "__main__": if not filename.startswith(".") ] != ["README.md"]: dirs_to_run["test"].add(f"libs/partners/{partner_dir}") - # Skip codspeed for partners without benchmarks or in IGNORED_PARTNERS - if partner_dir not in IGNORED_PARTNERS: + # Only add to codspeed if the partner has benchmarks and is not ignored + if ( + partner_dir not in IGNORED_PARTNERS + and os.path.isdir( + f"libs/partners/{partner_dir}/tests/benchmarks" + ) + ): dirs_to_run["codspeed"].add(f"libs/partners/{partner_dir}") # Skip if the directory was deleted or is just a tombstone readme elif file.startswith("libs/"): diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 291e574722c..50c2e3ff93a 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -77,7 +77,5 @@ jobs: token: ${{ secrets.CODSPEED_TOKEN }} run: | cd ${{ matrix.job-configs.working-directory }} - if [ "${{ matrix.job-configs.working-directory }}" = "libs/core" ] || [ "${{ matrix.job-configs.working-directory }}" = "libs/langchain_v1" ]; then - uv run --no-sync pytest ./tests/benchmarks --codspeed - fi + uv run --no-sync pytest ./tests/benchmarks --codspeed mode: ${{ matrix.job-configs.codspeed-mode }}