Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Consider warnings as errors when running pytest #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jhlegarreta
Copy link
Contributor

Consider warnings as errors when running pytest:

  • Add the warnings-as-errors flag to pytest to consider warnings as errors.
  • Use an environment variable NIFREEZE_WERRORS in GHA workflow files to mark the corresponding workflows as treating warnings as errors.
  • Process the pytest session end to mark it as failed if warnings were present.

Implementation drawn from DIPY.

Filter two warnings that are being raised by the current tests:

  • Filter warnings related to GPR parameter optimal values being close to the boundary values raised by scikit-learn.
  • Filter warnings related to the b0 threshold value being updated in gradient table slicing raised by DIPY.

@jhlegarreta
Copy link
Contributor Author

@jhlegarreta jhlegarreta force-pushed the ConsiderWarningsAsErrorsInCI branch 3 times, most recently from 9ba5324 to 57398b0 Compare December 22, 2024 23:18
Copy link

codecov bot commented Dec 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.84%. Comparing base (6b6ba70) to head (5db55a6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #40   +/-   ##
=======================================
  Coverage   65.84%   65.84%           
=======================================
  Files          18       18           
  Lines         931      931           
  Branches      119      119           
=======================================
  Hits          613      613           
  Misses        274      274           
  Partials       44       44           

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

@jhlegarreta
Copy link
Contributor Author

jhlegarreta commented Dec 22, 2024

Warnings are being filtered, but the test is not being marked as failed:

nifreeze_ci_filtered_not_failed

Marking this as draft.

Working: NIFREEZE_WERRORS had to be passed to tox in pass_env:

nifreeze_warnings_as_errors

PR #39 solves the warning at issue. Marking this as ready.

@jhlegarreta jhlegarreta marked this pull request as draft December 22, 2024 23:31
Consider warnings as errors when running `pytest`:
- Add the `warnings-as-errors` flag to `pytest` to consider warnings as
  errors.
- Use an environment variable `NIFREEZE_WERRORS` in GHA workflow files
  to mark the corresponding workflows as treating warnings as errors.
- Process the `pytest` session end to mark it as failed if warnings were
  present.

Implementation drawn from DIPY.

Filter two warnings that are being raised by the current tests:
- Filter warnings related to GPR parameter optimal values being close to
  the boundary values raised by `scikit-learn`.
- Filter warnings related to the b0 threshold value being updated in
  gradient table slicing raised by DIPY.
@jhlegarreta jhlegarreta force-pushed the ConsiderWarningsAsErrorsInCI branch from 57398b0 to 5db55a6 Compare December 22, 2024 23:54
@jhlegarreta jhlegarreta marked this pull request as ready for review December 23, 2024 00:05
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.

1 participant