Skip to content

Commit 70a9879

Browse files
Lineage rework (#77)
Pre-emptively migrate away from soon-to-be-deprecated methods (cucumber/query#84), partly to validate the consumer cost is not too great. Also while we're here, get rid of node:assert usage and replace with a simple function, thus removing unnecessary coupling to Node.js as a runtime. Co-authored-by: M.P. Korstanje <[email protected]>
1 parent 34d1ff6 commit 70a9879

File tree

7 files changed

+82
-132
lines changed

7 files changed

+82
-132
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
### Changed
10+
- Update dependency cucumber/query to ^13.3.0 ([#77](https://github.com/cucumber/junit-xml-formatter/pull/77))
11+
- Update dependency io.cucumber:query up to v13.5
12+
13+
### Fixed
14+
- Remove unnecessary coupling to `node:assert` ([#77](https://github.com/cucumber/junit-xml-formatter/pull/77))
915

1016
## [0.8.1] - 2025-08-13
1117
### Fixed

java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<dependency>
6565
<groupId>io.cucumber</groupId>
6666
<artifactId>query</artifactId>
67-
<version>[13.0.2,14.0.0)</version>
67+
<version>[13.3.0,14.0.0)</version>
6868
</dependency>
6969

7070
<dependency>

java/src/main/java/io/cucumber/junitxmlformatter/XmlReportData.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import io.cucumber.messages.types.TestStepFinished;
1313
import io.cucumber.messages.types.TestStepResult;
1414
import io.cucumber.messages.types.TestStepResultStatus;
15+
import io.cucumber.query.Lineage;
1516
import io.cucumber.query.NamingStrategy;
1617
import io.cucumber.query.Query;
1718

@@ -69,11 +70,15 @@ private Pickle getPickle(TestCaseStarted testCaseStarted) {
6970
}
7071

7172
String getPickleName(TestCaseStarted testCaseStarted) {
72-
return query.findNameOf(getPickle(testCaseStarted), namingStrategy);
73+
Pickle pickle = getPickle(testCaseStarted);
74+
return query.findLineageBy(pickle)
75+
.map(lineage -> namingStrategy.reduce(lineage, pickle))
76+
.orElseGet(pickle::getName);
7377
}
7478

7579
String getFeatureName(TestCaseStarted testCaseStarted) {
76-
return query.findFeatureBy(testCaseStarted)
80+
return query.findLineageBy(testCaseStarted)
81+
.flatMap(Lineage::feature)
7782
.map(Feature::getName)
7883
.orElseGet(() -> this.getPickle(testCaseStarted).getUri());
7984
}

0 commit comments

Comments
 (0)