Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JUnit Platform] Warn if feature files could not be found #2182

Merged
merged 1 commit into from
Dec 9, 2020

Conversation

mpkorstanje
Copy link
Contributor

Both Surefire and Gradle assume that tests are contained within a class and
use ClassSelector to discover tests in these classes. Cucumber uses plain
text files. By using a class annotated with @Cucumber we work around this
behaviour. Cucumber will then scan the package and sub-packages of the
annotated class for feature files.

When using this system, in case of misconfiguration it is not immediately clear
if the test engine is not picked up or if the location of the feature files and
annotated class do not line up.

While we can not generically log a warning in case a discovery selector did not
find any features, we can log a warning in this special case. It is clear that
the intend was to put feature files in the package. Otherwise the annotated
class could/should be removed to suppress this warning.

Fixes: #2179

@mpkorstanje mpkorstanje force-pushed the junit-platform-warn-if-no-features branch from 3e2bea9 to c530be2 Compare December 9, 2020 01:39
@mpkorstanje mpkorstanje changed the title [JUnit Platform Engine] Warn if feature files could not be found [JUnit Platform] Warn if feature files could not be found Dec 9, 2020
Both Surefire and Gradle assume that tests are contained within a class and
use `ClassSelector` to discover tests in these classes. Cucumber uses plain
text files. By using a class annotated with `@Cucumber` we work around this
behaviour. Cucumber will then scan the package and sub-packages of the
annotated class for feature files.

When using this system, in case of misconfiguration it is not immediately clear
if the test engine is not picked up or if the location of the feature files and
annotated class do not line up.

While we can not generically log a warning in case a discovery selector did not
find any features, we can log a warning in this special case. It is clear that
the intend was to put feature files in the package. Otherwise the annotated
class could/should be removed to suppress this warning.

Fixes: #2179
@mpkorstanje mpkorstanje force-pushed the junit-platform-warn-if-no-features branch from c530be2 to a3dcc4c Compare December 9, 2020 01:42
@codecov
Copy link

codecov bot commented Dec 9, 2020

Codecov Report

Merging #2182 (a3dcc4c) into main (cea219d) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #2182      +/-   ##
============================================
+ Coverage     82.79%   82.80%   +0.01%     
- Complexity     2324     2328       +4     
============================================
  Files           306      306              
  Lines          8294     8300       +6     
  Branches        762      763       +1     
============================================
+ Hits           6867     6873       +6     
  Misses         1118     1118              
  Partials        309      309              
Impacted Files Coverage Δ Complexity Δ
...latform/engine/CucumberEngineExecutionContext.java 84.21% <ø> (ø) 8.00 <0.00> (ø)
...ucumber/junit/platform/engine/FeatureResolver.java 98.51% <100.00%> (+0.06%) 32.00 <5.00> (+4.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cea219d...a3dcc4c. Read the comment docs.

@mpkorstanje mpkorstanje merged commit 36e8dee into main Dec 9, 2020
@mpkorstanje mpkorstanje deleted the junit-platform-warn-if-no-features branch December 9, 2020 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More verbosity when no tests are run
1 participant