Skip to content
Snippets Groups Projects
Antoine Lambert's avatar
Antoine Lambert authored
In order to gain some time when executing Jenkins jobs for swh-web,
execute cypress tests in parallel using 4 runners thanks to the
sorry-cypress tool.

To do so, we use the docker features of Jenkins pipeline.
One sidecar container is created to execute the sorry-cypress server
and parallel tests are executed in another container spawning 4
cypress processes. The communication between the two containers
is done through a dedicated docker network.

Regarding code coverage, we now need to merge the outputs produced
by the 4 runners before generating reports.

This change brings a 2x speedup on overall swh-web build jobs execution
(when a single job is executed, speedup is lesser when multiple jobs
are executed in parallel but still significative).

Also restrict the maximum number of concurrent builds per job to 3
in order to avoid executing too many cypress processes at the same
time as they consume quite a lot of resources on the Jenkins node.

Related to T3423
ddbafe95
History

Jenkins jobs configuration

This repository manages the jenkins jobs configuration.

A jenkins jobs applies the configuration on jenkins when a commit is done in this repository

Testing

To test locally the configuration , simply run tox:

tox

The output displays the jenkins configuration files as they will be applied on the server.

Run on docker

Jenkins jobs configuration can be tested on a local temporary Jenkins instance executed in a docker container. The local swh-jenkins-jobs repository will be mounted as a volume and cloned by Jenkins so do not forget to commit the changes you want to test.

  • Launch jenkins
docker-compose build
docker-compose up
  • Get the admin password in the logs

Connect to localhost:8080, then within the jenkins ui:

  • Change the admin password to admin123
  • Create a jenkins folder jenkins-tools
  • Create a new free-style job named job-builder inside the jenkins-tools targeting this git repository file:///opt/swh-jenkins-jobs
    • Configure the branch (e.g. */master)
    • Add a build step Execute shell with this content
tox update -- --delete-old
  • Save your build configuration
  • Trigger a build \o/