From 5055197f273d3b4bd6a3e9a9a72b3ab96efea523 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Sun, 14 Jun 2026 08:49:46 -0400 Subject: [PATCH] Use SciMLTesting v1.2 folder-based run_tests Convert test/runtests.jl to the SciMLTesting v1.2 folder-discovery model: the whole GROUP dispatch ladder collapses to `run_tests()`, with test files discovered from folders matching test_groups.toml (Core = top-level test/*.jl, QA = test/qa/, NoPre = test/nopre/). - Move qa.jl into test/qa/ so the Core glob (all top-level *.jl) does not run it. QA has no Project.toml, so it runs in the root test env as before. - NoPre keeps its sub-env (test/nopre/Project.toml); folder-discovery activates it and develops the package root, matching the old explicit Pkg.develop. - Preserve the NoPre prerelease gate: GROUP=NoPre runs nothing on prerelease Julia (the original `&& isempty(VERSION.prerelease)`), while "All" globs NoPre unconditionally as before. Wrapped around the bare run_tests(). - Add SciMLTesting + SafeTestsets to the root test deps and to the NoPre sub-env Project.toml; drop Pkg (only the old harness used it). The exact set of files run under each GROUP value (All/Core/QA/NoPre) is unchanged. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- Project.toml | 8 ++-- test/nopre/Project.toml | 8 ++++ test/{ => qa}/qa.jl | 0 test/runtests.jl | 90 +++++------------------------------------ 4 files changed, 22 insertions(+), 84 deletions(-) rename test/{ => qa}/qa.jl (100%) diff --git a/Project.toml b/Project.toml index e070f974..a27bd762 100644 --- a/Project.toml +++ b/Project.toml @@ -42,12 +42,13 @@ OrdinaryDiffEqNonlinearSolve = "1.5.0, 2" OrdinaryDiffEqRosenbrock = "1.8.0, 2" OrdinaryDiffEqTsit5 = "1.1.0, 2" OrdinaryDiffEqVerner = "1.1.1, 2" -Pkg = "1.10.0" PrecompileTools = "1.2.1" QuadGK = "2.9" RecipesBase = "1.3.4" RecursiveArrayTools = "3.36, 4" +SafeTestsets = "0.0.1, 0.1, 1" SciMLBase = "2.146, 3.1" +SciMLTesting = "1" StaticArrays = "1.9.7" StaticArraysCore = "1.4.3" Sundials = "4.19.2" @@ -68,11 +69,12 @@ OrdinaryDiffEqNonlinearSolve = "127b3ac7-2247-4354-8eb6-78cf4e7c58e8" OrdinaryDiffEqRosenbrock = "43230ef6-c299-4910-a778-202eb28ce4ce" OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a" OrdinaryDiffEqVerner = "79d7bb75-1356-48c1-b8c0-6832512096c2" -Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["ADTypes", "Aqua", "DataInterpolations", "ForwardDiff", "Pkg", "NonlinearSolve", "ODEProblemLibrary", "OrdinaryDiffEqBDF", "OrdinaryDiffEqLowOrderRK", "OrdinaryDiffEqNonlinearSolve", "OrdinaryDiffEqTsit5", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqVerner", "QuadGK", "StaticArrays", "Test", "Functors"] +test = ["ADTypes", "Aqua", "DataInterpolations", "ForwardDiff", "NonlinearSolve", "ODEProblemLibrary", "OrdinaryDiffEqBDF", "OrdinaryDiffEqLowOrderRK", "OrdinaryDiffEqNonlinearSolve", "OrdinaryDiffEqTsit5", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqVerner", "QuadGK", "SafeTestsets", "SciMLTesting", "StaticArrays", "Test", "Functors"] diff --git a/test/nopre/Project.toml b/test/nopre/Project.toml index ed71eecd..0e03883b 100644 --- a/test/nopre/Project.toml +++ b/test/nopre/Project.toml @@ -8,11 +8,16 @@ JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb" OrdinaryDiffEqLowOrderRK = "1344f307-1e59-4825-a18e-ace9aa3fa4c6" OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a" QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" SciMLSensitivity = "1ed8b502-d754-442c-8d5d-10ac956f44a1" +SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" +[sources] +DiffEqCallbacks = {path = "../.."} + [compat] ComponentArrays = "0.15.18" ForwardDiff = "0.10.36" @@ -22,6 +27,9 @@ JLArrays = "0.1, 0.2" OrdinaryDiffEqLowOrderRK = "2" OrdinaryDiffEqTsit5 = "2" QuadGK = "2.9" +SafeTestsets = "0.0.1, 0.1, 1" SciMLSensitivity = "7.105" +SciMLTesting = "1" +Test = "1" Tracker = "0.2.35" Zygote = "0.6.69, 0.7" diff --git a/test/qa.jl b/test/qa/qa.jl similarity index 100% rename from test/qa.jl rename to test/qa/qa.jl diff --git a/test/runtests.jl b/test/runtests.jl index e80f2c78..f188787f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,83 +1,11 @@ -using DiffEqCallbacks -import Functors -using Test -const GROUP = get(ENV, "GROUP", "All") +using SciMLTesting -# write your own tests here -@time @testset "DiffEqCallbacks" begin - if GROUP == "QA" - @time @testset "Quality Assurance" begin - include("qa.jl") - end - end - - if GROUP == "All" || GROUP == "Core" - @time @testset "AutoAbstol" begin - include("autoabstol_tests.jl") - end - @time @testset "TerminateSteadyState tests" begin - include("terminatesteadystate_test.jl") - end - @time @testset "StepsizeLimiter tests" begin - include("stepsizelimiter_tests.jl") - end - @time @testset "Function Calling tests" begin - include("funccall_tests.jl") - end - @time @testset "IndependentlyLinearized tests" begin - include("independentlylinearizedtests.jl") - end - @time @testset "PresetTime tests" begin - include("preset_time.jl") - end - @time @testset "Iterative tests" begin - include("iterative_tests.jl") - end - @time @testset "Periodic tests" begin - include("periodic_tests.jl") - end - @time @testset "Manifold tests" begin - include("manifold_tests.jl") - end - @time @testset "Domain tests" begin - include("domain_tests.jl") - end - @time @testset "ProbInts tests" begin - include("probints.jl") - end - @time @testset "Integrating tests" begin - include("integrating_tests.jl") - end - @time @testset "Integrating sum tests" begin - include("integrating_sum_tests.jl") - end - @time @testset "Integrating GK tests" begin - include("integrating_GK_tests.jl") - end - @time @testset "Integrating GK Sum tests" begin - include("integrating_GK_sum_tests.jl") - end - @time @testset "Saving tests" begin - include("saving_tests.jl") - end - end - - if GROUP == "All" || GROUP == "NoPre" && isempty(VERSION.prerelease) - import Pkg - Pkg.activate("nopre") - Pkg.develop(Pkg.PackageSpec(path = dirname(@__DIR__))) - Pkg.instantiate() - @time @testset "JET tests" begin - include("nopre/jet_tests.jl") - end - @time @testset "Integrating Sensitivity tests" begin - include("nopre/integrating_sensitivity_tests.jl") - end - @time @testset "Integrating Sum Sensitivity tests" begin - include("nopre/integrating_sum_sensitivity_tests.jl") - end - @time @testset "Saving Tracker tests" begin - include("nopre/saving_tracker_tests.jl") - end - end +# The NoPre group is selectable by name only on non-prerelease Julia (the original +# `GROUP == "NoPre" && isempty(VERSION.prerelease)` gate). Under "All" the NoPre +# folder always ran regardless of prerelease, and folder-discovery's "All" globs the +# NoPre folder unconditionally, so "All" is unaffected by this guard. +if current_group() == "NoPre" && !isempty(VERSION.prerelease) + # prerelease Julia: GROUP=NoPre runs nothing, matching the original gate. +else + run_tests() end