Skip to content

Canonicalize tests to @safetestset for module isolation#1147

Closed
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:canonicalize-safetestset
Closed

Canonicalize tests to @safetestset for module isolation#1147
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:canonicalize-safetestset

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Summary

Canonicalizes test/runtests.jl so each independent test unit runs in its own module via @safetestset, matching the canonical OrdinaryDiffEq structure (isolation between tests + world-age safety).

Classification

PLAIN-TESTSET: the suite was a single outer @testset "DifferentialEquations" wrapping 8 independent inner plain @testset units, all sharing only the top-level using DifferentialEquations, Test, SafeTestsets.

What changed

  • Each inner @testset "X" begin ... end -> @safetestset "X" begin ... end.
  • Each @safetestset body is made self-contained with its own using DifferentialEquations, Test.
  • The outer @testset "DifferentialEquations" wrapper and the @time begin ... end block are kept, so the grouped test summary is preserved (@safetestset nests fine inside @testset).

What did NOT change

  • No test logic or assertions changed. The same 17 assertions run.
  • These bodies use no package macros and only resolve package symbols (ODEProblem, Tsit5, solve, ...) at runtime, so an inline @safetestset body with using DifferentialEquations, Test is sufficient (no include() indirection needed).
  • SafeTestsets was already in [extras] + [targets].test, so Project.toml is unchanged.

Verification

Ran locally with julia +1.11 Pkg.test():

Test Summary:         | Pass  Total   Time
DifferentialEquations |   17     17  22.3s
     Testing DifferentialEquations tests passed

Ignore until reviewed by @ChrisRackauckas.

🤖 Generated with Claude Code

Convert the independent inner @testset units in test/runtests.jl to
@safetestset so each test unit runs in its own module, matching the
canonical OrdinaryDiffEq structure (isolation + world-age safety).

Each @safetestset body is made self-contained with its own
`using DifferentialEquations, Test`. The outer `@testset
"DifferentialEquations"` wrapper and the `@time` block are kept so the
grouped summary is preserved. No test logic or assertions changed; the
same 17 assertions run.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor Author

Superseded by the SciMLTesting v1.2 PR #1145 (grouped-tests + run_tests + @safetestset). Closing this canonicalize-only PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants