Skip to content
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

Emit messages that link AST nodes to results #1462

Open
vincent-psarga opened this issue Apr 7, 2021 · 2 comments
Open

Emit messages that link AST nodes to results #1462

vincent-psarga opened this issue Apr 7, 2021 · 2 comments
Labels
🥒 core team Candidate for going onto the Cucumber Open Board: https://github.com/orgs/cucumber/projects/8 language: java language: javascript language: ruby library: cucumber-messages library: cucumber-react ⚡ enhancement Request for new functionality

Comments

@vincent-psarga
Copy link
Contributor

Summary

HTML report are really heavy as they embed the whole messages stream. We can reduce the messages by pre-computing results data:

  • result
  • duration
  • timestamp
  • attachments

Once this is done, we would only need the gherkinDocument messages to render the HTML report and a new data structure to represent pre-computed results (linking results directly to AST node (feature, scenario, exampleRow, step)

Expected Behavior

The reports overall size should be reduced. One step further could also be to extract the attachments content for images, videos and other HTML embeddable content)

Possible Solution

  • port the following libraries to the other languages: gherkin-utils, query
  • share test suites

Context & Motivation

  • reduce file size of static HTML reports
  • reduce load time for Cucumber Reports
@vincent-psarga vincent-psarga added ⚡ enhancement Request for new functionality language: ruby language: java language: javascript library: cucumber-react 🥒 core team Candidate for going onto the Cucumber Open Board: https://github.com/orgs/cucumber/projects/8 labels Apr 7, 2021
@vincent-psarga vincent-psarga added this to Next in Cucumber Open via automation Apr 7, 2021
@mattwynne
Copy link
Member

I think this is a great idea! 🌟🌟🌟🌟🌟

I'd suggest changing the description of this ticket to something like "link back to AST nodes in test result messages" - that would seem to better fit the way @aslakhellesoy described this idea to me, and better explain the benefits. Smaller file sizes is one benefit, but there are others too, such as making it simpler for people to build formatters / reporters on top of the protocol.

@aslakhellesoy aslakhellesoy changed the title Reduce HTML report file size Emit messages that link AST nodes to results Apr 20, 2021
@aslakhellesoy
Copy link
Contributor

Idea:

  • Final message stream does not include messages only used by Cucumber's execution
    • Pickles
    • etc

We can add an extra property to the TestStepFinished message. Something like this...

type TestStepFinished = {
   documentStepReferences: DocumentStepReference[]
}

type DocumentStepReference = {
  astNodeId: string
  uri: string
  lineNumber: number
}

By denormalising this way, consuming messages becomes a lot easier, and we can probably scrap the Query module altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🥒 core team Candidate for going onto the Cucumber Open Board: https://github.com/orgs/cucumber/projects/8 language: java language: javascript language: ruby library: cucumber-messages library: cucumber-react ⚡ enhancement Request for new functionality
Projects
Status: Next
Development

No branches or pull requests

3 participants