-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Use a message based JUnit XML Formatter #2638
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mpkorstanje
force-pushed
the
write-message-based-junit-formatter
branch
from
November 10, 2022 17:34
f9e2bc7
to
d3d73b8
Compare
mpkorstanje
commented
Nov 10, 2022
cucumber-core/src/main/java/io/cucumber/core/runtime/CucumberExecutionContext.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## main #2638 +/- ##
=======================================
Coverage ? 84.68%
Complexity ? 2680
=======================================
Files ? 322
Lines ? 9444
Branches ? 899
=======================================
Hits ? 7998
Misses ? 1120
Partials ? 326
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
mpkorstanje
commented
Nov 10, 2022
cucumber-core/src/main/java/io/cucumber/core/plugin/JUnitFormatter2.java
Outdated
Show resolved
Hide resolved
mpkorstanje
commented
Nov 10, 2022
cucumber-core/src/main/java/io/cucumber/core/plugin/JUnitFormatter2.java
Outdated
Show resolved
Hide resolved
mpkorstanje
commented
Nov 10, 2022
cucumber-core/src/main/java/io/cucumber/core/plugin/JUnitFormatter2.java
Outdated
Show resolved
Hide resolved
mpkorstanje
force-pushed
the
write-message-based-junit-formatter
branch
from
December 3, 2022 15:08
7c1c8d8
to
99c846f
Compare
mpkorstanje
changed the title
Implement a message based JUnit Formatter
Use a message based JUnit XML Formatter
Dec 5, 2022
mpkorstanje
commented
Dec 5, 2022
cucumber-core/src/test/java/io/cucumber/core/plugin/TeamCityPluginTest.java
Show resolved
Hide resolved
mpkorstanje
commented
Dec 5, 2022
...nit-platform-engine/src/test/java/io/cucumber/junit/platform/engine/FeatureResolverTest.java
Show resolved
Hide resolved
mpkorstanje
commented
Dec 5, 2022
cucumber-core/src/test/java/io/cucumber/core/plugin/JUnitFormatterTest.java
Outdated
Show resolved
Hide resolved
mpkorstanje
commented
Dec 18, 2022
cucumber-core/src/test/java/io/cucumber/core/plugin/JUnitFormatterTest.java
Outdated
Show resolved
Hide resolved
[cucumber-junit-xml-formatter](https://github.com/cucumber/cucumber-junit-xml-formatter). This achieves several goals: * Move the internal code base away from the events from the `plugin` module. * Extract common parts of Cucumber into modules that can be shared. This results in several changes/improvements: 1. Change the long naming strategy to include the example group index ```feature Feature: Examples Tables Scenario Outline: Eating cucumbers Given there are <start> cucumbers When I eat <eat> cucumbers Then I should have <left> cucumbers Examples: These are passing | start | eat | left | | 12 | 5 | 7 | | 20 | 5 | 15 | Examples: These are failing | start | eat | left | | 12 | 20 | 0 | | 0 | 1 | 0 | ``` This feature previously contained the examples - Examples Tables - Eating cucumbers - These are passing - Example #1 - Examples Tables - Eating cucumbers - These are passing - Example #2 - Examples Tables - Eating cucumbers - These are failing - Example #1 - Examples Tables - Eating cucumbers - These are failing - Example #2 And will now contain the examples: - Examples Tables - Eating cucumbers - These are passing - Example #1.1 - Examples Tables - Eating cucumbers - These are passing - Example #1.2 - Examples Tables - Eating cucumbers - These are failing - Example #2.1 - Examples Tables - Eating cucumbers - These are failing - Example #2.2 2. Rename the suite from `io.cucumber.core.plugin.JUnitFormatter` to `Cucumber` ```xml <testsuite failures="0" name="Cucumber" skipped="0" errors="0" tests="1" time="0"> ``` 3. When a scenario is skipped or failed the executed steps are always included in the `system-out` element rather than the `skipped` or `failed` element. ```xml <testcase classname="Examples Tables" name="eating cucumbers - These are failing - Example #2.1" time="0.007"> <failure type="AssertionError" message="Expected values to be strictly equal: -8 !== 0 "> <![CDATA[ <a stacktrace here> ]]> </failure> <system-out><![CDATA[ Given there are 12 cucumbers................................................passed When I eat 20 cucumbers.....................................................passed Then I should have 0 cucumbers..............................................failed ]]></system-out> </testcase> <testcase classname="Skipping scenarios" name="Skipping from a step causes the rest of the scenario to be skipped" time="0.005"> <skipped/> <system-out><![CDATA[ Given a step that skips.....................................................skipped When a step that we expect to be skipped....................................skipped ]]></system-out> </testcase> ``` 4. The empty scenario and empty report are considered passing To be consistent with the exit code of the Cucumber process empty scenarios and test runs are considered passing.
mpkorstanje
force-pushed
the
write-message-based-junit-formatter
branch
from
December 27, 2022 18:13
6263e16
to
f451db8
Compare
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤔 What's changed?
Replace the
JUnitFormatter
with the message based implementation fromcucumber-junit-xml-formatter.
This achieves several goals:
plugin
module.This results in several changes/improvements:
This feature previously contained the examples
And will now contain the examples:
io.cucumber.core.plugin.JUnitFormatter
toCucumber
system-out
element rather than theskipped
orfailed
element.To be consistent with the exit code of the Cucumber process empty scenarios
and test runs are considered passing.
⚡️ What's your motivation?
Partially resolve cucumber/common#871
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.