Antontelesh / mochawesome-merge

Merge several Mochawesome JSON reports
MIT License
85 stars 16 forks source link

Fix duration calculation #95

Closed basile-parent closed 1 year ago

basile-parent commented 1 year ago

This pull request fixes the duration calculation which had problems (Issue 61) and didn't take count of the time loss between each test execution. The new calculation method just calculate the diff between the start and end (from maxTimeSpan) of the execution.

I also added a comment for better comprehension.

Antontelesh commented 1 year ago

Hi @basile-parent instead of defining dumb values and then overriding them, I would suggest you to pass the result of getStateTimeSpan to generateStats along with suites. This way you'd omit defining dumb values

basile-parent commented 1 year ago

Hi @Antontelesh, your comment is relevant. However I think it would be even clearer if all data would be created in the generic generateStats function. I made a new commit. Please let me know if it's good for you.

Antontelesh commented 1 year ago

@basile-parent this looks even better! Thank you, I’m merging

Antontelesh commented 1 year ago

Oh, a test failed. Would you mind checking it on your side?

Antontelesh commented 1 year ago

@basile-parent looks like you need to update snapshots

basile-parent commented 1 year ago

@Antontelesh Sorry for the delay, I was pretty busy recently ^^ I updated both json test files (to have a more readable snapshot) and the snapshot. Remember to squash the commits (as there are several of them) of my PR.

Antontelesh commented 1 year ago

:tada: This PR is included in version 4.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: