docs(ci): add sample config for jenkins (#3398)

This commit is contained in:
Arjun Attam 2020-08-12 14:01:55 -07:00 committed by GitHub
parent 962ddc09c4
commit be7db4d2c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@ configurations for common CI providers.
* [Azure Pipelines](#azure-pipelines)
* [Travis CI](#travis-ci)
* [CircleCI](#circleci)
* [Jenkins](#jenkins)
* [Bitbucket Pipelines](#bitbucket-pipelines)
* [GitLab CI](#gitlab-ci)
- [Caching browsers](#caching-browsers)
@ -170,6 +171,25 @@ We run our tests on CircleCI, with our [pre-built Docker image](docker/README.md
This is likely caused by Jest autodetecting the number of processes on the entire machine (`36`) rather than the number allowed to your container (`2`). To fix this, set `jest --maxWorkers=2` in your test command.
### Jenkins
Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image](docker/README.md)
to run tests on Jenkins.
```groovy
pipeline {
agent { docker { image 'mcr.microsoft.com/playwright:bionic' } }
stages {
stage('e2e-tests') {
steps {
sh 'npm install'
sh 'npm run test'
}
}
}
}
```
### Bitbucket Pipelines
Bitbucket Pipelines can use public [Docker images as build environments](https://confluence.atlassian.com/bitbucket/use-docker-images-as-build-environments-792298897.html). To run Playwright tests on Bitbucket, use our public Docker image ([see Dockerfile](docker/README.md)).