Skip to content

Commit ff86515

Browse files
ChrisRackauckas-ClaudeChrisRackauckasclaude
authored
Canonical CI: grouped-tests.yml + root test/test_groups.toml (#111)
* Canonical CI: grouped-tests.yml + root test/test_groups.toml Convert the root test workflow (Tests.yml) to the canonical thin caller delegating to SciML/.github grouped-tests.yml@v1, with the version/group matrix declared in test/test_groups.toml. - Tests.yml: replace the version-matrix job with the grouped-tests.yml@v1 thin caller (on:/concurrency: preserved verbatim, name: kept). All defaults; runtests.jl reads canonical GROUP, Linux-only. - test/test_groups.toml: [Core] on [lts,1,pre]; [QA] on [lts,1]. - Refactor test/runtests.jl for GROUP dispatch. Functional testsets run under Core (and the default All). Aqua + ExplicitImports move into a QA group gated on GROUP=="QA". - test/qa/ isolated environment (Aqua, ExplicitImports, Test + the package via [sources] path) and test/qa.jl carrying the moved checks unchanged. - Project.toml: bump julia compat 1 -> 1.10 (LTS floor); add Test = "1" compat for the [extras] Test entry (benign Aqua metadata fixes). No tests/Aqua/JET were run locally; QA is newly wired and will run in CI. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Add Pkg to test deps for grouped-tests Core group The Core test group runs with project='.', and test/runtests.jl does `using Pkg` to activate the QA sub-environment. Pkg was not a declared test dependency in the root test env, so the Core job failed with `ArgumentError: Package Pkg not found in current path`. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Drop unused test deps with unsatisfiable LTS/1.x compat pins The grouped-tests-ci branch added hard single-version compat pins to the shared root test/Project.toml. Three of those deps are never imported by any test or doc (JET, Cthulhu, SparseDiffTools) yet their pins make the shared test env unsatisfiable on the QA julias (lts=1.10, 1=1.11): - JET = 0.11.3 and Cthulhu = 3.0.2 require julia >= 1.12. - SparseDiffTools = 2.26.0 forces SciMLOperators 0.3-0.4, conflicting with the OrdinaryDiffEq 7 / NonlinearSolve 4 stack the tests actually use (which needs SciMLOperators 1.x). Removing these dead deps lets the root test env resolve on 1.10/1.11 and unblocks every group (QA and Core) without weakening any real test. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Adopt SciMLTesting v1.2 folder-based run_tests (on top of grouped-tests conversion) FVM's Core group is a capability/shared-module driver: the test files use `using ..FiniteVolumeMethod` and a shared `test_functions.jl` include, and Core also runs the docs/src/literate_tutorials and literate_wyos example files (outside test/) with file-count assertions. That does not partition into self-contained group folders, so this uses v1.2 explicit-args mode rather than forcing folder-discovery: * The whole original Core driver (the `safe_include` helper + the nested `@testset`s, verbatim) moves into test/core_tests.jl and is passed as the `core =` file body. The `@safetestset` wrapper supplies `using Test`, and core_tests.jl's `using FiniteVolumeMethod` makes the nested-module `using ..FiniteVolumeMethod` in each included test file resolve exactly as before. * QA: top-level test/qa.jl moves into test/qa/qa.jl (the existing qa sub-env), run as `qa = (; env = test/qa, body = test/qa/qa.jl)`. * `all = ["Core"]` keeps GROUP=All to Core only (QA stays its own lane), matching the original `if GROUP == "QA" ... else <Core> end` routing. Adds SciMLTesting + SafeTestsets to the main test env and the qa sub-env; drops Pkg from the test env (only the old hand-rolled harness used it). Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3177e7c commit ff86515

8 files changed

Lines changed: 140 additions & 118 deletions

File tree

‎.github/workflows/Tests.yml‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,5 @@ concurrency:
1616

1717
jobs:
1818
tests:
19-
name: "Tests"
20-
strategy:
21-
fail-fast: false
22-
matrix:
23-
version:
24-
- "1.11"
25-
- "pre"
26-
- "lts"
27-
uses: "SciML/.github/.github/workflows/tests.yml@v1"
28-
with:
29-
julia-version: "${{ matrix.version }}"
19+
uses: "SciML/.github/.github/workflows/grouped-tests.yml@v1"
3020
secrets: "inherit"

‎Project.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ DelaunayTriangulation = "1.0"
2020
PreallocationTools = "0.4, 1.2"
2121
PrecompileTools = "1.2"
2222
SciMLBase = "2.34, 3.1"
23+
Test = "1"
2324
julia = "1"
2425

2526
[extras]

‎test/Project.toml‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
55
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
66
Bessels = "0e736298-9ec6-45e8-9647-e4fc86a2fe38"
77
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
8-
Cthulhu = "f68482b8-f384-11e8-15f7-abe071a5a75f"
98
Cubature = "667455a9-e2ce-5579-9412-b964f529a492"
109
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
1110
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
@@ -15,7 +14,6 @@ DisplayAs = "0b91fe84-8a4c-11e9-3e1d-67c38462b6d6"
1514
ElasticArrays = "fdbdab4c-e67f-52f5-8c3f-e7b388dad3d4"
1615
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
1716
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
18-
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
1917
Krylov = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7"
2018
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
2119
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
@@ -26,9 +24,10 @@ PolygonOps = "647866c9-e3ac-4575-94e7-e3d426903924"
2624
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
2725
ReferenceTests = "324d217c-45ce-50fc-942e-d289b448e8cf"
2826
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
27+
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
28+
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
2929
SimpleGraphs = "55797a34-41de-5266-9ec1-32ac4eb504d3"
3030
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
31-
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
3231
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
3332
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
3433
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
@@ -43,7 +42,6 @@ Aqua = "0.7, 0.8"
4342
BenchmarkTools = "1.8.0"
4443
Bessels = "0.2.8"
4544
CairoMakie = "0.15.11"
46-
Cthulhu = "3.0.2"
4745
Cubature = "1.5.1"
4846
DataInterpolations = "8.10.0"
4947
DelaunayTriangulation = "1.6.6"
@@ -52,7 +50,6 @@ DisplayAs = "0.1.6"
5250
ElasticArrays = "1.2.12"
5351
ExplicitImports = "1.15.0"
5452
FastGaussQuadrature = "1.3.0"
55-
JET = "0.11.3"
5653
Krylov = "0.10.6"
5754
LinearSolve = "3.84.0"
5855
NaturalNeighbours = "1.3.6"
@@ -61,8 +58,9 @@ OrdinaryDiffEq = "7.0.0"
6158
PolygonOps = "0.1.2"
6259
ReferenceTests = "0.10.6"
6360
Roots = "3.0.0"
61+
SafeTestsets = "0.1, 1"
62+
SciMLTesting = "1"
6463
SimpleGraphs = "0.8.10"
65-
SparseDiffTools = "2.26.0"
6664
SpecialFunctions = "2.8.0"
6765
StableRNGs = "1.0.4"
6866
StatsBase = "0.34.11"

‎test/core_tests.jl‎

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
using FiniteVolumeMethod
2+
using Dates
3+
4+
ct() = Dates.format(now(), "HH:MM:SS")
5+
function safe_include(filename; name = filename) # Workaround for not being able to interpolate into SafeTestset test names
6+
mod = @eval module $(gensym()) end
7+
@info "[$(ct())] Testing $name"
8+
return @testset verbose = true "Example: $name" begin
9+
Base.include(mod, filename)
10+
end
11+
end
12+
13+
@testset verbose = true "FiniteVolumeMethod.jl" begin
14+
@testset verbose = true "Geometry" begin
15+
safe_include("geometry.jl")
16+
end
17+
@testset verbose = true "Conditions" begin
18+
safe_include("conditions.jl")
19+
end
20+
@testset verbose = true "Problem" begin
21+
safe_include("problem.jl")
22+
end
23+
@testset verbose = true "Equations" begin
24+
safe_include("equations.jl")
25+
end
26+
@testset verbose = true "README" begin
27+
safe_include("README.jl")
28+
end
29+
30+
@testset verbose = true "Tutorials" begin
31+
dir = joinpath(dirname(@__DIR__), "docs", "src", "literate_tutorials")
32+
files = readdir(dir)
33+
file_names = [
34+
"diffusion_equation_in_a_wedge_with_mixed_boundary_conditions.jl",
35+
"diffusion_equation_on_a_square_plate.jl",
36+
"diffusion_equation_on_an_annulus.jl",
37+
"equilibrium_temperature_distribution_with_mixed_boundary_conditions_and_using_ensembleproblems.jl",
38+
"helmholtz_equation_with_inhomogeneous_boundary_conditions.jl",
39+
"laplaces_equation_with_internal_dirichlet_conditions.jl",
40+
"mean_exit_time.jl",
41+
"piecewise_linear_and_natural_neighbour_interpolation_for_an_advection_diffusion_equation.jl",
42+
"porous_fisher_equation_and_travelling_waves.jl",
43+
"porous_medium_equation.jl",
44+
"reaction_diffusion_brusselator_system_of_pdes.jl",
45+
"reaction_diffusion_equation_with_a_time_dependent_dirichlet_boundary_condition_on_a_disk.jl",
46+
"solving_mazes_with_laplaces_equation.jl",
47+
"gray_scott_model_turing_patterns_from_a_coupled_reaction_diffusion_system.jl",
48+
] # do it manually just to make it easier for testing individual files rather than in a loop, e.g. one like
49+
#=
50+
for file in files
51+
@testset "Example: $file" begin
52+
safe_include(joinpath(dir, file))
53+
end
54+
end
55+
=#
56+
@test length(files) == length(file_names) # make sure we didn't miss any
57+
safe_include(joinpath(dir, file_names[1]); name = file_names[1]) # diffusion_equation_in_a_wedge_with_mixed_boundary_conditions
58+
safe_include(joinpath(dir, file_names[2]); name = file_names[2]) # diffusion_equation_on_a_square_plate
59+
safe_include(joinpath(dir, file_names[3]); name = file_names[3]) # diffusion_equation_on_an_annulus
60+
safe_include(joinpath(dir, file_names[4]); name = file_names[4]) # equilibrium_temperature_distribution_with_mixed_boundary_conditions_and_using_ensembleproblems
61+
safe_include(joinpath(dir, file_names[5]); name = file_names[5]) # helmholtz_equation_with_inhomogeneous_boundary_conditions
62+
safe_include(joinpath(dir, file_names[6]); name = file_names[6]) # laplaces_equation_with_internal_dirichlet_conditions
63+
safe_include(joinpath(dir, file_names[7]); name = file_names[7]) # mean_exit_time
64+
safe_include(joinpath(dir, file_names[8]); name = file_names[8]) # piecewise_linear_and_natural_neighbour_interpolation_for_an_advection_diffusion_equation
65+
safe_include(joinpath(dir, file_names[9]); name = file_names[9]) # porous_fisher_equation_and_travelling_waves
66+
safe_include(joinpath(dir, file_names[10]); name = file_names[10]) # porous_medium_equation
67+
safe_include(joinpath(dir, file_names[11]); name = file_names[11]) # reaction_diffusion_brusselator_system_of_pdes
68+
safe_include(joinpath(dir, file_names[12]); name = file_names[12]) # reaction_diffusion_equation_with_a_time_dependent_dirichlet_boundary_condition_on_a_disk
69+
safe_include(joinpath(dir, file_names[13]); name = file_names[13]) # solving_mazes_with_laplaces_equation
70+
safe_include(joinpath(dir, file_names[14]); name = file_names[14]) # gray_scott_model_turing_patterns_from_a_coupled_reaction_diffusion_system
71+
# safe_include(joinpath(dir, file_names[15]); name=file_names[15]) # keller_segel_chemotaxis
72+
end
73+
74+
@testset verbose = true "Custom Templates" begin
75+
dir = joinpath(dirname(@__DIR__), "docs", "src", "literate_wyos")
76+
files = readdir(dir)
77+
file_names = [
78+
"diffusion_equations.jl",
79+
"mean_exit_time.jl",
80+
"linear_reaction_diffusion_equations.jl",
81+
"poissons_equation.jl",
82+
"laplaces_equation.jl",
83+
]
84+
@test length(files) == length(file_names) # make sure we didn't miss any
85+
safe_include(joinpath(dir, file_names[1]); name = file_names[1]) # diffusion_equations
86+
safe_include(joinpath(dir, file_names[2]); name = file_names[2]) # mean_exit_time
87+
safe_include(joinpath(dir, file_names[3]); name = file_names[3]) # linear_reaction_diffusion_equations
88+
safe_include(joinpath(dir, file_names[4]); name = file_names[4]) # poissons_equation
89+
safe_include(joinpath(dir, file_names[5]); name = file_names[5]) # laplaces_equation
90+
end
91+
end

‎test/qa/Project.toml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[deps]
2+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
3+
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
4+
FiniteVolumeMethod = "d4f04ab7-4f65-4d72-8a28-7087bc7f46f4"
5+
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
6+
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
7+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
8+
9+
[sources]
10+
FiniteVolumeMethod = {path = "../.."}
11+
12+
[compat]
13+
Aqua = "0.7, 0.8"
14+
ExplicitImports = "1.15.0"
15+
SafeTestsets = "0.1, 1"
16+
SciMLTesting = "1"
17+
Test = "1"
18+
julia = "1.10"

‎test/qa/qa.jl‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using FiniteVolumeMethod
2+
using Test
3+
using Aqua
4+
using ExplicitImports
5+
6+
@testset verbose = true "Aqua" begin
7+
Aqua.test_all(FiniteVolumeMethod; ambiguities = false, project_extras = false) # don't care about julia < 1.2
8+
Aqua.test_ambiguities(FiniteVolumeMethod) # don't pick up Base and Core...
9+
end
10+
11+
@testset verbose = true "Explicit Imports" begin
12+
@test check_no_implicit_imports(FiniteVolumeMethod) === nothing
13+
@test check_no_stale_explicit_imports(FiniteVolumeMethod) === nothing
14+
end

‎test/runtests.jl‎

Lines changed: 6 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,7 @@
1-
using FiniteVolumeMethod
2-
using Test
3-
using Dates
4-
using Aqua
1+
using SciMLTesting
52

6-
ct() = Dates.format(now(), "HH:MM:SS")
7-
function safe_include(filename; name = filename) # Workaround for not being able to interpolate into SafeTestset test names
8-
mod = @eval module $(gensym()) end
9-
@info "[$(ct())] Testing $name"
10-
return @testset verbose = true "Example: $name" begin
11-
Base.include(mod, filename)
12-
end
13-
end
14-
15-
@testset verbose = true "FiniteVolumeMethod.jl" begin
16-
@testset verbose = true "Geometry" begin
17-
safe_include("geometry.jl")
18-
end
19-
@testset verbose = true "Conditions" begin
20-
safe_include("conditions.jl")
21-
end
22-
@testset verbose = true "Problem" begin
23-
safe_include("problem.jl")
24-
end
25-
@testset verbose = true "Equations" begin
26-
safe_include("equations.jl")
27-
end
28-
@testset verbose = true "README" begin
29-
safe_include("README.jl")
30-
end
31-
32-
@testset verbose = true "Tutorials" begin
33-
dir = joinpath(dirname(@__DIR__), "docs", "src", "literate_tutorials")
34-
files = readdir(dir)
35-
file_names = [
36-
"diffusion_equation_in_a_wedge_with_mixed_boundary_conditions.jl",
37-
"diffusion_equation_on_a_square_plate.jl",
38-
"diffusion_equation_on_an_annulus.jl",
39-
"equilibrium_temperature_distribution_with_mixed_boundary_conditions_and_using_ensembleproblems.jl",
40-
"helmholtz_equation_with_inhomogeneous_boundary_conditions.jl",
41-
"laplaces_equation_with_internal_dirichlet_conditions.jl",
42-
"mean_exit_time.jl",
43-
"piecewise_linear_and_natural_neighbour_interpolation_for_an_advection_diffusion_equation.jl",
44-
"porous_fisher_equation_and_travelling_waves.jl",
45-
"porous_medium_equation.jl",
46-
"reaction_diffusion_brusselator_system_of_pdes.jl",
47-
"reaction_diffusion_equation_with_a_time_dependent_dirichlet_boundary_condition_on_a_disk.jl",
48-
"solving_mazes_with_laplaces_equation.jl",
49-
"gray_scott_model_turing_patterns_from_a_coupled_reaction_diffusion_system.jl",
50-
] # do it manually just to make it easier for testing individual files rather than in a loop, e.g. one like
51-
#=
52-
for file in files
53-
@testset "Example: $file" begin
54-
safe_include(joinpath(dir, file))
55-
end
56-
end
57-
=#
58-
@test length(files) == length(file_names) # make sure we didn't miss any
59-
safe_include(joinpath(dir, file_names[1]); name = file_names[1]) # diffusion_equation_in_a_wedge_with_mixed_boundary_conditions
60-
safe_include(joinpath(dir, file_names[2]); name = file_names[2]) # diffusion_equation_on_a_square_plate
61-
safe_include(joinpath(dir, file_names[3]); name = file_names[3]) # diffusion_equation_on_an_annulus
62-
safe_include(joinpath(dir, file_names[4]); name = file_names[4]) # equilibrium_temperature_distribution_with_mixed_boundary_conditions_and_using_ensembleproblems
63-
safe_include(joinpath(dir, file_names[5]); name = file_names[5]) # helmholtz_equation_with_inhomogeneous_boundary_conditions
64-
safe_include(joinpath(dir, file_names[6]); name = file_names[6]) # laplaces_equation_with_internal_dirichlet_conditions
65-
safe_include(joinpath(dir, file_names[7]); name = file_names[7]) # mean_exit_time
66-
safe_include(joinpath(dir, file_names[8]); name = file_names[8]) # piecewise_linear_and_natural_neighbour_interpolation_for_an_advection_diffusion_equation
67-
safe_include(joinpath(dir, file_names[9]); name = file_names[9]) # porous_fisher_equation_and_travelling_waves
68-
safe_include(joinpath(dir, file_names[10]); name = file_names[10]) # porous_medium_equation
69-
safe_include(joinpath(dir, file_names[11]); name = file_names[11]) # reaction_diffusion_brusselator_system_of_pdes
70-
safe_include(joinpath(dir, file_names[12]); name = file_names[12]) # reaction_diffusion_equation_with_a_time_dependent_dirichlet_boundary_condition_on_a_disk
71-
safe_include(joinpath(dir, file_names[13]); name = file_names[13]) # solving_mazes_with_laplaces_equation
72-
safe_include(joinpath(dir, file_names[14]); name = file_names[14]) # gray_scott_model_turing_patterns_from_a_coupled_reaction_diffusion_system
73-
# safe_include(joinpath(dir, file_names[15]); name=file_names[15]) # keller_segel_chemotaxis
74-
end
75-
76-
@testset verbose = true "Custom Templates" begin
77-
dir = joinpath(dirname(@__DIR__), "docs", "src", "literate_wyos")
78-
files = readdir(dir)
79-
file_names = [
80-
"diffusion_equations.jl",
81-
"mean_exit_time.jl",
82-
"linear_reaction_diffusion_equations.jl",
83-
"poissons_equation.jl",
84-
"laplaces_equation.jl",
85-
]
86-
@test length(files) == length(file_names) # make sure we didn't miss any
87-
safe_include(joinpath(dir, file_names[1]); name = file_names[1]) # diffusion_equations
88-
safe_include(joinpath(dir, file_names[2]); name = file_names[2]) # mean_exit_time
89-
safe_include(joinpath(dir, file_names[3]); name = file_names[3]) # linear_reaction_diffusion_equations
90-
safe_include(joinpath(dir, file_names[4]); name = file_names[4]) # poissons_equation
91-
safe_include(joinpath(dir, file_names[5]); name = file_names[5]) # laplaces_equation
92-
end
93-
94-
@testset verbose = true "Aqua" begin
95-
Aqua.test_all(FiniteVolumeMethod; ambiguities = false, project_extras = false) # don't care about julia < 1.2
96-
Aqua.test_ambiguities(FiniteVolumeMethod) # don't pick up Base and Core...
97-
end
98-
99-
@testset verbose = true "Explicit Imports" begin
100-
safe_include("explicit_imports.jl")
101-
end
102-
end
3+
run_tests(;
4+
core = joinpath(@__DIR__, "core_tests.jl"),
5+
qa = (; env = joinpath(@__DIR__, "qa"), body = joinpath(@__DIR__, "qa", "qa.jl")),
6+
all = ["Core"],
7+
)

‎test/test_groups.toml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[Core]
2+
versions = ["lts", "1", "pre"]
3+
4+
[QA]
5+
versions = ["lts", "1"]

0 commit comments

Comments
 (0)