Cucumber JUnit Platform Engine does not honour Discovery Filters
See original GitHub issueDescribe the bug
If a discovery filter is set, e.g. when using Intellij JUnit Configuration with a Pattern, the Cucumber test engine ignores this filter and runs all tests regardless.
This is mostly a problem when Cucumber is used together with other engines and only a subset of tests is supposed to run.
Expected behavior
DiscoveryFilter instances, which can be retrieved through EngineDiscoveryRequest.getFiltersByType()
should be evaluated.
Solution suggestion
Here’s the relevant code from the jqwik engine, which creates a predicate to use for filtering all test classes:
private static Predicate<String> buildClassNamePredicate(EngineDiscoveryRequest request) {
List<DiscoveryFilter<String>> filters = new ArrayList<>();
filters.addAll(request.getFiltersByType(ClassNameFilter.class));
filters.addAll(request.getFiltersByType(PackageNameFilter.class));
return composeFilters(filters).toPredicate();
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (11 by maintainers)
Top Results From Across the Web
Feature files discovery in cucumber-junit-platform-engine
After migrating to cucumber-junit-platform-engine @CucumberOptions are no longer supported. package com.mycompany.cucumber; import io.cucumber.
Read more >Support cucumber-junit-platform-engine : IDEA-227508
This happens because IDEA creates an "All tests in package test" which will issue a discovery selector for the class path root with...
Read more >[JVM] Using JUnit categories to control Cucumber tests
I'm having trouble using JUnit categories to control which Cucumber scenarios get executed. I created a JUnit category called ...
Read more >A-Index (JUnit 5.9.1 API)
Return a filter that will include elements if and only if the adapted Filter includes the ... Method in class org.junit.platform.engine.support.discovery.
Read more >Cucumber with JUnit 5 - cronn GmbH
Thanks to Gradle integrating Cucumber with JUnit 5 is easy. ... platform-engine to work with the junit-platform-suite to discover feature ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
One done:
https://youtrack.jetbrains.com/issue/IDEA-276463
You request what you need, and I’ll request what I’ll need. I’m sure we can fit more then one link in a tweet.