diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 8d001fbfda..efbb365310 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -18,23 +18,7 @@ concurrency: jobs: tests: - name: "Tests" - strategy: - fail-fast: false - matrix: - version: - - "1" - - "lts" - - "pre" - group: - - Modeling - - Simulation - - Hybrid - - Misc - - Spatial - uses: "SciML/.github/.github/workflows/tests.yml@v1" + uses: "SciML/.github/.github/workflows/grouped-tests.yml@v1" with: - julia-version: "${{ matrix.version }}" - group: "${{ matrix.group }}" coverage: false secrets: "inherit" diff --git a/Project.toml b/Project.toml index ede0c1f3ae..249aedc5c5 100644 --- a/Project.toml +++ b/Project.toml @@ -54,7 +54,6 @@ DocStringExtensions = "0.8, 0.9" DynamicPolynomials = "0.6" DynamicQuantities = "1" EnumX = "1" -ExplicitImports = "1.15" GraphMakie = "0.5, 0.6" Graphs = "1.4" HomotopyContinuation = "2.9" @@ -89,7 +88,6 @@ DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0" DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def" DiffEqNoiseProcess = "77a26b50-5914-5dd7-bc55-306e6241c503" DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf" -ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec" @@ -112,7 +110,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] test = ["DataInterpolations", "DiffEqCallbacks", "DiffEqNoiseProcess", "DomainSets", - "ExplicitImports", "Logging", "NonlinearSolve", "OrdinaryDiffEqBDF", "OrdinaryDiffEqCore", "OrdinaryDiffEqDefault", + "Logging", "NonlinearSolve", "OrdinaryDiffEqBDF", "OrdinaryDiffEqCore", "OrdinaryDiffEqDefault", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqTsit5", "OrdinaryDiffEqVerner", "Pkg", "Plots", "Random", "SafeTestsets", "StableRNGs", "StaticArrays", "Statistics", "SteadyStateDiffEq", "StochasticDiffEq", "Test"] diff --git a/test/qa/Project.toml b/test/qa/Project.toml new file mode 100644 index 0000000000..70d8b02abb --- /dev/null +++ b/test/qa/Project.toml @@ -0,0 +1,11 @@ +[deps] +Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83" +ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +Catalyst = { path = "../.." } + +[compat] +ExplicitImports = "1.15" +julia = "1.10" diff --git a/test/miscellaneous_tests/explicit_imports.jl b/test/qa/qa.jl similarity index 65% rename from test/miscellaneous_tests/explicit_imports.jl rename to test/qa/qa.jl index b630a9dbba..623f118fe2 100644 --- a/test/miscellaneous_tests/explicit_imports.jl +++ b/test/qa/qa.jl @@ -1,4 +1,5 @@ -# Tests for import hygiene using ExplicitImports.jl +# Quality-assurance checks (import hygiene via ExplicitImports.jl). +# Run in an isolated environment (test/qa/Project.toml) under GROUP == "QA". # Ensures Catalyst imports symbols from their owner modules and has no stale imports. using Catalyst, ExplicitImports, Test @@ -6,11 +7,11 @@ using Catalyst, ExplicitImports, Test # Test that there are no implicit imports # allow_unanalyzable is needed because PhysicalScale enum causes parsing issues @test check_no_implicit_imports(Catalyst; - allow_unanalyzable=(Catalyst, Catalyst.PhysicalScale)) === nothing + allow_unanalyzable = (Catalyst, Catalyst.PhysicalScale)) === nothing # Test that there are no stale explicit imports @test check_no_stale_explicit_imports(Catalyst; - allow_unanalyzable=(Catalyst, Catalyst.PhysicalScale)) === nothing + allow_unanalyzable = (Catalyst, Catalyst.PhysicalScale)) === nothing # Test that all explicit imports are from owner modules @test check_all_explicit_imports_via_owners(Catalyst) === nothing diff --git a/test/runtests.jl b/test/runtests.jl index 6a02c8a964..329f279be1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -6,6 +6,10 @@ using SafeTestsets, Test, Pkg # Required for running parallel test groups (copied from ModelingToolkit). const GROUP = get(ENV, "GROUP", "All") +# `Core` runs the full functional suite; the fine-grained names remain usable for +# local runs. `All` (the default) additionally runs the extension tests. +const RUN_ALL = GROUP == "All" || GROUP == "Core" + function activate_extensions_env() Pkg.activate("extensions") Pkg.develop(PackageSpec(path = dirname(@__DIR__))) @@ -13,8 +17,16 @@ function activate_extensions_env() end ### Run Tests ### + +# QA checks (import hygiene) run in an isolated environment. +if GROUP == "QA" + Pkg.activate(joinpath(@__DIR__, "qa")) + Pkg.develop(PackageSpec(path = dirname(@__DIR__))) + Pkg.instantiate() + include("qa/qa.jl") +else @time begin - if GROUP == "All" || GROUP == "Modeling" + if RUN_ALL || GROUP == "Modeling" # Tests the `ReactionSystem` structure and its properties. @time @safetestset "Reaction Structure" begin include("reactionsystem_core/reaction.jl") end @time @safetestset "ReactionSystem Structure" begin include("reactionsystem_core/reactionsystem.jl") end @@ -47,7 +59,7 @@ end @time @safetestset "CRN Theory" begin include("network_analysis/crn_theory.jl") end end - if GROUP == "All" || GROUP == "Simulation" + if RUN_ALL || GROUP == "Simulation" # Tests ODE, SDE, jump simulations, nonlinear solving, and steady state simulations. @time @safetestset "ODE System Simulations" begin include("simulation_and_solving/simulate_ODEs.jl") end @time @safetestset "Automatic Jacobian Construction" begin include("simulation_and_solving/jacobian_construction.jl") end @@ -60,18 +72,17 @@ end @time @safetestset "MTK Problem Inputs" begin include("upstream/mtk_problem_inputs.jl") end # Required to fix lots of these: https://github.com/SciML/ModelingToolkit.jl/issues/4098 end - if GROUP == "All" || GROUP == "Hybrid" + if RUN_ALL || GROUP == "Hybrid" @time @safetestset "ReactionSystem Hybrid Solvers" begin include("simulation_and_solving/hybrid_models.jl") end end - if GROUP == "All" || GROUP == "Misc" + if RUN_ALL || GROUP == "Misc" @time @safetestset "ReactionSystem Serialisation" begin include("miscellaneous_tests/reactionsystem_serialisation.jl") end - @time @safetestset "Explicit Imports" begin include("miscellaneous_tests/explicit_imports.jl") end # BROKEN #@time @safetestset "Latexify" begin include("visualisation/latexify.jl") end # https://github.com/SciML/Catalyst.jl/issues/1352 end - if GROUP == "All" || GROUP == "Spatial" + if RUN_ALL || GROUP == "Spatial" # Tests spatial modelling and simulations. @time @safetestset "PDE Systems Simulations" begin include("spatial_modelling/simulate_PDEs.jl") end @time @safetestset "Spatial Reactions" begin include("spatial_modelling/spatial_reactions.jl") end @@ -89,3 +100,4 @@ end end end # @time +end diff --git a/test/test_groups.toml b/test/test_groups.toml new file mode 100644 index 0000000000..3c32b3d906 --- /dev/null +++ b/test/test_groups.toml @@ -0,0 +1,20 @@ +[Modeling] +versions = ["lts", "1", "pre"] + +[Simulation] +versions = ["lts", "1", "pre"] + +[Hybrid] +versions = ["lts", "1", "pre"] + +[Misc] +versions = ["lts", "1", "pre"] + +[Spatial] +versions = ["lts", "1", "pre"] + +[Extensions] +versions = ["lts", "1", "pre"] + +[QA] +versions = ["lts", "1"]