Skip to content

Canonicalize test units with @safetestset - #164

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

Canonicalize test units with @safetestset#164
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:canonicalize-safetestset

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

What

Wraps each independent Core test unit in test/runtests.jl in @safetestset "name" begin include("x.jl") end so every unit runs in its own fresh module — isolation between tests and world-age safety, matching the canonical OrdinaryDiffEq structure.

Before each unit was include("x.jl"), which ran every file into the shared Main module (so files silently shared/leaked imports and global names). Each included file already carries its own using/import lines at the top, so the bodies are already self-contained; this PR just wraps the include() calls.

Behavior preserved

  • Same 16 Core files run, in the same order, under the same GROUP.
  • GROUP dispatch ladder and the QA group (qa.jl, a flat Aqua.test_* sequence in its own activated env) are unchanged.
  • No assertions changed.
  • Adds SafeTestsets to the test deps ([extras] / [targets].test + [compat] SafeTestsets = "0.1, 1").

Verification

Verified locally with Julia 1.11: GROUP=Core julia --project Pkg.test() — all 16 @safetestset units pass (Types 3427, Polynomial Chaos 4950, Scalar Products 810, Evaluate 164, etc.). No package-macro gotchas: the StaticArrays usages are the SVector(...) constructor (a function call), not the @SVector macro, so they expand correctly inside the safetestset modules.


Ignore until reviewed by @ChrisRackauckas.

🤖 Generated with Claude Code

Wrap each independent test unit in test/runtests.jl in `@safetestset
"name" begin include("x.jl") end` so every unit runs in its own fresh
module (isolation between tests + world-age safety), matching the
canonical OrdinaryDiffEq structure. Each included file already carries
its own `using`/`import` lines, so the bodies are self-contained.

The GROUP dispatch ladder, QA group, and all assertions are unchanged;
only the Core include() calls are wrapped.

Adds SafeTestsets to the test deps ([extras]/[targets].test + compat).

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
Member Author

Superseded by the v1.2 folder conversion on sciml-testing-rollout (#163).

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