Skip to content

Add tests for pathtools.listdir_matching#122

Open
lguerard wants to merge 6 commits intoimcf:develfrom
lguerard:fix/119-listdir-matching-tests
Open

Add tests for pathtools.listdir_matching#122
lguerard wants to merge 6 commits intoimcf:develfrom
lguerard:fix/119-listdir-matching-tests

Conversation

@lguerard
Copy link
Copy Markdown
Contributor

Fix #119

@lguerard lguerard changed the base branch from master to devel January 14, 2026 14:21
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29%. Comparing base (5f21448) to head (b70ff13).
⚠️ Report is 11 commits behind head on devel.

Additional details and impacted files
@@         Coverage Diff          @@
##           devel   #122   +/-   ##
====================================
+ Coverage     25%    29%   +4%     
====================================
  Files         25     25           
  Lines       1756   1761    +5     
====================================
+ Hits         439    514   +75     
+ Misses      1317   1247   -70     

☔ View full report in Codecov by Sentry.
📢 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.

@ehrenfeu ehrenfeu changed the title Fix/119 listdir matching tests Add tests for listdir_matching Jan 21, 2026
@ehrenfeu ehrenfeu added the unit testing A unit test should be created label Jan 21, 2026
@ehrenfeu ehrenfeu moved this to In review in imcflibs Jan 21, 2026
@ehrenfeu ehrenfeu self-assigned this Jan 21, 2026
@ehrenfeu ehrenfeu self-requested a review January 21, 2026 11:28
@ehrenfeu
Copy link
Copy Markdown
Member

As indicated by codecov, there are still quite some paths in the function that are not covered by tests:

https://app.codecov.io/gh/imcf/python-imcflibs/pull/122/blob/src/imcflibs/pathtools.py#L223

To me, the level of complexity / conditional nesting / ... of listdir_matching is so high that sooner or later it will blow up if it's not fully covered.

@ehrenfeu ehrenfeu added this to the 2.0.0 milestone Jan 21, 2026
@ehrenfeu
Copy link
Copy Markdown
Member

ehrenfeu commented Mar 25, 2026

Is it possible to also cover the fullpath branches in the tests?

https://app.codecov.io/gh/imcf/python-imcflibs/pull/122/blob/src/imcflibs/pathtools.py#L234

@ehrenfeu ehrenfeu assigned lguerard and unassigned ehrenfeu Mar 25, 2026
@lguerard
Copy link
Copy Markdown
Contributor Author

How do I ask Codecov to check now ? I have pushed but don't see anything : https://app.codecov.io/gh/imcf/python-imcflibs/pull/122

@ehrenfeu
Copy link
Copy Markdown
Member

How do I ask Codecov to check now ? I have pushed but don't see anything : https://app.codecov.io/gh/imcf/python-imcflibs/pull/122

Good question. I don't fully understand why it's not happening automatically.

Codecov seems to be complaining with Unable to compare commits because the head commit did not upload a coverage report, will need to dig into that 👷🏼

@ehrenfeu
Copy link
Copy Markdown
Member

I'm not entirely certain if this is not a bug. Renewed the Codecov token now (which was still valid) and merged devel into this PR-branch as this was one of the Google suggestions on how to fix the head report issue. Let's see...

@ehrenfeu ehrenfeu changed the title Add tests for listdir_matching Add tests for pathtools.listdir_matching Mar 25, 2026
@ehrenfeu ehrenfeu force-pushed the fix/119-listdir-matching-tests branch from 9dae485 to fad0e28 Compare March 25, 2026 19:42
@ehrenfeu
Copy link
Copy Markdown
Member

Reverted the devel merge again as this doesn't seem to make a difference...

@ehrenfeu
Copy link
Copy Markdown
Member

Okay, I think by now I have identified the underlying issue with Codecov.

Codecov reports are being generated (and uploaded to Codecov) by the Pytest-Poetry 🧪🎭 action, but until 5f21448 the action was only triggered by pushes to master and for PR's, leading to the situation that for most commits in the devel branch no "direct" coverage report was available (only the "implicit" ones that were generated for their respective PR's, but apparently this confused Codecov in figuring out which is the correct report to compare a new one to).

With the commit mentioned above, the tests will also run for pushes to devel (this includes merging of PR's) and therefore the coverage reports will be updated (and uploaded to Codecov).

@ehrenfeu
Copy link
Copy Markdown
Member

Suggestion: I'll try to rebase (waaaaaah! reeeebaaaase! 🤯 💥 👻 🫨 😱) the commits in this PR onto current devel and force-push here. If that works, it should trigger the tests, upload coverage and have a proper base reference for the coverage report to compare to.

I'll keep the original PR in a separate branch around, just to be safe.

🎁 Bonus: it'll give you the opportunity to fix the committer address of your last two commits as they're currently done as laurent.guerard42@gmail.com instead of laurent.guerard@unibas.ch...

* Implement tests for non-recursive and recursive matching.
* Validate fullpath and regex matching functionality.
* Ensure correct sorting behavior for file names.
* Implement test for invalid regex returning an empty list.
* Add test for recursive regex matching that verifies absolute paths.
@ehrenfeu ehrenfeu force-pushed the fix/119-listdir-matching-tests branch from fad0e28 to 0be95a9 Compare March 25, 2026 20:49
@ehrenfeu
Copy link
Copy Markdown
Member

💥

(done ✅)

@ehrenfeu
Copy link
Copy Markdown
Member

Is it possible to also cover the fullpath branches in the tests?

https://app.codecov.io/gh/imcf/python-imcflibs/pull/122/blob/src/imcflibs/pathtools.py#L234

While the commits in this PR now push the coverage by more than 50% 🚀 to a total of almost 95% 🥳 🎉 , the fullpath branches are still missing... 🤔

@ehrenfeu ehrenfeu moved this from In review to In progress in imcflibs Mar 25, 2026
@ehrenfeu
Copy link
Copy Markdown
Member

🚨 @lguerard please make sure to git pull delete your local branch and create a new one from the PR before continuing your work on this!! 🚨

…size, join_files_with_channel_suffix, and create_directory functions
@lguerard lguerard force-pushed the fix/119-listdir-matching-tests branch from 0be95a9 to ce25066 Compare March 26, 2026 10:44
@lguerard
Copy link
Copy Markdown
Contributor Author

Now 100% for this file 🥳

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

Labels

unit testing A unit test should be created

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Create tests for imcflibs.pathtools.listdir_matching

2 participants