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

Clean up numeric_expr dispatcher test driver #3551

Merged
merged 2 commits into from
Apr 3, 2025

Conversation

jsiirola
Copy link
Member

@jsiirola jsiirola commented Apr 2, 2025

Fixes # .

Summary/Motivation:

This is a NFC PR that resolves a bug in the test driver for testing the numeric_expr dispatchers where one test could bleed into the next (specifically, when testing a mutable sum as the first argument, the conversion of that argument to immutable would bleed into the remaining tests in that test group). Fixing this (lines 207 and 263) led to 170 test failures because the baselines were referring to the mutable expressions. Updating the baselines to NOT refer tot he original mutable expressions resulted in identifying 4 tests whose baselines were "materially wrong" (i.e., the test was testing the wrong thing):

pyomo/core/tests/unit/test_numeric_expr_dispatcher.py::TestExpressionGeneration::test_sub_mutable_l0
pyomo/core/tests/unit/test_numeric_expr_dispatcher.py::TestExpressionGeneration::test_sub_mutable_l3
pyomo/core/tests/unit/test_numeric_expr_zerofilter.py::TestExpressionGeneration_ZeroFilter::test_sub_mutable_l0
pyomo/core/tests/unit/test_numeric_expr_zerofilter.py::TestExpressionGeneration_ZeroFilter::test_sub_mutable_l3

Note that this is only affecting test code: the expression system was - and continues to be - doing the right thing.

Changes proposed in this PR:

  • Correct expression dispatcher test driver to not allow tests to bleed into each otehr

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

jsiirola added 2 commits April 2, 2025 14:51
This prevents the conversion of a mutable arg into an immutable one from
bleeding into the next test
Copy link

codecov bot commented Apr 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.70%. Comparing base (fa15cc7) to head (42735c3).
Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3551      +/-   ##
==========================================
- Coverage   88.70%   88.70%   -0.01%     
==========================================
  Files         888      888              
  Lines      102024   102024              
==========================================
- Hits        90505    90503       -2     
- Misses      11519    11521       +2     
Flag Coverage Δ
builders 26.57% <ø> (+0.01%) ⬆️
default 84.82% <ø> (?)
expensive 33.96% <ø> (?)
linux 86.17% <ø> (-2.29%) ⬇️
linux_other 86.17% <ø> (-0.01%) ⬇️
osx 76.09% <ø> (-0.01%) ⬇️
win 84.66% <ø> (-0.01%) ⬇️
win_other 84.66% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@blnicho blnicho merged commit cfc0850 into Pyomo:main Apr 3, 2025
35 checks passed
@jsiirola jsiirola deleted the numeric_expr-test-driver branch April 4, 2025 04:07
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.

3 participants