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

Convert tests to functional form #244

Merged
merged 5 commits into from
Apr 12, 2023
Merged

Convert tests to functional form #244

merged 5 commits into from
Apr 12, 2023

Conversation

odow
Copy link
Member

@odow odow commented Apr 11, 2023

Closes #110
Closes #108

Another quite large diff that is just moving things around. This converts all the tests into the function test_ form to remove global state (some test files were just one large global script!).

I also removed the doc examples from the test script, since these get run and tested when the docs are built:

DiffOpt.jl/docs/make.jl

Lines 33 to 37 in 190beb8

# `include` the file to test it before `#src` lines are removed. It is
# in a testset to isolate local variables between files.
@testset "$(filename)" begin
_include_sandbox(filename)
end

and not all tutorials were tested anyway.

This let's us remove a bunch of packages from the tests like Flux and Plots, which should help speed things up.

I haven't addressed #195. That can wait for another PR.

Also, I noticed that there are a lot of comments in the tests with various things commented out and TODOs. I've left for now, but there are lot of open issues related to testing (#202, #109, #108, #107, #106, #102) , so the whole package could use some more work on that front.

@odow
Copy link
Member Author

odow commented Apr 11, 2023

And here's a reason to refactor the tests.

Tests are failing because it looks like https://github.com/jump-dev/DiffOpt.jl/blob/master/test/sensitivity_index_issue.jl was never actually tested.

@codecov
Copy link

codecov bot commented Apr 12, 2023

Codecov Report

Patch coverage has no change and project coverage change: -1.05 ⚠️

Comparison is base (190beb8) 87.92% compared to head (2574dfb) 86.88%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #244      +/-   ##
==========================================
- Coverage   87.92%   86.88%   -1.05%     
==========================================
  Files          11       11              
  Lines        1052     1052              
==========================================
- Hits          925      914      -11     
- Misses        127      138      +11     

see 2 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@matbesancon matbesancon merged commit 8e6b2f3 into master Apr 12, 2023
@matbesancon matbesancon deleted the od/tidy-tests branch April 12, 2023 07:39
@matbesancon
Copy link
Collaborator

Thanks!

@blegat
Copy link
Member

blegat commented Apr 17, 2023

@odow Why removing the test/Project.toml here ? I find it quite useful for testing things locally compared to the extra section in the root Project.toml file

@odow
Copy link
Member Author

odow commented Apr 17, 2023

I never use it, and it can cause confusing bugs: JuliaPolyhedra/CDDLib.jl#82.

But we can add it back...

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

Successfully merging this pull request may close these issues.

put tests into functions Split moi_wrapper test file in conic and qp
3 participants