Canonicalize test units to @safetestset#106
Draft
ChrisRackauckas-Claude wants to merge 1 commit into
Draft
Conversation
Wrap each independent top-level test unit in `@safetestset` so it runs in its own module, matching OrdinaryDiffEq's canonical structure (isolation between units + world-age safety). - test/runtests.jl: the 8 Core units `@testset "X" begin include(...) end` become `@safetestset "X" begin include(...) end`. Each included file is already self-contained with its own `using`/`import` lines, and the include() form runs statements sequentially so imports take effect before any package macros are reached. - test/qa/qa.jl: the Aqua and JET units become `@safetestset`, each carrying its own `using ODEInterfaceDiffEq, <Tool>, Test`. `@test_broken` lines preserved verbatim. - Added SafeTestsets to the test deps: main Project.toml [extras] + [targets].test + [compat] SafeTestsets = "0.1, 1", and test/qa/Project.toml (the QA group activates its own env). Behavior-preserving: same units run under the same GROUP dispatch, same assertions. GROUP=Core verified locally (Pkg.test passed: Explicit Imports 2, Saving 3, Mass Matrix 4, Jacobian 1, Callbacks 2, Initialization 13, MTK Initialization 55; Algorithms exercises solve calls with no @test). Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wraps each independent top-level test unit in
@safetestsetso it runs in its own module, matching OrdinaryDiffEq's canonical structure (isolation between units + world-age safety). Behavior-preserving: the same units run under the sameGROUPdispatch with the same assertions — only the unit wrapper changes.Changes
test/runtests.jl: the 8 Core units@testset "X" begin include("x.jl") endbecome@safetestset "X" begin include("x.jl") end. Each included file (algorithm_tests.jl,saving_tests.jl,mass_matrix_tests.jl,jac_tests.jl,callbacks.jl,initialization_tests.jl,mtk_initialization_tests.jl,explicit_imports.jl) is already self-contained with its ownusing/importlines, and theinclude()form runs statements sequentially so imports (and package macros like ModelingToolkit's@variables/@mtkcompile) resolve correctly inside the fresh module.test/qa/qa.jl: theAquaandJETunits become@safetestset, each carrying its ownusing ODEInterfaceDiffEq, <Tool>, Test. The existing@test_brokenlines (tracked in QA: Aqua/JET findings marked @test_broken pending fix #105) are preserved verbatim. The outer@testset "Quality Assurance"grouping wrapper inruntests.jlis left as-is.SafeTestsetsto the mainProject.toml[extras]+[targets].test+[compat] SafeTestsets = "0.1, 1", and totest/qa/Project.toml(the QA group activates its own env).The
GROUP-dispatch ladder, run path, and all assertions are unchanged. Nested grouping@testsets inside a unit (e.g. the per-iip/per-algtestsets in the initialization files) stay plain@testset— the unit-level@safetestsetalready isolates them.Verification
GROUP=Corerun locally viaPkg.test(Julia 1.11) — passed:Ignore until reviewed by @ChrisRackauckas.