Skip to content

tests: benchmarks, xdist#247

Merged
wRAR merged 24 commits intoscrapy:masterfrom
albertedwardson:pytest-benchmark
Apr 27, 2026
Merged

tests: benchmarks, xdist#247
wRAR merged 24 commits intoscrapy:masterfrom
albertedwardson:pytest-benchmark

Conversation

@albertedwardson
Copy link
Copy Markdown
Contributor

@albertedwardson albertedwardson commented Jul 27, 2025

This pull request introduces:

  • a CodSpeed-powered benchmarking workflow with addition of benchmark test suites
  • parallelization of existing tests using pytest-xdist

albertedwardson added a commit to albertedwardson/w3lib that referenced this pull request Jul 27, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.97%. Comparing base (7576e18) to head (840415b).
⚠️ Report is 25 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #247   +/-   ##
=======================================
  Coverage   97.97%   97.97%           
=======================================
  Files           9        9           
  Lines         493      493           
  Branches       84       84           
=======================================
  Hits          483      483           
  Misses          6        6           
  Partials        4        4           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@albertedwardson albertedwardson changed the title adding benchmarking, currently only for http funcs benchmarks Apr 7, 2026
@albertedwardson albertedwardson changed the title benchmarks tests: benchmarks, xdist Apr 7, 2026
@albertedwardson

This comment was marked as resolved.

@albertedwardson albertedwardson marked this pull request as ready for review April 7, 2026 15:15
@albertedwardson
Copy link
Copy Markdown
Contributor Author

note to reviewers: the BENCHMARK_CASES dict is generated with help of AI, no need to validate it diligently, until you will be ok with enabling codspeed in ci. after that- I will do a self-review, disable supression of exceptions (and maybe do asserts with expected output, idk)

@albertedwardson

This comment has been minimized.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 21, 2026

@albertedwardson

This comment was marked as resolved.

@AdrianAtZyte
Copy link
Copy Markdown
Contributor

AdrianAtZyte commented Apr 21, 2026

I did notice the upstream docs mention the need for id-token: write permission in actions.

That said, I suspect the main reason https://codspeed.io/scrapy/w3lib/branches/albertedwardson%3Apytest-benchmark does not show much is because until the benchmarks run on the main branch there is no baseline to compare with.

@albertedwardson
Copy link
Copy Markdown
Contributor Author

albertedwardson commented Apr 21, 2026

id-token: write wasn't the cause; the logs shows NOTICE: codspeed is enabled, but no performance measurement will be made since it's running in an unknown environment, although codspeed should definitely know that it's in CI

maybe it doesn't like being run through tox?

@albertedwardson
Copy link
Copy Markdown
Contributor Author

yeah, tox was the cause... I'll try find a way to convince codspeed ​​that running with tox is ok, it only supports nox...

@albertedwardson
Copy link
Copy Markdown
Contributor Author

ok, pypy is not supported: CodSpeedHQ/pytest-codspeed#34

@albertedwardson
Copy link
Copy Markdown
Contributor Author

I thought everything was working locally because I didn't notice the notice log :)

NOTICE: codspeed is enabled, but performance measurements won't be performed because it's running in an unknown environment.

This means it doesn't even attempt to run the instrumentation, but only checks whether the tests pass

@albertedwardson
Copy link
Copy Markdown
Contributor Author

idk how to do this nicely without excessive copypaste from real test cases

Comment thread pyproject.toml Outdated
Comment thread tox.ini
@AdrianAtZyte AdrianAtZyte requested review from Copilot and wRAR April 27, 2026 15:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@wRAR wRAR requested a review from Copilot April 27, 2026 15:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@wRAR wRAR merged commit c44e4b6 into scrapy:master Apr 27, 2026
34 checks passed
@albertedwardson albertedwardson deleted the pytest-benchmark branch April 27, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants