You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add docstring for `runtests`
* Mention that tests `ARGS` can be changed with `Pkg.test(; test_args)`
* `"$file.jl"` -> `file * ".jl"`
Co-authored-by: Valentin Churavy <[email protected]>
* Don't overstate the goodness of the load balancing
Co-authored-by: Valentin Churavy <[email protected]>
* Mention that partial matching is done with `startswith`
* Make syntax of `--jobs=N` option clearer in info message
---------
Co-authored-by: Valentin Churavy <[email protected]>
Run Julia tests in parallel across multiple worker processes.
207
+
208
+
## Arguments
209
+
210
+
- `ARGS`: Command line arguments array, typically from `Base.ARGS`. When you run the tests with `Pkg.test`, this can be changed with the `test_args` keyword argument
211
+
- `testfilter`: Optional function to filter which tests to run (default: run all tests)
212
+
- `RecordType`: Type of test record to use for tracking test results (default: `TestRecord`)
213
+
214
+
## Command Line Options
215
+
216
+
- `--help`: Show usage information and exit
217
+
- `--list`: List all available test files and exit
218
+
- `--verbose`: Print more detailed information during test execution
219
+
- `--quickfail`: Stop the entire test run as soon as any test fails
220
+
- `--jobs=N`: Use N worker processes (default: based on CPU threads and available memory)
221
+
- `TESTS...`: Filter tests by name, matched using `startswith`
222
+
223
+
## Behavior
224
+
225
+
- Automatically discovers all `.jl` files in the test directory (excluding `setup.jl` and `runtests.jl`)
226
+
- Sorts tests by file size (largest first) for load balancing
227
+
- Launches worker processes with appropriate Julia flags for testing
228
+
- Monitors memory usage and recycles workers that exceed memory limits
229
+
- Provides real-time progress output with timing and memory statistics
230
+
- Handles interruptions gracefully (Ctrl+C)
231
+
- Returns nothing, but throws `Test.FallbackTestSetException` if any tests fail
232
+
233
+
## Examples
234
+
235
+
```julia
236
+
# Run all tests with default settings
237
+
runtests(ARGS)
238
+
239
+
# Run only tests matching "integration"
240
+
runtests(["integration"])
241
+
242
+
# Run with custom filter function
243
+
runtests(ARGS, test -> occursin("unit", test))
244
+
245
+
# Use custom test record type
246
+
runtests(ARGS, Returns(true), MyCustomTestRecord)
247
+
```
248
+
249
+
## Memory Management
250
+
251
+
Workers are automatically recycled when they exceed memory limits to prevent
252
+
out-of-memory issues during long test runs. The memory limit is set based on
@info"Running $jobs tests in parallel. If this is too many, specify the `--jobs` argument to the tests, or set the `JULIA_CPU_THREADS` environment variable."
347
+
@info"Running $jobs tests in parallel. If this is too many, specify the `--jobs=N` argument to the tests, or set the `JULIA_CPU_THREADS` environment variable."
0 commit comments