[Dev] Add ExaModels unit tests
@PierreMartinon There are no unit tests with ExaModels.
[!NOTE] Maybe update the direct unit tests.
@ocots @jbcaillau More related maybe to the GPU case, but we can use different test sets by passing arguments to the runtest action in the workflow yaml file (here Moonshot.yml):
- uses: julia-actions/julia-runtest@v1
with:
test_args: 'GPU'
and recover them in runtest.jl
@testset verbose = true showtiming = true "Test CTDirect" begin
if "GPU" in ARGS
# GPU tests only (moonshot workflow)
include("test_gpu.jl")
else
# CPU: run all scripts in subfolder suite/
include.(filter(contains(r".jl$"), readdir("./suite"; join=true)))
end
end
@ocots just to be sure: what do you mean by "unit tests"?
I mean tests, not really unit tests. I don't really know but we need to add tests in: https://github.com/control-toolbox/OptimalControl.jl/tree/main/test/ctdirect/suite.
We can import to OptimalControl the tests in https://github.com/control-toolbox/CTDirect.jl/blob/main/test/suite/test_exa.jl These are CPU, not GPU, and can run normally with the other tests, provided the correct dependencies are added.
There are currently only 2 simple tests, solve with MadNLP and initial guess check. We could add Ipopt for instance. @jbcaillau , which discretizations do we have for ExaModels ?
I have added some simple tests, thanks to @PierreMartinon. See https://github.com/control-toolbox/OptimalControl.jl/pull/577.
@PierreMartinon
We can import to OptimalControl the tests in https://github.com/control-toolbox/CTDirect.jl/blob/main/test/suite/test_exa.jl These are CPU, not GPU, and can run normally with the other tests, provided the correct dependencies are added.
i've also almost added quadrotor2 (needs to be tested, though). these tests must also be run on GPU when available (moonshot)
There are currently only 2 simple tests, solve with MadNLP and initial guess check. We could add Ipopt for instance. @jbcaillau , which discretizations do we have for ExaModels ?
:trapeze, :euler, ~~:euler_b (need to alias that name wrt. what is done in CTDirect)~~; :midpoint on its way https://github.com/control-toolbox/CTParser.jl/pull/94
NB. :euler_b now aliased to :implicit https://github.com/control-toolbox/CTParser.jl/issues/172
@ocots @PierreMartinon this can probably now be tested using problems from OptimalControlProblems and / or CTBenchmarks (+ breakages)
right now: adding in https://github.com/control-toolbox/OptimalControl.jl/issues/677 a test extracted from CTParser on goddard (= rich enough case) for
- exa + ipopt and exa + madnlp on CPU
- exa + madnlp on GPU
for all four numerical schemes