Conversation
Splits `runtest` into the PTR-owned boilerplate (temp module creation,
imports, TESTSET_PRINT_ENABLE handling) and a dispatchable `execute` function
that performs the actual test invocation and returns the record. Users can
subtype `AbstractTestRecord` and dispatch `execute(::Type{MyRecord}, ...)` to
collect custom per-test metrics — without re-implementing the scaffolding.
`runtests` gains two kwargs: `RecordType = TestRecord` selecting the concrete
record type, and `custom_args = (;)` threaded through to `execute` for
per-run configuration.
Print methods (`print_header`, `print_test_started`, `print_test_finished`,
`print_test_failed`, `print_test_crashed`, `test_IOContext`) now dispatch on
`AbstractTestRecord` so custom record types can override output. The
`record.rss` access in `print_test_finished` now goes through the generic
`memory_usage`.
`addworker` eagerly imports ParallelTestRunner on the worker before running
`init_worker_code`, since user-supplied initialization commonly references
`AbstractTestRecord`, `WorkerTestSet`, etc.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds `exename`, `exeflags`, and `env` kwargs to `runtests`, threaded into the internal `addworker` call so every default-pool worker (and any respawns inside `runtests`) inherits them. `exename` accepts both `String` and `Cmd`, enabling callers to wrap the julia invocation with a tool such as `compute-sanitizer`. Custom workers created from a `test_worker` hook are still the caller's responsibility. Also fixes `addworker` to copy its `env` argument before appending `JULIA_NUM_THREADS` / `OPENBLAS_NUM_THREADS`, so a caller-supplied vector is not mutated across calls. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds custom record types (`RecordType` + `custom_args` + dispatchable `execute`, print methods generalized to `AbstractTestRecord`) and global worker configuration on `runtests` (`exename`/`exeflags`/`env` threaded into every internal `addworker` call). Both features are additive. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closed
Instead of requiring `AbstractTestRecord` subtypes to redeclare every baseline field, treat `TestRecord` as the canonical baseline and have wrappers carry a `base::TestRecord` field. `Base.parent` is the accessor; default `print_*` and `memory_usage` route through it so wrapped records inherit the standard output unchanged. `execute` implementations delegate to `execute(TestRecord, …)` and wrap the result. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`result.value` in the end-of-run output dump bypassed the accessor introduced in the composition refactor, crashing on non-`TestRecord` subtypes. Route through `result[]` to match the convention already used elsewhere. Co-Authored-By: Claude Opus 4.7 (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.
exename,exeflags, andenvkwargs for running undercompute-sanitizer