From cc2c80d3dfb52dab500eadf0dd3ebd967712db13 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Mon, 8 Jun 2026 07:07:27 -0400 Subject: [PATCH] Split tests into Core/QA groups; CI.yml -> grouped-tests.yml caller Refactor the test suite to the canonical SciML Core/QA group layout so the matrix lives in test/test_groups.toml and CI.yml becomes a thin caller of the centralized reusable grouped-tests workflow. - runtests.jl: add GROUP dispatch (default "All"). The functional tests (Dense/Sparse/Symbols/Legacy/Miscellaneous/Public) now run under GROUP "Core"/"All". Aqua.test_all + JET.test_package move into a "QA" group that activates the light test/qa env via Pkg.activate(joinpath(@__DIR__, "qa")) (+ develop on Julia < 1.11 since [sources] is not honored there) before running. Keeps the original Aqua/JET options (deps_compat check_extras=false, JET target_defined_modules=true). - test/qa/Project.toml + test/qa/qa.jl: light QA env carrying only Aqua, JET, Pkg, Test and the package via [sources] path = "../..". - Project.toml: drop Aqua/JET from the main test [extras]/[targets] (they now live only in the QA env) and add Pkg (needed by runtests for env activation). - test/test_groups.toml: Core on [lts, 1, pre], QA on [lts, 1]. - .github/workflows/CI.yml: replace the version matrix calling tests.yml@v1 with a thin caller of grouped-tests.yml@v1 (existing triggers/concurrency preserved). Other workflows untouched. Run locally on Julia 1.11: Core 507/507 PASS; QA 11/11 PASS (Aqua 0.8.16 + JET 0.9.20 resolved via the light test/qa env). Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/CI.yml | 20 ++---------- Project.toml | 5 ++- test/qa/Project.toml | 17 +++++++++++ test/qa/qa.jl | 12 ++++++++ test/runtests.jl | 66 ++++++++++++++++++++++++---------------- test/test_groups.toml | 5 +++ 6 files changed, 77 insertions(+), 48 deletions(-) create mode 100644 test/qa/Project.toml create mode 100644 test/qa/qa.jl create mode 100644 test/test_groups.toml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 385cbf5..584308f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,22 +11,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: - test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} - strategy: - fail-fast: false - matrix: - version: - - 'lts' - - '1' - - 'pre' - os: - - ubuntu-latest - arch: - - x64 - uses: "SciML/.github/.github/workflows/tests.yml@v1" - with: - julia-version: ${{ matrix.version }} - julia-arch: ${{ matrix.arch }} - os: ${{ matrix.os }} + tests: + uses: "SciML/.github/.github/workflows/grouped-tests.yml@v1" secrets: "inherit" diff --git a/Project.toml b/Project.toml index 6316e86..adb3dd1 100644 --- a/Project.toml +++ b/Project.toml @@ -20,12 +20,11 @@ EnzymeCore = "0.5.3,0.6,0.7,0.8" julia = "1.10" [extras] -Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" -JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua", "ChainRulesCore", "EnzymeCore", "JET", "Setfield", "Test"] +test = ["ChainRulesCore", "EnzymeCore", "Pkg", "Setfield", "Test"] diff --git a/test/qa/Project.toml b/test/qa/Project.toml new file mode 100644 index 0000000..0443eba --- /dev/null +++ b/test/qa/Project.toml @@ -0,0 +1,17 @@ +[deps] +ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +ADTypes = {path = "../.."} + +[compat] +ADTypes = "1" +Aqua = "0.8" +JET = "0.9, 0.10, 0.11" +Pkg = "1" +Test = "1" +julia = "1.10" diff --git a/test/qa/qa.jl b/test/qa/qa.jl new file mode 100644 index 0000000..47c902d --- /dev/null +++ b/test/qa/qa.jl @@ -0,0 +1,12 @@ +using ADTypes +using Aqua: Aqua +using JET: JET +using Test + +@testset "Aqua.jl" begin + Aqua.test_all(ADTypes; deps_compat = (check_extras = false,)) +end + +@testset "JET.jl" begin + JET.test_package(ADTypes, target_defined_modules = true) +end diff --git a/test/runtests.jl b/test/runtests.jl index c77d322..d7b421a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,3 +1,4 @@ +using Pkg using ADTypes using ADTypes: AbstractADType, mode, @@ -17,14 +18,24 @@ using ADTypes: dense_ad, column_coloring, row_coloring, symmetric_coloring -using Aqua: Aqua using ChainRulesCore: ChainRulesCore, RuleConfig, HasForwardsMode, HasReverseMode, NoForwardsMode, NoReverseMode using EnzymeCore: EnzymeCore -using JET: JET using Test +const GROUP = get(ENV, "GROUP", "All") + +function activate_qa_env() + Pkg.activate(joinpath(@__DIR__, "qa")) + # On Julia < 1.11 the [sources] section in the qa Project.toml is not honored, + # so Pkg.develop the package root path explicitly to test the PR branch code. + if VERSION < v"1.11.0-DEV.0" + Pkg.develop(PackageSpec(path = dirname(@__DIR__))) + end + return Pkg.instantiate() +end + ## Backend-specific struct CustomTag end @@ -91,33 +102,34 @@ end ## Tests -@testset verbose = true "ADTypes.jl" begin - if VERSION >= v"1.10" - @testset "Aqua.jl" begin - Aqua.test_all(ADTypes; deps_compat = (check_extras = false,)) +if GROUP == "All" || GROUP == "Core" + @testset verbose = true "ADTypes.jl" begin + @testset "Dense" begin + include("dense.jl") end - @testset "JET.jl" begin - JET.test_package(ADTypes, target_defined_modules = true) + @testset "Sparse" begin + include("sparse.jl") end - end - @testset "Dense" begin - include("dense.jl") - end - @testset "Sparse" begin - include("sparse.jl") - end - @testset "Symbols" begin - include("symbols.jl") - end - @testset "Legacy" begin - include("legacy.jl") - end - @testset "Miscellaneous" begin - include("misc.jl") - end - if VERSION >= v"1.11.0-DEV.469" - @testset "Public" begin - include("public.jl") + @testset "Symbols" begin + include("symbols.jl") + end + @testset "Legacy" begin + include("legacy.jl") + end + @testset "Miscellaneous" begin + include("misc.jl") end + if VERSION >= v"1.11.0-DEV.469" + @testset "Public" begin + include("public.jl") + end + end + end +end + +if GROUP == "QA" + activate_qa_env() + @testset "Quality Assurance" begin + include(joinpath(@__DIR__, "qa", "qa.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"]