Skip to content

refactor(test): one set of tests for the four modelings (T4 of #449) - #476

Merged
ocots merged 1 commit into
mainfrom
refactor/shared-modeling-tests
Nov 20, 2026
Merged

ocots merged 1 commit into
mainfrom
refactor/shared-modeling-tests

Conversation

@ocots

@ocots ocots commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

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.jl holds the tests every modeling shares: test_draft, test_smoke, test_convergence, test_robustness (and test_problem for the modelings that return a Problem). The adapter of a modeling gains an optional build(problem, grid_size): a JuMP problem function returns the model, built on its grid; by default the Problem is built.
  • common/jump_tests.jl: the adapter of JuMP. The JuMP test_smoke, test_draft, cron/JuMP/test_convergence and robustness/JuMP/test_robustness, and robustness/OptimalControl/test_robustness, become wrappers of a few lines: the convergence and robustness reports are written once for the four modelings.
  • test_draft for 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, no test_problem for JuMP, the analytic solutions checked once, features and components compared in comparison and test_modelings).

The lines of the reports keep their names (test_convergence solver=ipopt, test_robustness …): the crons and tools/references read them unchanged.

Test plan

  • Pkg.test(; test_args=["JuMP", "OptimalControl", "OptimalControlScalarized", "ModelingToolkit"]): passed (core 2340, the four environments).
  • JuMP cron, JuMP robustness, OptimalControl robustness on beam: passed; the result rows keep their format (test_convergence solver=ipopt, test_robustness solver=ipopt mu_init=0.001, …).
  • CI.

🤖 Generated with Claude Code

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>
@ocots ocots added the run ci github-runner Trigger the CI workflow on GitHub-hosted runners label Nov 20, 2026
Base automatically changed from refactor/grid-by-modeling-only to main November 20, 2026 18:14
@ocots
ocots merged commit 5b6eb73 into main Nov 20, 2026
19 of 20 checks passed
@ocots
ocots deleted the refactor/shared-modeling-tests branch November 20, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run ci github-runner Trigger the CI workflow on GitHub-hosted runners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant