fix(infra): skip codspeed for partners without benchmarks (#36775)

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.
This commit is contained in:
Mason Daugherty
2026-04-15 17:45:14 -06:00
committed by GitHub
parent 1292c64e6d
commit f2d3a2f6e2
2 changed files with 8 additions and 5 deletions

View File

@@ -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/"):