mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs: add workers for ci (#23046)
This commit is contained in:
parent
2e5ddd4361
commit
94f928600d
@ -6,7 +6,6 @@ title: "Continuous Integration"
|
||||
Playwright tests can be executed in CI environments. We have created sample
|
||||
configurations for common CI providers.
|
||||
|
||||
<!-- TOC -->
|
||||
|
||||
## Introduction
|
||||
|
||||
@ -50,6 +49,21 @@ configurations for common CI providers.
|
||||
dotnet test
|
||||
```
|
||||
|
||||
## Workers
|
||||
* langs: js
|
||||
|
||||
We recommend setting [workers](./api/class-testconfig.md#test-config-workers) to "1" in CI environments to prioritize stability and reproducibility. Running tests sequentially ensures each test gets the full system resources, avoiding potential conflicts. However, if you have a powerful self-hosted CI system, you may enable [parallel](./test-parallel.md) tests. For wider parallelization, consider [sharding](./test-parallel.md#shard-tests-between-multiple-machines) - distributing tests across multiple CI jobs.
|
||||
|
||||
```js title="playwright.config.ts"
|
||||
import { defineConfig, devices } from '@playwright/test';
|
||||
|
||||
export default defineConfig({
|
||||
// Opt out of parallel tests on CI.
|
||||
workers: process.env.CI ? 1 : undefined,
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## CI configurations
|
||||
|
||||
The [Command line tools](./browsers#install-system-dependencies) can be used to install all operating system dependencies on GitHub Actions.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user