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

Convert step duration from ms to ns for JSON Formatter #807

Closed
wants to merge 1 commit into from

Conversation

gpichot
Copy link

@gpichot gpichot commented Mar 31, 2017

Unless I miss something, the duration should not be in milliseconds in the JSON reporter but in nanoseconds. I checked and the Gherkin JSON report format uses nanoseconds. See:

It could help on our side as our CI Cucumber reporter expect nanoseconds and not milliseconds.

@charlierudolph
Copy link
Member

charlierudolph commented Mar 31, 2017

You are pointing to a deprecated project to show that the json formatter should be in nanoseconds. Are you suggesting that this should be nanoseconds to line up with cucumber-ruby?

With the 2.0 release candidate, we switched from storing nanoseconds to storing milliseconds to simplify the implementation so the same code runs both in the browser and on node. Yes we can convert the json formatter to ouput nanoseconds but since we aren't currently saving that level of precision that seems wrong to me.

@gpichot
Copy link
Author

gpichot commented Mar 31, 2017

@charlierudolph Indeed, I didn't saw that it was deprecated.

Then I am not clear with the current unit used for Cucumber reports in the JSON formatter. Are they different units for the duration depending on the runtime?

If it's milliseconds in cucumber-ruby & cucumber-jvm indeed it makes sense to respect this format in cucumber-js too. But it seems like the unit is nanoseconds in cucumber-jvm and cucumber-ruby:

From my perspective, I would rather have the duration unit be the same in all reports no matter the cucumber runtime used.

My point is just that CI report generators are making assumptions about the format of the JSON report. But if it's by design, we will find another way to feed them to the report generator.

@gpichot
Copy link
Author

gpichot commented Apr 11, 2017

@charlierudolph Just a quick note: we now use this fix to generate the json reports. The Jenkins reporter that we use now outputs the correct durations.

=> Feel free to close this one if it does not comply with the specification that you have chosen. I was just puzzled by the fact that you choose to break JSON report compatibility between cucumber implementations.

@charlierudolph
Copy link
Member

Created cucumber/common#187 to start a discussion about a shared JSON schema that all cucumber implementations could follow. Going to close this for now

@gpichot
Copy link
Author

gpichot commented Apr 19, 2017

@charlierudolph Thanks!

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants