Skip to content

Generate repro test errors when model does not run successfully#173

Merged
jo-basevi merged 5 commits intomainfrom
170-raise-error-for-model-did-not-run
Dec 11, 2025
Merged

Generate repro test errors when model does not run successfully#173
jo-basevi merged 5 commits intomainfrom
170-raise-error-for-model-did-not-run

Conversation

@jo-basevi
Copy link
Contributor

This PR:

  • Adds more stdout/error logs to exception messages so they will be displayed as part of annotations on the PR workflow logs (to make it easier to find out what went wrong)
  • Moves checking whether the experiments ran without errors as part of setup in a fixture rather than within the test. This means any exceptions will be reported as a test setup error rather than a test failure. This will hopefully make it more clear when test failures are repro failures rather than the model did not run.

Closes #170

@codecov
Copy link

codecov bot commented Jul 29, 2025

Codecov Report

❌ Patch coverage is 84.21053% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.69%. Comparing base (b881d91) to head (9432980).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...fig_tests/config_tests/test_bit_reproducibility.py 78.94% 4 Missing ⚠️
src/model_config_tests/exp_test_helper.py 89.47% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #173       +/-   ##
===========================================
+ Coverage   68.39%   85.69%   +17.29%     
===========================================
  Files          14       22        +8     
  Lines         829     1244      +415     
===========================================
+ Hits          567     1066      +499     
+ Misses        262      178       -84     

☔ 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.

… to exceptions

Add stdout and stderr to model run exceptions so it is displayed in the test output on Github
…ixture

This means any errors from non-zero exit status from model runs are reported as test setup errors vs reproducibility test failures
@jo-basevi jo-basevi force-pushed the 170-raise-error-for-model-did-not-run branch from 5fed4da to 5a53d1a Compare December 2, 2025 23:52
@jo-basevi
Copy link
Contributor Author

Rebased changes onto main and resolved conflicts.

@jo-basevi
Copy link
Contributor Author

The latest version of pytest-cov dropped support for subprocess measurement by default (see https://pytest-cov.readthedocs.io/en/latest/subprocess-support.html). As a number of tests for tests currently use subprocess to invoke the tests, this python code coverage wasn't being measured. Added measuring code coverage in subprocess call back in 9432980

Copy link
Member

@CodeGat CodeGat left a comment

Choose a reason for hiding this comment

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

We ran through this on a call, looks good!

@jo-basevi jo-basevi merged commit cb6a51e into main Dec 11, 2025
8 checks passed
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.

Raise error in repro tests if model did not run

2 participants