Skip to content

Conversation

@A5rocks
Copy link
Contributor

@A5rocks A5rocks commented Aug 7, 2025

Making this PR to see if this quick fix works.

I want to double check that source = ["."] doesn't work before merging this.

@A5rocks A5rocks mentioned this pull request Aug 7, 2025
@A5rocks
Copy link
Contributor Author

A5rocks commented Aug 7, 2025

Hm that didn't work. 🤔

EDIT: nevermind it did work, I don't know why the coverage report step of the Cython tests didn't show me what I was looking for. I guess maybe I somehow skipped the line while reading...

@codecov
Copy link

codecov bot commented Aug 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00000%. Comparing base (77dd921) to head (44a9fff).

Additional details and impacted files
@@               Coverage Diff               @@
##                 main        #3314   +/-   ##
===============================================
  Coverage   100.00000%   100.00000%           
===============================================
  Files             125          128    +3     
  Lines           19251        19269   +18     
  Branches         1304         1303    -1     
===============================================
+ Hits            19251        19269   +18     
Files with missing lines Coverage Δ
src/trio/_core/_tests/test_thread_cache.py 100.00000% <ø> (ø)
src/trio/_core/_thread_cache.py 100.00000% <ø> (ø)

... and 3 files with indirect coverage changes

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

@webknjaz
Copy link
Member

webknjaz commented Aug 7, 2025

The problem with source is that it's ambiguously selecting either importables or directories. And you don't really know what you'll get upfront. But with the CWD, it's always a dir. And source_pkgs specifically recognizes importables.

This usually works best with Codecov, and pytest --cov (without a value set).

But since something wasn't right in trio, I've been postponing the original merge.

I'd recommend comparing the coverage. xml files produced before the PR and after. I suspect the base package dir attribute is different with your change.

@A5rocks
Copy link
Contributor Author

A5rocks commented Aug 7, 2025

Note for a later search: for some reason test_clear_thread_cache_after_fork is timing out.

The problem with source is that it's ambiguously selecting either importables or directories.

Yeah I tried to add a / just to ensure this is fine... We'll see. Hopefully codecov failure was just because of CI flakiness.

@A5rocks A5rocks added the skip newsfragment Newsfragment is not required label Aug 7, 2025
@A5rocks A5rocks changed the title Re-add tests/ directory Re-add tests/ directory for coverage Sep 7, 2025
@A5rocks
Copy link
Contributor Author

A5rocks commented Dec 1, 2025

I think this would be nice to merge. Honestly, all this coverage stuff is frustrating and not worth the effort for Trio as it is now... we already have a good enough story here IMO!

@webknjaz
Copy link
Member

webknjaz commented Dec 1, 2025

I still prefer source = ., FWIW

@A5rocks
Copy link
Contributor Author

A5rocks commented Dec 2, 2025

I guess I'm confused about how that would work. Like, completely disregarding the exact settings we need, I imagine we want something like:

  1. check everything in src and tests is executed (even if nothing uploads a coverage report talking about them)
  2. merge all trio paths together, so that the venv -- located at different places on different operating systems -- doesn't affect things

I think this PR accomplishes that. Respectively:

  1. src doesn't actually matter since we install everything, so only worry about the importable trio, tests/ is there.
  2. tool.coverage.paths.source does this, the extra "src" is for local editable installs (I think? I forgot... that one's iffy)

The part with _trio_check_attrs_aliases is an unfortunate side effect of the fact that we also have our own pytest plugin and need it to be a) importable but b) not within trio.

@jakkdl
Copy link
Member

jakkdl commented Dec 2, 2025

I think this would be nice to merge. Honestly, all this coverage stuff is frustrating and not worth the effort for Trio as it is now... we already have a good enough story here IMO!

sounds good enough to me, agree that coverage has been incredibly frustrating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip newsfragment Newsfragment is not required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants