bahmutov / bahmutov/cypress-repeat
Cannot reuse same --group name across parallel machines
- Dominant language
- JavaScript
- Stars
- 39
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
I am running my tests in parallelisation.
`parallelism: 2`
`cypress-repeat -n 3 --until-passes`
CI Provider: CircleCI
`Machine#1`: Test fails --> cypress-repeat reruns with `--group=run-1-of-3` (all good 👍🏽 )
`Machine#2`: Test fails --> cypress-repeat reruns with `--group=run-1-of-3` (fails 👎🏽 )
But, this group name `run-1-of-3` is already used up in Machine#1, hence cypress run fails.
Workaround: Can we also include the Machine# , while creating the groupname?
Eg. Circle CI parallel machines have unique index in them, identified env variable `CIRCLE_NODE_INDEX`. [more info](https://circleci.com/docs/2.0/env-vars/)
We can form the group name like so: `${group}-${CIRCLE_NODE_INDEX}-${k + 1}-of-${repeatNtimes}`
I don't know how parallel machines are identified in other CI providers.
Below is the stdout of the CI failure from `Machine#2` (`Machine#1` ran all fine)

Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing how cypress-repeat constructs the --group value for repeated runs, then inspect the CircleCI CIRCLE_NODE_INDEX environment variable described in the issue. Done means parallel machines produce distinct group names while existing non-parallel and non-CircleCI runs continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cypress, javascript
- Domain
- ci-cd, cli, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100