Canonicalize test units with @safetestset#79
Closed
ChrisRackauckas-Claude wants to merge 1 commit into
Closed
Conversation
Convert the independent top-level test units to @safetestset so each runs in its own module (isolation + world-age safety), matching the canonical OrdinaryDiffEq structure. - Core group: "Core Tests" and "Analytical Solutions" inline bodies extracted verbatim into self-contained test/core_tests.jl and test/analytical_tests.jl (each carrying its own `using DiffEqFinancial, Statistics, StochasticDiffEq, Test`), then included from @safetestset units. "Interface Compatibility" (already a self-contained include) becomes @safetestset. - QA group: the three qa.jl units (Explicit Imports, JET, AllocCheck) become @safetestset; each included file already carries its own imports. The package macros (@test_opt, @check_allocs) resolve correctly because each unit is just `include(file)` and the file's `using` runs before the macro is parsed. - Add SafeTestsets to the main Project.toml [extras]/[targets].test + [compat] and to test/qa/Project.toml (QA runs in its own activated env). Behavior-preserving: identical tests, assertions, and GROUP dispatch. Nested grouping @testsets inside units left as plain @testset. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
superseded by the v1.2 folder conversion on sciml-testing-rollout |
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.
What
Canonicalizes the test suite so each independent top-level test unit runs in its own module via
@safetestset, matching the canonical OrdinaryDiffEq structure (isolation between tests + world-age safety).Changes
Core group (
runtests.jl):@testsetbodies — "Core Tests" and "Analytical Solutions" — were extracted verbatim into new self-contained filestest/core_tests.jlandtest/analytical_tests.jl, each carrying its ownusing DiffEqFinancial, Statistics, StochasticDiffEq, Test. The units now read@safetestset "X" begin include("x.jl") end.include("interface_tests.jl")) becomes@safetestset.@testset "DiffEqFinancial.jl"grouping wrapper is kept (@safetestsetnests fine inside@testset).QA group (
test/qa/qa.jl):@safetestset. Each included file (explicit_imports.jl,jet_tests.jl,alloc_tests.jl) already carries its ownusinglines. Using theinclude(file)body form is required here so the package macros@test_opt/@check_allocsare defined (via the file's top-levelusing) before they are parsed.Deps:
SafeTestsets(1bc83da4-3b8d-516f-aca4-4fe02f6d838f) to the mainProject.toml[extras]+[targets].test+[compat] SafeTestsets = "0.1, 1".test/qa/Project.toml(the QA group activates its own env).Behavior-preserving: identical tests, assertions, and
GROUPdispatch ladder. Nested grouping@testsets inside units are left as plain@testset(the unit-level@safetestsetalready isolates).Verification
Verified locally with
julia +1.11:GROUP=Core Pkg.test()— passes (3 isolated units: Core Tests; Interface Compatibility 17/17; Analytical Solutions 42/42).GROUP=QA Pkg.test()— passes (Explicit Imports, JET, AllocCheck all run as@safetestset).Note: the "Core Tests" unit contains a pre-existing flaky unseeded Monte Carlo assertion
testerr < 0.25on a 1M-trajectory GBM mean. Across repeated runstesterrwas observed ranging ~0.006–0.35, so it fails with small probability independent of this change (the body is byte-identical to the original and there is no RNG seeding anywhere in the suite). Not addressed here.Draft — please ignore until reviewed by @ChrisRackauckas.
🤖 Generated with Claude Code