Skip to content

Commit 0da4100

Browse files
test: isolate root QA into canonical test/qa sub-environment
Move the root package's Quality Assurance tests (Aqua + JET) into an isolated test/qa/ Project so the QA tooling dependencies no longer enter the main test target's resolve, matching the canonical OrdinaryDiffEq lib/<Name>/test/qa/ structure. - Add test/qa/Project.toml: deps Aqua, JET, Optimization, Test; [sources] Optimization = {path = "../.."}; [compat] for each + julia 1.10. - Move test/qa.jl -> test/qa/qa.jl (Aqua + JET tests preserved verbatim; add `using Test` so the file is self-contained in the isolated env). - runtests.jl: add activate_qa_env() (Pkg.activate(test/qa) + instantiate, plus develop-by-path on Julia < 1.11 where [sources] is ignored). The QA safetestset now runs last in the Core group after activating the qa env, so the main-environment tests above are unaffected. CI dispatches only GROUP=Core, so QA continues to run exactly as before. - Remove Aqua and JET from the main Project.toml [extras], [targets].test, and [compat]; they now live solely in the qa environment. Verified on Julia 1.11 in an isolated depot: the qa env instantiates and resolves (Aqua 0.8.16, JET 0.9.20, Optimization 5.6.1 via ../.., Test 1.11.0); the Aqua testset runs green (10/10 pass). No sublibrary runs QA today (the three that list Aqua in [extras] never call it), so per the preserve-existing-behavior rule none were given a qa env. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5ce9a25 commit 0da4100

4 files changed

Lines changed: 33 additions & 6 deletions

File tree

Project.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ path = "lib/OptimizationOptimisers"
3434

3535
[compat]
3636
ADTypes = "1.18"
37-
Aqua = "0.8"
3837
ArrayInterface = "7.10"
3938
BenchmarkTools = "1"
4039
Boltz = "1"
@@ -48,7 +47,6 @@ Flux = "0.13, 0.14, 0.15, 0.16"
4847
ForwardDiff = "0.10, 1"
4948
Ipopt = "1"
5049
IterTools = "1.3"
51-
JET = "0.9, 0.10, 0.11"
5250
LinearAlgebra = "1.10"
5351
LinearSolve = "3.64.0"
5452
Logging = "1.10"
@@ -83,7 +81,6 @@ Zygote = "0.6, 0.7"
8381
julia = "1.10"
8482

8583
[extras]
86-
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
8784
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
8885
Boltz = "4544d5e4-abc5-4dea-817f-29e4c205d9c8"
8986
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
@@ -94,7 +91,6 @@ Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
9491
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
9592
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
9693
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
97-
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
9894
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
9995
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
10096
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
@@ -120,4 +116,4 @@ Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
120116
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
121117

122118
[targets]
123-
test = ["Aqua", "BenchmarkTools", "Boltz", "ComponentArrays", "DiffEqFlux", "Enzyme", "FiniteDiff", "Flux", "ForwardDiff", "Ipopt", "IterTools", "JET", "LinearSolve", "Lux", "MLUtils", "ModelingToolkit", "Optim", "OptimizationLBFGSB", "OptimizationMOI", "OptimizationOptimJL", "OptimizationOptimisers", "OrdinaryDiffEqTsit5", "Pkg", "Random", "ReverseDiff", "SafeTestsets", "SciMLSensitivity", "SparseArrays", "Symbolics", "Test", "Tracker", "Zygote", "Mooncake", "SciMLLogging"]
119+
test = ["BenchmarkTools", "Boltz", "ComponentArrays", "DiffEqFlux", "Enzyme", "FiniteDiff", "Flux", "ForwardDiff", "Ipopt", "IterTools", "LinearSolve", "Lux", "MLUtils", "ModelingToolkit", "Optim", "OptimizationLBFGSB", "OptimizationMOI", "OptimizationOptimJL", "OptimizationOptimisers", "OrdinaryDiffEqTsit5", "Pkg", "Random", "ReverseDiff", "SafeTestsets", "SciMLSensitivity", "SparseArrays", "Symbolics", "Test", "Tracker", "Zygote", "Mooncake", "SciMLLogging"]

test/qa/Project.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[deps]
2+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
3+
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
4+
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
5+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6+
7+
[sources]
8+
Optimization = {path = "../.."}
9+
10+
[compat]
11+
Aqua = "0.8"
12+
JET = "0.9, 0.10, 0.11"
13+
Optimization = "5"
14+
Test = "1.10"
15+
julia = "1.10"

test/qa.jl renamed to test/qa/qa.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using Optimization, Aqua, JET
2+
using Test
3+
24
@testset "Aqua" begin
35
Aqua.find_persistent_tasks_deps(Optimization)
46
Aqua.test_ambiguities(Optimization, recursive = false)

test/runtests.jl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ function activate_downstream_env()
99
return Pkg.instantiate()
1010
end
1111

12+
# QA (Aqua + JET) runs in an isolated environment (test/qa) so its tooling deps
13+
# never enter the main test target's resolve. On Julia < 1.11 the [sources] table
14+
# is ignored, so develop the package by path to test the PR branch code.
15+
function activate_qa_env()
16+
Pkg.activate(joinpath(@__DIR__, "qa"))
17+
if VERSION < v"1.11.0-DEV.0"
18+
Pkg.develop(PackageSpec(path = dirname(@__DIR__)))
19+
end
20+
return Pkg.instantiate()
21+
end
22+
1223
@time begin
1324
# Detect sublibrary test groups.
1425
# GROUP can be a bare sublibrary name (Core test group) or
@@ -74,7 +85,6 @@ end
7485
end
7586
elseif GROUP == "Core"
7687
@testset verbose = true "Optimization.jl" begin
77-
@safetestset "Quality Assurance" include("qa.jl")
7888
@safetestset "Utils Tests" include("utils.jl")
7989
@safetestset "Verbosity Tests" include("verbosity.jl")
8090
@safetestset "AD Tests" include("ADtests.jl")
@@ -86,6 +96,10 @@ end
8696
# @safetestset "DiffEqFlux" include("diffeqfluxtests.jl")
8797
@safetestset "Interface Compatibility" include("interface_tests.jl")
8898
@safetestset "Sense Handling" include("sense_tests.jl")
99+
# QA runs last so the isolated qa environment is activated only after the
100+
# main-environment tests above have finished.
101+
activate_qa_env()
102+
@safetestset "Quality Assurance" include("qa/qa.jl")
89103
end
90104
elseif GROUP == "GPU"
91105
activate_downstream_env()

0 commit comments

Comments
 (0)