I'm using Mill and I can't figure out how to run the tests or even compile all Modules at once.
There is clear
, but running mill resolve _
does not seem to have a command for it.
For now I run the tests for each Module separately.
Is there a way to achieve this?
Edit: The Answer targets an outdated Mill version. See below for an updated version.
I assume you're talking about
ScalaModule
s and your tests are located intest
sub-modules.Run all tests of your project with:
The
__
is a wildcard and matches in this case any parent module(s) (like the**
in Ant patterns). The.test.test
matches atest
target in a module namedtest
.To compile all modules, run:
And to run all compile targets and run tests in one go, run:
Notice, that we need to use the
all
target here, which accepts multiple targets as arguments. That's needed because mill only accepts a single target or target-pattern and treats any additional command line argument as a parameter for that target.Edit:
Newer versions of Mill no longer have the
all
command. Instead, you can give multiple targets separated with+
.Also, to run all
test
targets, it's enough to runmill __.test
. In very older Mill versions, this results in tests running twice, but this is fixed for a long time and the workaround to use__.test.test
is no longer needed.