junit-team/junit5 · error · JUnitException

No TestEngine ID matched the following include EngineFilters

Error message

No TestEngine ID matched the following include EngineFilters: 

What it means

Thrown by EngineFilterer.checkNoUnmatchedIncludeFilter() during discovery sanity checks when an include EngineFilter names one or more engine IDs that do not match any registered TestEngine. The launcher aborts rather than silently running no engines, listing the unmatched IDs and the registered engines/filters.

Source

Thrown at junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineFilterer.java:67

		checkedTestEngines.put(testEngine, excluded);
		return excluded;
	}

	void performSanityChecks() {
		checkNoUnmatchedIncludeFilter();
		warnIfAllEnginesExcluded();
	}

	private void warnIfAllEnginesExcluded() {
		if (!checkedTestEngines.isEmpty() && checkedTestEngines.values().stream().allMatch(excluded -> excluded)) {
			logger.warn(() -> "All TestEngines were excluded by EngineFilters.\n" + getStateDescription());
		}
	}

	private void checkNoUnmatchedIncludeFilter() {
		SortedSet<String> unmatchedEngineIdsOfIncludeFilters = getUnmatchedEngineIdsOfIncludeFilters();
		if (!unmatchedEngineIdsOfIncludeFilters.isEmpty()) {
			throw new JUnitException("No TestEngine ID matched the following include EngineFilters: "
					+ unmatchedEngineIdsOfIncludeFilters + ".\n" //
					+ "Please fix/remove the filter or add the engine.\n" //
					+ getStateDescription());
		}
	}

	private SortedSet<String> getUnmatchedEngineIdsOfIncludeFilters() {
		Set<String> checkedTestEngineIds = checkedTestEngines.keySet().stream() //
				.map(TestEngine::getId) //
				.collect(toSet());
		return engineFilters.stream() //
				.filter(EngineFilter::isIncludeFilter) //
				.map(EngineFilter::getEngineIds) //
				.flatMap(Collection::stream) //
				.filter(id -> !checkedTestEngineIds.contains(id)) //
				.collect(toCollection(TreeSet::new));
	}

View on GitHub (pinned to 956246301e)

Solutions

  1. Verify every engine ID in includeEngines(...) corresponds to a TestEngine on the classpath.
  2. Remove the unmatched ID from the include filter.
  3. Add the missing engine dependency (e.g. the Spek/Kotest launcher artifact) to the test runtime classpath.
  4. Inspect the exception message: it lists registered TestEngines and registered EngineFilters.

Example fix

// before
.filters(includeEngines("junit-jupiter", "spek")) // spek absent

// after
.filters(includeEngines("junit-jupiter"))
Defensive patterns

Strategy: validation

Validate before calling

import org.junit.platform.engine.TestEngine;
Set<String> available = ServiceLoader.load(TestEngine.class)
    .stream().map(p -> p.get().getId()).collect(toSet());
for (String id : requestedIncludeEngineIds) {
    if (!available.contains(id)) {
        throw new IllegalArgumentException("Unknown engine id: " + id);
    }
}

Type guard

static boolean allIncludeIdsResolvable(List<EngineFilter> filters, Set<String> engineIdsOnClasspath) {
    return filters.stream().filter(EngineFilter::isIncludeFilter)
        .flatMap(f -> f.getEngineIds().stream())
        .allMatch(engineIdsOnClasspath::contains);
}

Prevention

When it happens

Trigger: Calling LauncherDiscoveryRequestBuilder.filters(includeEngines("junit-jupiter", "spek")) when 'spek' is not on the classpath. Or any EngineFilter with include semantics whose getEngineIds() contains an ID no registered engine provides.

Common situations: Adding an includeEngines filter for an engine whose dependency was removed or never added. Renaming/migrating engines (e.g. Spek, Kotest) and forgetting to update the filter. CI image missing an engine artifact that local builds include.

Related errors


AI-assisted analysis of junit-team/junit5@956246301e (2026-08-04). Data as JSON: /data/errors/940aa6234ae6a0cd.json. Report an issue: GitHub.