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

Fixing sol interface tests #357

Merged
merged 13 commits into from
Jan 25, 2024

Conversation

cmhyett
Copy link
Contributor

@cmhyett cmhyett commented Jan 23, 2024

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

It was clear how to remedy the first test by including the periodic BC data that the ODE solver doesn't know.
I was not sure what the second test was attempting, open for suggestions. Atm just marked as broken.

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (494dd7e) 0.00% compared to head (b35321b) 84.74%.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #357       +/-   ##
===========================================
+ Coverage    0.00%   84.74%   +84.74%     
===========================================
  Files          37       41        +4     
  Lines        1910     1960       +50     
===========================================
+ Hits            0     1661     +1661     
+ Misses       1910      299     -1611     

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

@cmhyett
Copy link
Contributor Author

cmhyett commented Jan 23, 2024

PR ballooned a bit. Recent(?) change to Test.jl must've changed the functionality of @test_broken so that declaring it before a testset now throws an error, e.g. @test_broken begin ... end around tests now errors with Expression evaluated to non-Boolean

Initially I was simply going to find/replace with @test_skip, but @test_broken is nice when it is on specific tests. So I attempted to only use @test_skip when there was an internal error being thrown in a "broken" testset, and otherwise reinstate the @testset with @test_broken tests.

We ought to track and remedy the skipped tests.

@ChrisRackauckas
Copy link
Member

It looks like @test_broken was being used incorrectly. We need to mark the specific lines in there as being broken, and any broken needs to be an error or bool. It should be @test_broken SciMLBase.successful_retcode(solve(prob))

@ChrisRackauckas
Copy link
Member

Skipping the full testsets seems a little dangerous because then we get no warning of them being fixed, which is what I assume we want to be doing soon

@ChrisRackauckas
Copy link
Member

PR ballooned a bit. Recent(?) change to Test.jl must've changed the functionality of @test_broken so that declaring it before a testset now throws an error, e.g. @test_broken begin ... end around tests now errors with Expression evaluated to non-Boolean

Yes that was a v1.10 change.

@cmhyett
Copy link
Contributor Author

cmhyett commented Jan 24, 2024

  • replace sol.retcode == ... with SciMLBase.successful_retcode(solve(prob))
  • Find offending line in skipped testsets, add in @test_throws, no skipped testsets.

@ChrisRackauckas
Copy link
Member

Find offending line in skipped testsets, add in @test_throws, no skipped testsets.

@test_throws isn't the correct thing to use here. @test_throws is made to test a correct error throw, i.e. setting up a deliberate error and catching that the correct error is found. In these situations, the tests are throwing when they shouldn't be. That should be using @test_broken, but changing the call to evaluating a boolean that will check for if the test ever passes. So on the prob one, you'd do @test_broken ODEProblem(...) isa ODEProblem

@ChrisRackauckas ChrisRackauckas merged commit 951d632 into SciML:master Jan 25, 2024
24 of 26 checks passed
@cmhyett cmhyett deleted the fixing_sol_interface_tests branch January 26, 2024 20:10
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.

None yet

2 participants