Skip to content

Duration not rounded if timing file is updated #349

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
SamuelWei opened this issue Feb 4, 2025 · 2 comments
Open

Duration not rounded if timing file is updated #349

SamuelWei opened this issue Feb 4, 2025 · 2 comments

Comments

@SamuelWei
Copy link

Today I added cypress-split to my Github Action. I works great, however I believe there is a small bug.

If the duration of tests change, the timings.json file is updated.
The only issue is, that the new duration is not a rounded value, but instead has a lot of decimal places.

Image

In the CI run output the values are rounded.

Image

The values where also rounded when the CI created the timings.json file on the first run.

@SamuelWei
Copy link
Author

The reason for this can be found in: https://github.com/bahmutov/cypress-split/blob/main/src/timings.js#L117

Once the timing data is merged, the result is not rounded.

However there is a more basic issue, as mentioned in #309. Each worker should only export the timings for the files it has run.
Otherwise merging the timings by using an average is resulting in a false result.

@SamuelWei
Copy link
Author

I assume these would be the steps required to fix this:

  • Check if timing files exists
  • If not, write all timings to output file -> End
  • Filter old timings file to only the specs used in this run
  • Else, compare timings using threshold against old timings file
  • If unchanged -> write filtered timings file to output file -> End
  • Else, overwrite the timings of the filtered timings file -> output file -> End

@OriR @tuanna45 what do you think?

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

No branches or pull requests

1 participant