Java edition
Errors
When mutastic can’t do what you asked, it says what went wrong and ends with the command to run next. A script, a CI step or a coding agent needs more than the words: which kind of failure it was, so it can act on that kind. This page lists every kind by its code, with what mutastic says on a sample, why, and what to do. Search it for the words of an error you’ve met.
The codes never appear in what a person reads. They’re in the exit status’s family, below, and in
the run-failed event.
Exit statuses
Section titled “Exit statuses”| Status | Means | Codes |
|---|---|---|
| 0 | The run passed | |
| 1 | The score is below the threshold, or a mutant is still missed | |
| 2 | A mistake in the command, a file or the environment, or a build mutastic couldn’t read | all but those below |
| 3 | The tests fail without any mutant | red-baseline, tests-stopped, tests-timed-out |
| 4 | mutastic itself went wrong: open an issue | internal |
The Rust edition exits with 2 for every error, its red baseline included, and has no 3 or 4. The
editions will share these statuses from 2.0, which can change them; until then, a script that
wraps both should treat any status above 1 as “didn’t run”, and read the event’s code for which.
The run-failed event
Section titled “The run-failed event”With --format=agent or --format=jsonl (or MUTASTIC_AGENT=1), the error is also the last line
on stdout, a run-failed event in mutastic.events/v1, the same in both
editions. Whatever came before it on stdout, a run that fails part way has no run-finished. Here
it is for mutastic run samples/pricing --formt=jsonl:
{ "schema" : "mutastic.events/v1", "edition" : "java", "reason" : "run-failed", "code" : "unknown-option", "message" : "run has no option --formt. There's one called --format.", "where" : { "directory" : "samples/pricing", "path" : "/home/you/mutastic/samples/pricing" }, "help" : [ { "applicability" : "maybe", "command" : "mutastic run samples/pricing --format=jsonl" } ], "exitCode" : 2, "rendered" : "mutastic: run has no option --formt. There's one called --format.\n mutastic run samples/pricing --format=jsonl\n"}codeis the heading of its entry below; a code you don’t know is to be treated asother.messageis the error’s first line;renderedis all of it, as stderr has it.whereis the directory the command was run on, as typed, and its whole path (nullwhen there is no such directory).helpholds the commands the error ends in.exactruns as it is;placeholdershas a part in<…>to fill in;maybeis a close name, a guess at what you meant, to check before running it. mutastic never runs a guess itself.exitCodeis the status it exits with.
A --hook run answers as its agent’s hooks do, and writes no event.
The same error in the Rust edition
Section titled “The same error in the Rust edition”Most codes are the same in both editions. Where an error is about the build tool, each edition names it for its own, and a few kinds have a code in one edition only. A script that reads both should treat each pair below as one kind:
| Java edition | Rust edition | The error |
|---|---|---|
no-build-tool | no-cargo | No build tool to run the build with |
module-without-java, at a build’s root | workspace-root | The root of a build of modules (a workspace), which mutastic doesn’t test as one; it names the modules (packages) to test |
module-missing | no-directory, for a workspace member | The module (package) named isn’t in the build |
build-failed | build-failed, copy-build-failed | The project doesn’t build; the Rust edition says too when only its copy with the mutants in fails |
These are only the Java edition’s: unknown-suite and build-jdk. These are only the Rust
edition’s: both-editions, java-edition, swift-edition and proc-macro. A code an edition
doesn’t have comes out there as other, or as the nearest it has. Both editions keep these names
for 1.x. A new edition uses the general name of each pair: no-build-tool, and build-root for the
root of a build of modules.
Mistakes in the command line
Section titled “Mistakes in the command line”These exit with 2. A close name is offered, never run, in your command with only that word changed.
With none close, the error ends in the command to run next: the one that lists what there is, such
as mutastic run --help, or yours with a <…> to fill in.
unknown-command
Section titled “unknown-command”The first word isn’t a command, or gate has no action after it.
mutastic: mutastic has no command verfiy. There's one called verify. mutastic verify m855c8e3c samples/pricingunknown-option
Section titled “unknown-option”An option the command doesn’t have. A single dash is never an option: they’re all long ones.
mutastic: run has no option --formt. There's one called --format. mutastic run samples/pricing --format=agentoption-not-taken
Section titled “option-not-taken”An option mutastic has, given to a command that doesn’t take it, such as --threshold to
verify: the command would otherwise run as if it weren’t there. A build plugin’s mutastic.
properties are the exception, as a plugin passes its settings to each of its goals.
option-value
Section titled “option-value”An option’s value mutastic can’t use: one of a list it isn’t, a number out of range, a missing
value. The message says what the option takes. The corrected command writes the value after an =,
as help does; a space works too, but for --since.
mutastic: --format has no value agnt. There's one called agent. mutastic run samples/pricing --format=agentneeds-id
Section titled “needs-id”verify, explain and ignore take a mutant’s id first, as a run prints it, and ignore a
reason. The message says what was in the id’s place: a directory, a module, or something else. It
ends in your command with the <id>, or the <why>, to fill in.
extra-words
Section titled “extra-words”A word the command doesn’t take, such as a second directory, or another command’s words after a run’s.
no-baseline
Section titled “no-baseline”--fail-on-new with no .mutastic/baseline.yaml to tell new misses from. mutastic baseline
writes one, to commit.
shards
Section titled “shards”--from-shards named a directory without every share’s results, shares of different runs, or one
that didn’t finish; or it was given with an option a share decides.
unknown-id
Section titled “unknown-id”No mutant of the project has that id. An id belongs to the project its run was on, so run the command as that run printed it. With none close, the error ends in the command that lists the project’s mutants. One a slip away from an id of the project is named:
mutastic: m855c83ec isn't a mutant of pricing. There's one called m855c8e3c. mutastic verify m855c8e3c samples/pricingno-mutant-at
Section titled “no-mutant-at”--at asked for lines with no mutant on them, under the operators the run chooses and, with
--since, on the change. A run of none would pass and say nothing, so it’s refused: the message
names the nearest lines that have one, and ends in the mutants --at command that lists them. The
lines are read from the file as it is on disk, so save an editor’s changes first.
mutastic: no mutant on Pricing.java:16; there are on 17, 18, 20, 25 and 26. To see them: mutastic mutants --at=src/main/java/com/example/pricing/Pricing.java:17-26 samples/pricingoutside-sources
Section titled “outside-sources”--at named a file that isn’t one of the module’s sources, a test say: only the code mutastic
mutates has mutants. The message names the module’s source directories. In a build of several
modules, the file picks its module when none is named; one named stays, so a file of another module
is outside its sources.
Mistakes in a file or the environment
Section titled “Mistakes in a file or the environment”These exit with 2. The command line wasn’t the problem: the message names what was.
config
Section titled “config”mutastic.yaml, a rules file it names, or .mutastic/ignores.yaml says something mutastic can’t
use. The message names the file and line, and what’s valid there.
mutastic: mutastic.yaml line 3: strem isn't an operator mutastic has. There's one called stream.It takes a set (defaults, stronger, extended or all), a namespace (library, mutastic, optional, predicate or stream) or an operator's id. To see each id: mutastic mutants --operators=allenvironment
Section titled “environment”MUTASTIC_FORMAT, MUTASTIC_VOCABULARY, MUTASTIC_PILLS, MUTASTIC_PROGRESS or
MUTASTIC_HEARTBEAT has a value mutastic doesn’t take. See Environment.
--since and the gate ask git what changed, so they need git installed and a repository with a
commit, and the commit named must be one git knows. A plain mutastic run needs no git. The
message says which is missing: git itself, with where to install it; a repository, with the
commands that make the directory one, its files the first commit; or a first commit. It ends in
the command to run without git: yours without --since, or mutastic run in place of the gate.
mutastic: --since asks git what changed, and samples/pricing isn't in a git repository. To make it one, with its files as the first commit: cd samples/pricing && git init && git add -A && git commit -m startOr to test all the code without --since: mutastic run samples/pricingThe project
Section titled “The project”These exit with 2: mutastic couldn’t read the build, so it ran nothing.
no-directory
Section titled “no-directory”The directory named isn’t there. mutastic says where it looked, and ends in the command to test what is there: a directory beside it with a close name, else the project it would be in.
mutastic: there's no directory samples/pricing/nosuch in /home/you/mutastic.The package there is pricing, in samples/pricing. To test it: mutastic run samples/pricingno-project
Section titled “no-project”The directory isn’t a Gradle or Maven build: it has no settings.gradle(.kts), build.gradle(.kts)
or pom.xml, nor does any directory above it. The message says where it looked, and ends in your
command with the project’s directory to fill in. In a directory below a build’s own, such as its
src, mutastic runs the build, or the Maven module, the directory is in; in a build of modules but
in none of them, it’s the build’s root, below.
module-missing
Section titled “module-missing”The build has no module of that name. The message lists the modules with Java code, as commands, or names the close one:
mutastic: the build has no module :nope.Its modules with Java code are :app and :core. To test one: mutastic run samples/maven-modules :app mutastic run samples/maven-modules :coremodule-without-java
Section titled “module-without-java”The module named, or the build’s root, has no Java code. mutastic tests one module at a time, and names those that have some:
mutastic: samples/maven-modules is a build's root, with no Java code of its own.Its modules with Java code are :app and :core. To test one: mutastic run samples/maven-modules :app mutastic run samples/maven-modules :coreno-build-tool
Section titled “no-build-tool”The build has no wrapper (gradlew, mvnw), and there’s no gradle or mvn on the PATH.
unknown-suite
Section titled “unknown-suite”--suite named a test suite the build hasn’t got. The message lists the ones it has.
build-failed
Section titled “build-failed”The project doesn’t build, before any mutant is in it. mutastic quotes the compiler’s first errors
at your files’ lines, or what the build tool says went wrong, and ends in the command that builds
it as mutastic did. Fix the build first. A build with no wrapper ran with the Gradle or Maven on
the PATH. When the failure isn’t a compiler error, the message says which ran: a build made for
another version fails this way.
mutastic: pricing doesn't build, before any mutant is in it.The error is in samples/pricing/src/main/java/com/example/pricing/Pricing.java, line 18: ';' expected.Gradle's output is in samples/pricing/build/mutastic/gradle.log. To see it in full: samples/pricing/gradlew -p samples/pricing testClassesbuild-jdk
Section titled “build-jdk”The build needs a JDK it hasn’t got: one its toolchain asks for that Gradle or Maven finds none of, one newer than its Gradle runs on, one too old for mutastic’s test workers, or one whose javac still compiles the Java the build is written for.
A toolchain’s JDK that isn’t there stops the build before it compiles. Gradle says Cannot find a Java installation on your machine matching, whether it may download one or not; Maven’s toolchains
plugin says Cannot find matching toolchain definitions. mutastic names the JDK as the build asked
for it, its version and any vendor, and offers the run again with the argument that tells the build
tool where one is, after --: fill in the <…>. For every run, add the argument to build: args: in
mutastic.yaml, or to MUTASTIC_BUILD_ARGS. See Troubleshooting.
mutastic: the build needs JDK 99 for its toolchain, and Gradle found none.Install one, or tell Gradle where it is: mutastic run samples/toolchain-missing -- -Dorg.gradle.java.installations.paths=<path/to/jdk-99>For every run, add it to build: args: in mutastic.yaml, or to MUTASTIC_BUILD_ARGS. Gradle's output is in samples/toolchain-missing/build/mutastic/gradle.log.For Maven, the JDK goes in ~/.m2/toolchains.xml, or in a toolchains file you name:
mutastic: the build needs JDK 21 (temurin) for its toolchain, and Maven found none in ~/.m2/toolchains.xml.Add it to ~/.m2/toolchains.xml, or tell Maven which toolchains file has it: mutastic run :core -- --toolchains <path/to/toolchains.xml>For every run, add it to build: args: in mutastic.yaml, or to MUTASTIC_BUILD_ARGS. Maven's output is in core/target/mutastic/maven.log.The build runs on a JDK newer than its Gradle can run on, so it stopped before it read the build:
Gradle 8.10 runs on JDK 23 at most. mutastic names the build’s JDK, its Gradle and the newest JDK
that Gradle runs on, and the two ways out: set JAVA_HOME to that JDK or an older one, as mutastic
finds a JDK 25 for itself; or upgrade the wrapper to a Gradle that runs on the build’s JDK, with the
command that does it. A Gradle on the PATH, for a build with no wrapper, is checked the same way,
and the way out is a wrapper. See Troubleshooting.
The tests’ JDK is build-jdk too: tests that run on a JDK older than 17, such as a JDK 8 or 11
toolchain, can’t run in mutastic’s test workers, which run on 17 or later. mutastic names the JDK,
before any test runs. Give the tests a JDK 17 or later for mutastic’s run: the test task’s
toolchain in Gradle, or Surefire’s jvm in Maven.
A build written for a Java its JDK’s javac no longer compiles is build-jdk too: javac says
Source option 5 is no longer supported. Use 8 or later. mutastic says it’s the JDK, not the build
tool, even for a build run with the Maven or Gradle on the PATH, and to raise the build’s source
and target, or its release, to the version javac names.
mutastic: shop's build runs on JDK 25, and its Gradle, 8.10.2, runs on JDK 23 at most.Set JAVA_HOME to a JDK 23 or older, and mutastic still finds its own JDK 25. Or upgrade the wrapper to Gradle 9.1.0 or later. Gradle's output is in build/mutastic/gradle.log. To upgrade, with JAVA_HOME at the older JDK: ./gradlew wrapper --gradle-version 9.1.0The tests
Section titled “The tests”red-baseline
Section titled “red-baseline”A test fails with no mutant in, so no mutant can be judged by it. The message says what the test
said, the build’s command that runs it alone, and how to leave it out until it’s fixed: under
exclude-tests: in mutastic.yaml with a reason, or
for one run with --exclude-tests. Nothing is left out on its own. In the agent format, the
message says instead to find out whether the change or the test is wrong, and leave leaving it out
to the person. Exits with 3.
mutastic: com.example.pricing.PricingTest#bigOrdersGetTenPercentOff fails without any mutant, so mutastic can't judge one.It failed: expected: <24> but was: <25>To run without it until it's fixed, list it under exclude-tests: in mutastic.yaml with a reason, or for this run add --exclude-tests=PricingTest#bigOrdersGetTenPercentOffIts output is in samples/pricing/build/mutastic/worker.log. To run it alone: samples/pricing/gradlew -p samples/pricing test --tests 'com.example.pricing.PricingTest.bigOrdersGetTenPercentOff'tests-stopped
Section titled “tests-stopped”A test ended the tests’ JVM in the coverage pass, with System.exit or a crash. The message names
the test that was running. Exits with 3.
mutastic: the tests' JVM stopped during the coverage pass, with no mutant in, while com.example.pricing.HaltsTest#halts ran.A test that calls System.exit, or crashes the JVM, stops it. The end of its output says which: tail -n 40 samples/pricing/build/mutastic/worker.logtests-timed-out
Section titled “tests-timed-out”The coverage pass ran past its 10 minutes: a test waits for something that never comes, or never stops. The message names the test that was running. Exits with 3.
no-tests
Section titled “no-tests”The module has tests, but none ran on the JUnit Platform: JUnit 4 tests with no engine to run
them, a runner mutastic doesn’t run, every test disabled, or filters that leave out every test.
When it’s --exclude-tests or exclude-tests: that left out every test, mutastic says that, with
the names that did it.
Scored, that would be a 0% that blames the tests, when it’s mutastic that didn’t run them. A
module with no tests at all isn’t an error: its mutants are not covered. The same goes for test
classes that hold no test, such as a module’s test fixtures alone.
Tests the platform can’t start at all are no-tests too, with the exception that stopped them as
the headline and what to change after it: TestNG older than 6.14.3, the oldest TestNG’s engine
runs, or JUnit 3 alone, which runs on the platform only with JUnit 4’s runner. Exits with 2.
nothing-covered
Section titled “nothing-covered”The tests ran and passed, but reached none of the code with mutants: another agent in the tests’ JVM, a framework’s class loader, or filters that leave only tests that never call it. See Troubleshooting. Exits with 2.
mutastic: 1 test ran and passed in pricing, but the coverage pass recorded no line of the 1 class with mutants, so a score would measure nothing: every mutant would read as reached by no test. Most likely mutastic's coverage never reached the code the tests ran: an agent in the tests' JVM arguments that rewrites classes as they load, as another coverage tool's does (here the tests' JVM arguments load none); a test framework or class loader that loads the code outside mutastic's (none known here); or tests that reach none of this code (the build's test filters). The worker's output is in samples/pricing/build/mutastic/worker.logThe machine
Section titled “The machine”A file mutastic reads or writes couldn’t be: a full disk, a directory that isn’t writable, or a file where it keeps a directory. The message names the file and the system’s reason. Exits with 2.
An error with no code of its own yet. The message says what went wrong. Exits with 2.
internal
Section titled “internal”mutastic itself went wrong: a bug. Please open an issue with the command, the message, and the worker log from the module’s work directory. Exits with 4.