Tinkering with CodSpeed (#30824)

Fix CI to trigger benchmarks on `run-codspeed-benchmarks` label addition

Reduce scope of async benchmark to save time on CI

Waiting to merge this PR until we figure out how to use walltime on
local runners.
This commit is contained in:
Sydney Runkle 2025-04-15 08:49:09 -04:00 committed by GitHub
parent ed5c4805f6
commit 59f2c9e737
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -14,8 +14,8 @@ on:
jobs:
codspeed:
name: Run benchmarks
if: (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-benchmarks'))
runs-on: codspeed-macro
if: (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-codspeed-benchmarks'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -41,3 +41,4 @@ jobs:
run: |
cd libs/core
uv run --no-sync pytest ./tests/benchmarks --codspeed
mode: walltime

View File

@ -46,7 +46,7 @@ class MyCustomAsyncHandler(AsyncCallbackHandler):
@pytest.mark.benchmark
async def test_async_callbacks_in_sync(benchmark: BenchmarkFixture) -> None:
infinite_cycle = cycle([AIMessage(content=" ".join(["hello", "goodbye"] * 500))])
infinite_cycle = cycle([AIMessage(content=" ".join(["hello", "goodbye"] * 5))])
model = GenericFakeChatModel(messages=infinite_cycle)
@benchmark # type: ignore[misc]