Skip to content

Fix coverage for test_benchmarks.py - #251

Merged
Dreamsorcerer merged 30 commits into
aio-libs:masterfrom
Vizonex:coverage-change
Jun 15, 2026
Merged

Fix coverage for test_benchmarks.py#251
Dreamsorcerer merged 30 commits into
aio-libs:masterfrom
Vizonex:coverage-change

Conversation

@Vizonex

@Vizonex Vizonex commented May 23, 2026

Copy link
Copy Markdown
Member

What do these changes do?

This change omits a common problem with coverage that is causing a lot of workflows in this repo to fail which is in
tests/test_benchmarks.py This was a recommendation by the new ai agent.

Edit: There is unfair hurdles such as typing coverage that need fixing my goal was to fix that so that protective measures in cython can then be taken to prevent future performance regressions.

Are there changes in behavior for the user?

Nope. The only thing this affects is contributors and maintainers.

Related issue number

#245 (This is to help it pass)
#245 (comment)

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label May 23, 2026
@codspeed-hq

codspeed-hq Bot commented May 23, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 4 untouched benchmarks


Comparing Vizonex:coverage-change (5726c8e) with master (55f24e6)

Open in CodSpeed

@codecov

codecov Bot commented May 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (55f24e6) to head (5726c8e).

Additional details and impacted files
@@             Coverage Diff             @@
##           master      #251      +/-   ##
===========================================
+ Coverage   99.54%   100.00%   +0.45%     
===========================================
  Files          10        10              
  Lines         439       437       -2     
  Branches       17        17              
===========================================
  Hits          437       437              
+ Misses          2         0       -2     
Flag Coverage Δ
CI-GHA 97.94% <100.00%> (+0.44%) ⬆️
OS-Linux 97.94% <100.00%> (+0.44%) ⬆️
OS-Windows 94.96% <100.00%> (+0.43%) ⬆️
OS-macOS 94.96% <100.00%> (+0.43%) ⬆️
Py-3.10 94.96% <100.00%> (+0.43%) ⬆️
Py-3.11 96.56% <100.00%> (+0.43%) ⬆️
Py-3.12 96.56% <100.00%> (+0.43%) ⬆️
Py-3.13 96.56% <100.00%> (+0.43%) ⬆️
Py-3.14 96.54% <100.00%> (+0.44%) ⬆️
Py-3.14t 96.54% <100.00%> (+0.44%) ⬆️
Py-pypy-3.10 78.48% <100.00%> (+0.35%) ⬆️
VM-macos-latest 94.96% <100.00%> (+0.43%) ⬆️
VM-ubuntu-latest 97.94% <100.00%> (+0.44%) ⬆️
VM-windows-11-arm 94.73% <100.00%> (+0.43%) ⬆️
VM-windows-latest 94.96% <100.00%> (+0.43%) ⬆️
pytest 97.94% <100.00%> (+0.44%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Vizonex Vizonex changed the title Omit coverage for test_benchmarks.py Fix coverage for test_benchmarks.py May 23, 2026

@webknjaz webknjaz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Besides the suggestions below, plz look into the possibility to integrate covdefaults into the project in a follow-up PR.

Comment thread tests/test_benchmarks.py Outdated
Comment thread tests/test_benchmarks.py Outdated
Comment thread docs/spelling_wordlist.txt
Comment thread tests/test_benchmarks.py Outdated
Comment thread tests/test_benchmarks.py
Co-authored-by: Sam Bull <aa6bs0@sambull.org>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Comment thread tests/test_benchmarks.py Fixed
@Vizonex

Vizonex commented Jun 14, 2026

Copy link
Copy Markdown
Member Author

@webknjaz I did all that I could so far. But the one thing that remains is codecov/project/tests which seems to play unfairly for whatever reason that I will never fully understand but I was able to get it all the way up to 97.87% is way better than it was previously at 97.35% Perhaps the bar itself needs to be changed or something simillar.

@Dreamsorcerer

Copy link
Copy Markdown
Member

You seem to have resolved my comments without applying them..

Co-authored-by: Sam Bull <aa6bs0@sambull.org>
@Vizonex

Vizonex commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

@Dreamsorcerer Reapplied. The problem is the 97 is not hitting the 98 like it's supposed to.

Comment thread tests/test_benchmarks.py Fixed
@Vizonex

Vizonex commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

As much as I hate doing this I feel like we have no choice but to reconfigure the tests target

coverage:
  range: 99.34..100
  status:
    patch:
      default:
        target: 100%
        flags:
        - pytest
    project:
      default:
        target: 87.5%  # 100%
      lib:
        flags:
        - pytest
        paths:
        - propcache/
        target: 100%
      packaging:
        paths:
        - packaging/
        target: 75.24%
      tests:
        flags:
        - pytest
        paths:
        - tests/
        target: 97.2%  # 100%

@Vizonex

Vizonex commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

@Dreamsorcerer Do you have any thoughts on just changing the tests-target limit?

@Dreamsorcerer

Copy link
Copy Markdown
Member

@Dreamsorcerer Do you have any thoughts on just changing the tests-target limit?

I don't know what that status check is referring to, just ignore it. The coverage on codecov is 100%.

Comment thread tests/test_benchmarks.py Outdated
Co-authored-by: Sam Bull <aa6bs0@sambull.org>
@Dreamsorcerer

Copy link
Copy Markdown
Member

@Dreamsorcerer Do you have any thoughts on just changing the tests-target limit?

I don't know what that status check is referring to, just ignore it. The coverage on codecov is 100%.

Wait, that refers to the coverage with the pytest flag.

Something weird is going on. The default codecov view shows 100% with "All flags". But, if you manually select every flag, then coverage is not 100%... Not sure how that's possible...

@Vizonex

Vizonex commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

@Dreamsorcerer Do you have any thoughts on just changing the tests-target limit?

I don't know what that status check is referring to, just ignore it. The coverage on codecov is 100%.

Wait, that refers to the coverage with the pytest flag.

Something weird is going on. The default codecov view shows 100% with "All flags". But, if you manually select every flag, then coverage is not 100%... Not sure how that's possible...

@Dreamsorcerer That was the annoyance that lead to this PR existing in the first place.

@Dreamsorcerer

Copy link
Copy Markdown
Member

@Dreamsorcerer That was the annoyance that lead to this PR existing in the first place.

I think it's something confusing with the way it merges reports:
codecov/codecov-action#1961

e.g. Maybe it's highlighting a partial because every upload under a flag had a partial, and it only evaluates the partial correctly in the final merge.

@Dreamsorcerer
Dreamsorcerer merged commit 0685d63 into aio-libs:master Jun 15, 2026
59 of 60 checks passed
@Vizonex
Vizonex deleted the coverage-change branch June 15, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants