Skip to content

Conversation

@IanButterworth
Copy link
Member

@IanButterworth IanButterworth commented Oct 25, 2025

Formalizes a way to select test files at the Pkg.test level.

i.e. runtests.jl

using Test

include("utils.jl") # common utils

@include_files [
    "foo.jl",
    "bar.jl",
    "baz.jl",
]

Then to run tests use --files (which matches files using occursin)

Pkg.test(test_args=["--files=foo"])

or using --files-regex for regex matching

Pkg.test(test_args=["--files-regex=foo|bar"])

More examples in the docstring.

Backwards compat provided via Compat.jl JuliaLang/Compat.jl#846


This is largely inspired by Claude constantly expecting this to work:

Pkg.test(test_args=["file_name"]) 

However I required the --files or --files-regex arg name because otherwise what Claude wanted would restrict any other usage of test_args/ARGS

@IanButterworth IanButterworth added the testsystem The unit testing framework and Test stdlib label Oct 25, 2025
@vchuravy
Copy link
Member

I am personally not a big fan of having to enumerate test files and prefer ParallelTestRunner.jl style of auto discovery and filtering.

Also is there a strong reason why this must be in Test.jl? I do think that separating the declaration of tests from the running and execution of tests is a good thing.

@IanButterworth
Copy link
Member Author

It's true that it could be in Base, that didn't occur to me.

What's stopping putting ParallelTestRunner into Base/Test?

@vchuravy
Copy link
Member

ParallelTestRunner into Base/Test?

Mostly because we are rapidly iterating on functionality, and until Test is upgradeable, I don't feel like waiting for new features.

Also ParallelTestRunner uses Malt.jl (but could use Distributed again, or hand role it's own worker management)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testsystem The unit testing framework and Test stdlib

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants