Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"]
11 changes: 11 additions & 0 deletions test/qa/Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# 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

@testset "Explicit Imports" begin
# 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
Expand Down
24 changes: 18 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,27 @@ 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__)))
Pkg.instantiate()
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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -89,3 +100,4 @@ end
end

end # @time
end
20 changes: 20 additions & 0 deletions test/test_groups.toml
Original file line number Diff line number Diff line change
@@ -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"]
Comment on lines +1 to +17

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sis good now.


[QA]
versions = ["lts", "1"]
Loading