Repository navigation
refactor(test): one set of tests for the four modelings (T4 of #449) - #476
Merged
Merged
Conversation
The draft warning, the smoke solves, the convergence and robustness reports are written once in common/modeling_tests.jl, with an adapter per modeling: JuMP gets one (common/jump_tests.jl), whose build makes the model on its grid. The test files of JuMP and the robustness of OptimalControl become wrappers; every modeling now tests the draft warning (JuMP only did). test/README.md has a table of what each modeling tests, and why not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
16 of 53 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #449 (T4, findings 2 and 3 of the review). Based on #475: to merge after it. Conventions: ct-conventions v0.14.0, ct-agents v0.5.0.
Summary
common/modeling_tests.jlholds the tests every modeling shares:test_draft,test_smoke,test_convergence,test_robustness(andtest_problemfor the modelings that return aProblem). The adapter of a modeling gains an optionalbuild(problem, grid_size): a JuMP problem function returns the model, built on its grid; by default theProblemis built.common/jump_tests.jl: the adapter of JuMP. The JuMPtest_smoke,test_draft,cron/JuMP/test_convergenceandrobustness/JuMP/test_robustness, androbustness/OptimalControl/test_robustness, become wrappers of a few lines: the convergence and robustness reports are written once for the four modelings.test_draftfor OptimalControl, OptimalControlScalarized and ModelingToolkit: only JuMP tested the draft warning.test/README.md: a table modeling × kind of test, each gap with its reason (robustness for one modeling per kind of transcription, notest_problemfor JuMP, the analytic solutions checked once, features and components compared incomparisonandtest_modelings).The lines of the reports keep their names (
test_convergence solver=ipopt,test_robustness …): the crons andtools/referencesread them unchanged.Test plan
Pkg.test(; test_args=["JuMP", "OptimalControl", "OptimalControlScalarized", "ModelingToolkit"]): passed (core 2340, the four environments).JuMP cron,JuMP robustness,OptimalControl robustnessonbeam: passed; the result rows keep their format (test_convergence solver=ipopt,test_robustness solver=ipopt mu_init=0.001, …).🤖 Generated with Claude Code