Page MenuHomeSoftware Heritage

Execute cypress tests in parallel on Jenkins
Closed, MigratedEdits Locked

Description

Cypress overall tests execution is quite long as they are sequentially ran by default.

In order to speedup tests execution, they can be run in parallel using multiple test executors.

Nevertheless, this requires to use the Cypress dashboard that cannot be self hosted and is quite limited for its free pricing plan.

Fortunately, it exists the sorry-cypress open source project enabling to run parallel cypress tests while being self hostable.
We should consider using it to speedup cypress tests on Jenkins.

Event Timeline

anlambert triaged this task as Normal priority.Jul 6 2021, 2:03 PM
anlambert created this task.

After some hacks on the current Jenkins pipeline for swh-web to test if it was feasible, I managed to setup the use of sorry-cypress but could not run multiple cypress in parallel as Jenkins pipelines forbid nested parallel stages.
So this would require setting up a dedicated pipeline build job for cypress tests as currently Python and cypress tests are executed in parallel in a single job.

After some hacks on the current Jenkins pipeline for swh-web to test if it was feasible, I managed to setup the use of sorry-cypress but could not run multiple cypress in parallel as Jenkins pipelines forbid nested parallel stages.
So this would require setting up a dedicated pipeline build job for cypress tests as currently Python and cypress tests are executed in parallel in a single job.

Fortunately, it exists a workaround to allow nested parallel stages.

So I took a new stab at this and ended up with an updated Jenkins pipeline enabling to run cypress tests in parallel using 4 runners.

Using that approach, I observe a 2x speedup on overall swh-web tests execution, which is great !

Diffs for the result of that work are incoming.