bahmutov / bahmutov/cypress-repeat

Cannot reuse same --group name across parallel machines

Open
#21 1 comment 0 reactions 0 assignees View on GitHub
help wanted
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)

![image](https://user-images.githubusercontent.com/30851622/125437654-2892ed1d-cf53-4076-8b90-7821b62433a5.png)

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.