From da8249f132f7a46c5ea41d11ed8ac302db263ef4 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Sun, 14 Jun 2026 09:14:00 -0400 Subject: [PATCH] Use SciMLTesting v1.2 (explicit-args run_tests over folders) Convert test/runtests.jl to the SciMLTesting v1.2 run_tests dispatcher. The GPU group declares its own sub-env and must NOT be in test_groups.toml (which drives the grouped-tests CI matrix) yet must still route on GROUP=GPU and be excluded from "All"; pure folder-discovery cannot express that, so the explicit-args form (a v1.2-supported path) is used. gpu_all.jl moved into test/GPU/ alongside its env. Added SciMLTesting to the root test target and to the GPU sub-env (with SafeTestsets + Test); dropped Pkg from the root test deps (no test file uses it; the harness owns all Pkg operations). test_groups.toml left unchanged. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- Project.toml | 6 ++--- test/GPU/Project.toml | 6 +++++ test/{ => GPU}/gpu_all.jl | 0 test/runtests.jl | 54 +++++++++++++++++++-------------------- 4 files changed, 35 insertions(+), 31 deletions(-) rename test/{ => GPU}/gpu_all.jl (100%) diff --git a/Project.toml b/Project.toml index 0f494e1..7e57f7f 100644 --- a/Project.toml +++ b/Project.toml @@ -32,7 +32,7 @@ OptimizationOptimJL = "0.4.1" OrdinaryDiffEq = "6.98.0, 7" OrdinaryDiffEqSDIRK = "1.1.0, 2" SciMLBase = "2, 3" -Pkg = "1.10" +SciMLTesting = "1" PrecompileTools = "1.2.1" Random = "1.10.8" RecursiveArrayTools = "3.29.0, 4" @@ -56,7 +56,7 @@ OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" OrdinaryDiffEqSDIRK = "2d112036-d095-4a1e-ab9a-08536f3ecdbf" SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" -Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" @@ -67,4 +67,4 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua", "ADTypes", "ExplicitImports", "ForwardDiff", "Random", "LabelledArrays", "LinearAlgebra", "OrdinaryDiffEq", "OrdinaryDiffEqSDIRK", "SciMLBase", "Test", "RecursiveArrayTools", "Pkg", "SafeTestsets", "Optimization", "OptimizationOptimJL", "SparseArrays", "Symbolics", "SparseConnectivityTracer"] +test = ["Aqua", "ADTypes", "ExplicitImports", "ForwardDiff", "Random", "LabelledArrays", "LinearAlgebra", "OrdinaryDiffEq", "OrdinaryDiffEqSDIRK", "SciMLBase", "SciMLTesting", "Test", "RecursiveArrayTools", "SafeTestsets", "Optimization", "OptimizationOptimJL", "SparseArrays", "Symbolics", "SparseConnectivityTracer"] diff --git a/test/GPU/Project.toml b/test/GPU/Project.toml index ce12923..4112c7f 100644 --- a/test/GPU/Project.toml +++ b/test/GPU/Project.toml @@ -2,10 +2,16 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" OrdinaryDiffEqSDIRK = "2d112036-d095-4a1e-ab9a-08536f3ecdbf" PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" +SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] CUDA = "3.12, 4, 5, 6.1" OrdinaryDiffEqSDIRK = "2" PreallocationTools = "0.4, 1" +SafeTestsets = "0.1, 1" SciMLBase = "2, 3" +SciMLTesting = "1" +Test = "1" diff --git a/test/gpu_all.jl b/test/GPU/gpu_all.jl similarity index 100% rename from test/gpu_all.jl rename to test/GPU/gpu_all.jl diff --git a/test/runtests.jl b/test/runtests.jl index 66b8524..783c149 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,30 +1,28 @@ -using Pkg using SafeTestsets +using SciMLTesting -const GROUP = get(ENV, "GROUP", "All") - -function activate_downstream_env() - Pkg.activate("GPU") - Pkg.develop(PackageSpec(path = dirname(@__DIR__))) - return Pkg.instantiate() -end - -if GROUP == "All" || GROUP == "Core" - @safetestset "Quality Assurance" include("qa.jl") - @safetestset "Explicit Imports" include("explicit_imports.jl") - @safetestset "DiffCache Dispatch" include("core_dispatch.jl") - @safetestset "DiffCache ODE tests" include("core_odes.jl") - @safetestset "DiffCache Resizing" include("core_resizing.jl") - @safetestset "DiffCache Nested Duals" include("core_nesteddual.jl") - @safetestset "DiffCache Sparsity Support" include("sparsity_support.jl") - @safetestset "DiffCache with SparseConnectivityTracer" include("sparse_connectivity_tracer.jl") - @safetestset "LazyBufferCache" include("lbc.jl") - @safetestset "GeneralLazyBufferCache" include("general_lbc.jl") - @safetestset "Zero, Copy, and Fill Dispatches" include("test_zero_copy.jl") - @safetestset "Allocation Regression Tests" include("alloc_tests.jl") -end - -if GROUP == "GPU" - activate_downstream_env() - @safetestset "GPU tests" include("gpu_all.jl") -end +run_tests(; + core = () -> begin + @safetestset "Quality Assurance" include("qa.jl") + @safetestset "Explicit Imports" include("explicit_imports.jl") + @safetestset "DiffCache Dispatch" include("core_dispatch.jl") + @safetestset "DiffCache ODE tests" include("core_odes.jl") + @safetestset "DiffCache Resizing" include("core_resizing.jl") + @safetestset "DiffCache Nested Duals" include("core_nesteddual.jl") + @safetestset "DiffCache Sparsity Support" include("sparsity_support.jl") + @safetestset "DiffCache with SparseConnectivityTracer" include("sparse_connectivity_tracer.jl") + @safetestset "LazyBufferCache" include("lbc.jl") + @safetestset "GeneralLazyBufferCache" include("general_lbc.jl") + @safetestset "Zero, Copy, and Fill Dispatches" include("test_zero_copy.jl") + @safetestset "Allocation Regression Tests" include("alloc_tests.jl") + end, + groups = Dict( + # GPU declares its own sub-env, so it runs ONLY for GROUP="GPU" and is + # excluded from "All" (matches the original `if GROUP == "GPU"` dispatch). + "GPU" => (; + env = joinpath(@__DIR__, "GPU"), body = () -> begin + @safetestset "GPU tests" include(joinpath("GPU", "gpu_all.jl")) + end + ), + ), +)