Repository navigation
Add a Cucumber JVM 8 adapter - #1455
MohabMohie wants to merge 2 commits into
Conversation
The adapter mirrors allure-cucumber7-jvm and reads Gherkin lines as ints from messages v34. Cucumber 8 reports failed @BeforeAll and @afterall hooks on TestRunHookFinished, so those failures are stored as run-level global errors. Status tags mark flaky, muted, and known results.
The install command compiles allure-cucumber8-jvm against Allure Java 3.0.0 and skips signing so a commit build can be resolved before the upstream release.
Fixes #6262 SHAFT now runs Cucumber 8.0.4 and reports through `io.qameta.allure.cucumber8jvm.AllureCucumber8Jvm`. The adapter sources are the Cucumber 8 port from allure-framework/allure-java#1455 at commit `a1df39fffb1389ecbce951d617b5da3c49bb1a3a`, compiled into `shaft-engine`. Listeners extend that class. The published `shaft-engine` jar carries the classes, so consumers resolve shaft-engine from Maven Central and do not need another repository. A JitPack repository is not used. JitPack also serves `com.github.docker-java:docker-java:3.7.1`, and that POM depends on `com.github.docker-java.docker-java` transports, including the test-kit that brings `junit:junit:4.12`. SHAFT still depends on `cucumber-java`, `cucumber-testng`, and `cucumber-picocontainer` directly, so the cucumber-bom 8.0.4 import supplies them. `CucumberFeatureListener` and `CucumberTestRunnerListener` extend `AllureCucumber8Jvm`. The JSON cucumber plugin path stays `json:allure-results/cucumber.json`. Dependabot no longer ignores `io.cucumber:cucumber-bom` semver-major updates. Upstream request remains allure-framework/allure-java#1451. This pull request does not close that issue. ## Riskiest assumption The adapter sources compiled into `shaft-engine` are the Cucumber 8 listener from allure-java commit `a1df39fffb1389ecbce951d617b5da3c49bb1a3a`. `CucumberFeatureListenerUnitTest` asserts that `AllureCucumber8Jvm` loads from `shaft-engine`, and `CucumberTestsHelperCoverageUnitTest.configureCucumberPropertiesShouldPopulateAllExpectedParameters` still sees `json:allure-results/cucumber.json`. ## Evidence - Focused shaft-engine tests passed after the adapter moved in-tree: Tests run: 15, Failures: 0, Errors: 0. - The overlay test still reads the scenario name and last-step health through the shipped listener. - The TestNG Cucumber runner listener tests still pass. - The shipped cucumber plugin string still contains `json:allure-results/cucumber.json`.
|
@baev appreciate your review and feedback :) |
|
@andrcuns appreciate your feedback if applicable |
baev
left a comment
There was a problem hiding this comment.
thanks. Please remove the jitpack.yml
| ) | ||
| ) | ||
| .orElse("failed"); | ||
| writeRunLevelError(new IllegalStateException(detail)); |
There was a problem hiding this comment.
Please preserve the original exception details when reporting failed @BeforeAll / @AfterAll hooks. This already works in the JVM 7 adapter: it passes result.getError() to createGlobalError. I verified both hook cases with Cucumber 7.34.8, and the generated traces retain the original RuntimeException and the failing hook frame (BrokenBeforeAllHooks.java:27 / BrokenAfterAllHooks.java:27).
Here, new IllegalStateException(detail) replaces the original exception type, stack trace and causes with a new trace pointing into the adapter at this line. The current JVM 8 test output confirms that the failing hook frame is lost.
finished.getResult().getException() already provides the original type and stack trace. Please preserve those in the GlobalError and extend the hook tests to assert the original failing hook frame, keeping the existing JVM 7 reporting behavior.
|
@MohabMohie can you please complete the changes we need this to be merged... waiting for it.. |
What
Adds
allure-cucumber8-jvm, a Cucumber JVM 8 plugin that mirrorsallure-cucumber7-jvmand runs on Cucumber 8.0.4.Cucumber 8 messages type
Location.lineas a Javaint. This module stores lines inMap<Integer, AstNode>and callsint getLine(). Bytecode compiled against the cucumber 7Long getLine()descriptor throwsNoSuchMethodErroron this runtime.Cucumber 8 reports a failed
@BeforeAllor@AfterAllhook on theTestRunHookFinishedmessage.TestRunFinishedhas no throwable for that hook, andRuntime.run()returns. The adapter writes the same run-level global error the cucumber 7 adapter writes when the plugin result carries the throwable.The suite also records
@flaky,@muted, and@knownon the scenario result.Coverage
A real Cucumber JVM 8.0.4 run asserts feature source through the title path and descriptions, scenario name,
uri:linefull name, example-row parameters, step keyword and text with status, data-table CSV attachment, before/after hooks as fixtures, other hooks as steps, write and embed attachments, tag labels, issue and TMS links, flaky/muted/known, undefined step textUndefined Step. Please add step definition, pending, ambiguous, and a run-level global error when@BeforeAllfails before any scenario.Tracker
Requested by #1451. This pull request does not close that issue.