From 4e2623257f6e69d1559c68be61b7838ec86b51fd Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Tue, 9 Jun 2026 18:02:12 -0400 Subject: [PATCH 1/3] Canonical CI: grouped-tests.yml + root test/test_groups.toml Convert the root test workflow (CI.yml) to the canonical thin caller that dispatches to SciML/.github grouped-tests.yml@v1, with the version x group matrix declared once in test/test_groups.toml. Category B refactor (Aqua/JET ran inline): JET static analysis is moved out of the always-on functional suite into a dedicated QA group, isolated in test/qa/Project.toml (JET + StaticArrays + Test + the package via [sources] path) with a test/qa/qa.jl. runtests.jl activates that env, develops the package, instantiates, and includes qa.jl when the group is QA; otherwise it runs the functional tests (regression, reinit, CPU optimizer/constraints/lbfgs) as before. The test-group dispatch uses a dedicated env var PPS_TEST_GROUP (group-env-name input) so it does not collide with the existing GROUP env var that GPU.yml and the buildkite pipeline already use for backend selection (CUDA/AMDGPU); runtests.jl still reads GROUP for backend selection in the Core group. Root Project.toml metadata fixes: add missing [compat] entries for the test-only stdlibs LinearAlgebra and Test (both listed in [extras]); julia compat already at the 1.10 LTS floor. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/CI.yml | 12 +++--------- Project.toml | 2 ++ test/{jet.jl => qa.jl} | 0 test/qa/Project.toml | 13 +++++++++++++ test/runtests.jl | 38 ++++++++++++++++++++++++-------------- test/test_groups.toml | 5 +++++ 6 files changed, 47 insertions(+), 23 deletions(-) rename test/{jet.jl => qa.jl} (100%) create mode 100644 test/qa/Project.toml create mode 100644 test/test_groups.toml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ad382aa..f37a8b3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -12,14 +12,8 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: - test: - name: "Tests" - strategy: - fail-fast: false - matrix: - version: - - "1" - uses: "SciML/.github/.github/workflows/tests.yml@v1" + tests: + uses: "SciML/.github/.github/workflows/grouped-tests.yml@v1" with: - julia-version: "${{ matrix.version }}" + group-env-name: PPS_TEST_GROUP secrets: "inherit" diff --git a/Project.toml b/Project.toml index f624209..6d7a479 100644 --- a/Project.toml +++ b/Project.toml @@ -30,6 +30,7 @@ ForwardDiff = "0.10, 1.3" JET = "0.9, 0.10, 0.11" KernelAbstractions = "0.9" LineSearch = "0.1" +LinearAlgebra = "1" NonlinearSolveBase = "2.24" Optimization = "4.1, 5.2" PrecompileTools = "1" @@ -40,6 +41,7 @@ SciMLBase = "2.79, 3.0" Setfield = "1.1" SimpleNonlinearSolve = "2.12" StaticArrays = "1.9" +Test = "1" julia = "1.10" [extras] diff --git a/test/jet.jl b/test/qa.jl similarity index 100% rename from test/jet.jl rename to test/qa.jl diff --git a/test/qa/Project.toml b/test/qa/Project.toml new file mode 100644 index 0000000..c7c271d --- /dev/null +++ b/test/qa/Project.toml @@ -0,0 +1,13 @@ +[deps] +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" +ParallelParticleSwarms = "ab63da0c-63b4-40fa-a3b7-d2cba5be6419" +StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +ParallelParticleSwarms = {path = "../.."} + +[compat] +JET = "0.9, 0.10, 0.11" +StaticArrays = "1.9" +julia = "1.10" diff --git a/test/runtests.jl b/test/runtests.jl index f8e921c..b3304da 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,18 +1,28 @@ -using SafeTestsets -using Test +using Pkg -global CI_GROUP = get(ENV, "GROUP", "CPU") +const TEST_GROUP = get(ENV, "PPS_TEST_GROUP", "Core") -@safetestset "Regression tests" include("./regression.jl") -@safetestset "Reinitialization tests" include("./reinit.jl") -@safetestset "JET static analysis" include("./jet.jl") +if TEST_GROUP == "QA" + Pkg.activate(joinpath(@__DIR__, "qa")) + Pkg.develop(PackageSpec(path = joinpath(@__DIR__, ".."))) + Pkg.instantiate() + include("qa.jl") +else + using SafeTestsets + using Test -#TODO: Current throws warning for redefinition with the use of @testset multiple times. Migrate to TestItemRunners.jl -@testset for BACKEND in unique(("CPU", CI_GROUP)) - global GROUP = BACKEND - @testset "$(BACKEND) optimizers tests" include("./gpu.jl") - GC.gc(true) - @testset "$(BACKEND) optimizers with constraints tests" include("./constraints.jl") - GC.gc(true) - @testset "$(BACKEND) hybrid optimizers" include("./lbfgs.jl") + global CI_GROUP = get(ENV, "GROUP", "CPU") + + @safetestset "Regression tests" include("./regression.jl") + @safetestset "Reinitialization tests" include("./reinit.jl") + + #TODO: Current throws warning for redefinition with the use of @testset multiple times. Migrate to TestItemRunners.jl + @testset for BACKEND in unique(("CPU", CI_GROUP)) + global GROUP = BACKEND + @testset "$(BACKEND) optimizers tests" include("./gpu.jl") + GC.gc(true) + @testset "$(BACKEND) optimizers with constraints tests" include("./constraints.jl") + GC.gc(true) + @testset "$(BACKEND) hybrid optimizers" include("./lbfgs.jl") + end end diff --git a/test/test_groups.toml b/test/test_groups.toml new file mode 100644 index 0000000..1fe84cd --- /dev/null +++ b/test/test_groups.toml @@ -0,0 +1,5 @@ +[Core] +versions = ["lts", "1", "pre"] + +[QA] +versions = ["lts", "1"] From 89577a4526ea55022d48dec19d32db9b1fcf96dd Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Tue, 9 Jun 2026 18:27:09 -0400 Subject: [PATCH 2/3] Add Pkg to test deps for Core group test/runtests.jl does `using Pkg` for the QA group's Pkg.activate, but Pkg was not declared in the Core test environment (project='.'), so the Core job died with `ArgumentError: Package Pkg not found in current path`. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- test/Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Project.toml b/test/Project.toml index 602ee38..1090e98 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -3,6 +3,7 @@ JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" QuasiMonteCarlo = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" From ed76c66a8fc1792ce76071a691fd5a025a8a1290 Mon Sep 17 00:00:00 2001 From: "Chris Rackauckas (Claude)" Date: Tue, 9 Jun 2026 20:48:06 -0400 Subject: [PATCH 3/3] Hoist using SafeTestsets/Test to top level to fix Core-group macro error Move `using SafeTestsets` and `using Test` out of the in-block else branch to top level so the @safetestset/@testset macros are defined before the if-block (which uses them inline) is macro-expanded as a single unit. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- test/runtests.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index b3304da..ac97ce6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,6 @@ using Pkg +using SafeTestsets +using Test const TEST_GROUP = get(ENV, "PPS_TEST_GROUP", "Core") @@ -8,9 +10,6 @@ if TEST_GROUP == "QA" Pkg.instantiate() include("qa.jl") else - using SafeTestsets - using Test - global CI_GROUP = get(ENV, "GROUP", "CPU") @safetestset "Regression tests" include("./regression.jl")