Skip to content

Conversation

@alextech
Copy link
Contributor

@alextech alextech commented Nov 4, 2025

Motivation - to have output compatible with cucumber report viewers, such as cucumber's own react viewer. It requires output to be in NDJSON format as specified in https://github.com/cucumber/compatibility-kit/tree/main/devkit/samples

Notable changes:

  • FeatureInfo keeps original feature object from the messages library to be able to use its to_json() method. Therefore, individual fields are no longer copied between the classes but are referenced from the original object. SourceInfo was introduced for similar reason
  • Reporter instantiation was moved to a factory lambda method. Original implementation caused confusing problem where the report files were written regardless of whether that reporter was requested or not. This was because even though some reporter may not have been requested, it would still be instantiated and then destructed, while the destructor had the actual report writing code.

Work still to be done:

  • Implement NdjsonComparer so that bats runner could validate output. It will have to take into account differences in paths, and timings
  • Implement the rest of the messages spec
    • meta
    • source
    • gherkinDocument
    • pickle
    • stepDefinition
    • testRunStarted / testRunFinished
    • testCase
    • testCaseStarted / testCaseFinished
    • testStepStarted / testStepFinished
    • Errors
  • Verify ID generation. Java implementation (https://github.com/cucumber/cucumber-jvm) decided to use GUIDs. Will see which one fits best.
  • Remove ndjson samples from the repository and load them from compatibility kit using cmake. Having them here makes the repository bloated and new samples are added regularly. For early development proof of concept manual copying was easier.
  • Implement all the compatibility test cases to verify the runner handles as many upstream requirements as possible. Maybe even replace current acceptance tests with them.

…urce ndjson.

Since it contains path information, move path output to it.
…stantiated during CLI parsing stage. This causes their destructor to always run at the end, which writes report to the file system whether that reporter was requested or not. Use factory method instead.
…ureInfo because it has needed to_json call. Other properties can then be accessed through it without data duplication in memory.
…cutable that can be run from bats for assertions.
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.

1 participant