Skip to content

Conversation

@noirbizarre
Copy link
Member

@noirbizarre noirbizarre commented Dec 29, 2025

Description

This PR fixes all raised warnings during tests (making it easier to read actual errors).

Moving from 30 warnings and a duration of ~40s:

image

to no warnings for a duration of less than 10s:

image

The time gained is because we don't rely on sleep anymore.

Checklist

Code Changes

  • ignore our own expected deprecation warnings in pyproject.toml
  • Introduce a time-controlled util: UtilFixture helper (freeze time with FreezeGun once required):
    • exposes all git operations in a time-controlled manner (each git operation advance time by 1s).
    • exposes a cli(*args) helper also time-controlled (underlying git operations have the time frozen too). Reduce the amount of boilerplate to execute the cli during tests
  • use this fixture instead all imported git helpers, including wait_for_tag in test_changelog_command.py (the only one still depending on wait_for_tag)
  • add missing type annotation in test_changelog_command (all but those based on legacy pytest tmpdir/py.path.local type which is badly typed)
  • update regression files depending on an invalid mocked date (1970-01-01)

The fixtures has not yet replaced helpers in other tests to reduce the size of the PR (will be done in separate pull requests)

Documentation Changes

None

Expected Behavior

Faster (no sleep) and fully deterministic (full control over time) tests execution.
Cleaner output (no more pages of warnings)
Easier to maintain tests

Steps to Test This Pull Request

Execute poetry test on master and this branch to observe the differences of execution (speed and output).

Additional Context

This was a long task but this was also (IMHO) required to make it easier to maintain tests on long term.
I'll update other test files when this one is merged

Fixes #1623

@codecov
Copy link

codecov bot commented Dec 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.88%. Comparing base (6990d51) to head (7ffbdb3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1746      +/-   ##
==========================================
- Coverage   97.92%   97.88%   -0.04%     
==========================================
  Files          60       60              
  Lines        2604     2604              
==========================================
- Hits         2550     2549       -1     
- Misses         54       55       +1     

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

@noirbizarre noirbizarre enabled auto-merge (rebase) December 29, 2025 18:51
Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

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

This PR is awesome! Just browsed through it Left a few nits and need some time to take a deeper look

Copy link
Member

@woile woile left a comment

Choose a reason for hiding this comment

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

Beautiful! Thanks. LGTM!

@noirbizarre
Copy link
Member Author

PR update with all changes 👍🏼

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove wait_for_tag from tests to speed up test

3 participants