Skip to content

Lineage rework #77

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Update dependency cucumber/query to ^13.3.0 ([#77](https://github.com/cucumber/junit-xml-formatter/pull/77))
- Update dependency io.cucumber:query up to v13.5

### Fixed
- Remove unnecessary coupling to `node:assert` ([#77](https://github.com/cucumber/junit-xml-formatter/pull/77))

## [0.8.0] - 2025-07-07
### Added
Expand Down
2 changes: 1 addition & 1 deletion java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>query</artifactId>
<version>[13.0.2,14.0.0)</version>
<version>[13.3.0,14.0.0)</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.cucumber.messages.types.TestStepFinished;
import io.cucumber.messages.types.TestStepResult;
import io.cucumber.messages.types.TestStepResultStatus;
import io.cucumber.query.Lineage;
import io.cucumber.query.NamingStrategy;
import io.cucumber.query.Query;

Expand Down Expand Up @@ -69,11 +70,15 @@ private Pickle getPickle(TestCaseStarted testCaseStarted) {
}

String getPickleName(TestCaseStarted testCaseStarted) {
return query.findNameOf(getPickle(testCaseStarted), namingStrategy);
Pickle pickle = getPickle(testCaseStarted);
return query.findLineageBy(pickle)
.map(lineage -> namingStrategy.reduce(lineage, pickle))
.orElseGet(pickle::getName);
}

String getFeatureName(TestCaseStarted testCaseStarted) {
return query.findFeatureBy(testCaseStarted)
return query.findLineageBy(testCaseStarted)
.flatMap(Lineage::feature)
.map(Feature::getName)
.orElseGet(() -> this.getPickle(testCaseStarted).getUri());
}
Expand Down
Loading
Loading