fix: properly merge projects in defineConfig (#36898)
infra / docs & lint (push) Has been cancelled Details
infra / Lint snippets (push) Has been cancelled Details
components / ${{ matrix.os }} - Node.js ${{ matrix.node-version }} (18, macos-latest) (push) Has been cancelled Details
components / ${{ matrix.os }} - Node.js ${{ matrix.node-version }} (18, ubuntu-latest) (push) Has been cancelled Details
components / ${{ matrix.os }} - Node.js ${{ matrix.node-version }} (18, windows-latest) (push) Has been cancelled Details
components / ${{ matrix.os }} - Node.js ${{ matrix.node-version }} (20, ubuntu-latest) (push) Has been cancelled Details
components / ${{ matrix.os }} - Node.js ${{ matrix.node-version }} (22, ubuntu-latest) (push) Has been cancelled Details
tests others / Stress - ${{ matrix.os }} (macos-latest) (push) Has been cancelled Details
tests others / Stress - ${{ matrix.os }} (ubuntu-latest) (push) Has been cancelled Details
tests others / Stress - ${{ matrix.os }} (windows-latest) (push) Has been cancelled Details
tests others / WebView2 (push) Has been cancelled Details
tests others / time library - ${{ matrix.clock }} (frozen) (push) Has been cancelled Details
tests others / time library - ${{ matrix.clock }} (realtime) (push) Has been cancelled Details
tests others / time test runner - ${{ matrix.clock }} (frozen) (push) Has been cancelled Details
tests others / time test runner - ${{ matrix.clock }} (realtime) (push) Has been cancelled Details
tests others / Electron - ${{ matrix.os }} (macos-latest) (push) Has been cancelled Details
tests others / Electron - ${{ matrix.os }} (ubuntu-latest) (push) Has been cancelled Details
tests others / Electron - ${{ matrix.os }} (windows-latest) (push) Has been cancelled Details
tests 1 / ${{ matrix.os }} (${{ matrix.browser }} - Node.js ${{ matrix.node-version }}) (chromium, 18, ubuntu-22.04) (push) Has been cancelled Details
tests 1 / ${{ matrix.os }} (${{ matrix.browser }} - Node.js ${{ matrix.node-version }}) (chromium, 20, ubuntu-22.04) (push) Has been cancelled Details
tests 1 / ${{ matrix.os }} (${{ matrix.browser }} - Node.js ${{ matrix.node-version }}) (chromium, 22, ubuntu-22.04) (push) Has been cancelled Details
tests 1 / ${{ matrix.os }} (${{ matrix.browser }} - Node.js ${{ matrix.node-version }}) (chromium, 24, ubuntu-22.04) (push) Has been cancelled Details
tests 1 / ${{ matrix.os }} (${{ matrix.browser }} - Node.js ${{ matrix.node-version }}) (firefox, 18, ubuntu-22.04) (push) Has been cancelled Details
tests 1 / ${{ matrix.os }} (${{ matrix.browser }} - Node.js ${{ matrix.node-version }}) (webkit, 18, ubuntu-22.04) (push) Has been cancelled Details
tests 1 / ${{ matrix.os }} (chromium tip-of-tree) (ubuntu-22.04) (push) Has been cancelled Details
tests 1 / Test Runner (18, macos-latest, 1, 2) (push) Has been cancelled Details
tests 1 / Test Runner (18, macos-latest, 2, 2) (push) Has been cancelled Details
tests 1 / Test Runner (18, ubuntu-latest, 1, 2) (push) Has been cancelled Details
tests 1 / Test Runner (18, ubuntu-latest, 2, 2) (push) Has been cancelled Details
tests 1 / Test Runner (18, windows-latest, 1, 2) (push) Has been cancelled Details
tests 1 / Test Runner (18, windows-latest, 2, 2) (push) Has been cancelled Details
tests 1 / Test Runner (20, ubuntu-latest, 1, 2) (push) Has been cancelled Details
tests 1 / Test Runner (20, ubuntu-latest, 2, 2) (push) Has been cancelled Details
tests 1 / Test Runner (22, ubuntu-latest, 1, 2) (push) Has been cancelled Details
tests 1 / Test Runner (22, ubuntu-latest, 2, 2) (push) Has been cancelled Details
tests 1 / Test Runner (24, ubuntu-latest, 1, 2) (push) Has been cancelled Details
tests 1 / Test Runner (24, ubuntu-latest, 2, 2) (push) Has been cancelled Details
tests 1 / Web Components (push) Has been cancelled Details
tests 1 / VSCode Extension (push) Has been cancelled Details
tests 1 / Installation Test ${{ matrix.os }} (macos-latest) (push) Has been cancelled Details
tests 1 / Installation Test ${{ matrix.os }} (ubuntu-latest) (push) Has been cancelled Details
tests 1 / Installation Test ${{ matrix.os }} (windows-latest) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (chromium, ubuntu-24.04) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (firefox, ubuntu-24.04) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (webkit, ubuntu-24.04) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (chromium, macos-13-large) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (chromium, macos-13-xlarge) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (chromium, macos-14-large) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (chromium, macos-14-xlarge) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (firefox, macos-13-large) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (firefox, macos-13-xlarge) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (firefox, macos-14-large) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (firefox, macos-14-xlarge) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (webkit, macos-13-large) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (webkit, macos-13-xlarge) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (webkit, macos-14-large) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (webkit, macos-14-xlarge) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (webkit, macos-15-large) (push) Has been cancelled Details
tests 2 / ${{ matrix.os }} (${{ matrix.browser }}) (webkit, macos-15-xlarge) (push) Has been cancelled Details
tests 2 / Windows (chromium) (push) Has been cancelled Details
tests 2 / Windows (firefox) (push) Has been cancelled Details
tests 2 / Windows (webkit) (push) Has been cancelled Details
tests 2 / Installation Test ${{ matrix.os }} (${{ matrix.node_version }}) (20, ubuntu-latest) (push) Has been cancelled Details
tests 2 / Installation Test ${{ matrix.os }} (${{ matrix.node_version }}) (22, ubuntu-latest) (push) Has been cancelled Details
tests 2 / Installation Test ${{ matrix.os }} (${{ matrix.node_version }}) (24, ubuntu-latest) (push) Has been cancelled Details
tests 2 / headed ${{ matrix.browser }} (${{ matrix.os }}) (chromium, macos-14-xlarge) (push) Has been cancelled Details
tests 2 / headed ${{ matrix.browser }} (${{ matrix.os }}) (chromium, ubuntu-24.04) (push) Has been cancelled Details
tests 2 / headed ${{ matrix.browser }} (${{ matrix.os }}) (chromium, windows-latest) (push) Has been cancelled Details
tests 2 / headed ${{ matrix.browser }} (${{ matrix.os }}) (firefox, macos-14-xlarge) (push) Has been cancelled Details
tests 2 / headed ${{ matrix.browser }} (${{ matrix.os }}) (firefox, ubuntu-24.04) (push) Has been cancelled Details
tests 2 / headed ${{ matrix.browser }} (${{ matrix.os }}) (firefox, windows-latest) (push) Has been cancelled Details
tests 2 / headed ${{ matrix.browser }} (${{ matrix.os }}) (webkit, macos-14-xlarge) (push) Has been cancelled Details
tests 2 / headed ${{ matrix.browser }} (${{ matrix.os }}) (webkit, ubuntu-22.04) (push) Has been cancelled Details
tests 2 / headed ${{ matrix.browser }} (${{ matrix.os }}) (webkit, ubuntu-24.04) (push) Has been cancelled Details
tests 2 / headed ${{ matrix.browser }} (${{ matrix.os }}) (webkit, windows-latest) (push) Has been cancelled Details
tests 2 / Transport (driver) (push) Has been cancelled Details
tests 2 / Transport (service) (push) Has been cancelled Details
tests 2 / Tracing ${{ matrix.browser }} ${{ matrix.channel }} (chromium, chromium-tip-of-tree, ubuntu-22.04) (push) Has been cancelled Details
tests 2 / Tracing ${{ matrix.browser }} ${{ matrix.channel }} (chromium, ubuntu-22.04) (push) Has been cancelled Details
tests 2 / Tracing ${{ matrix.browser }} ${{ matrix.channel }} (firefox, ubuntu-22.04) (push) Has been cancelled Details
tests 2 / Tracing ${{ matrix.browser }} ${{ matrix.channel }} (webkit, ubuntu-24.04) (push) Has been cancelled Details
tests 2 / Test ${{ matrix.channel }} on ${{ matrix.runs-on }} (chrome, macos-latest) (push) Has been cancelled Details
tests 2 / Test ${{ matrix.channel }} on ${{ matrix.runs-on }} (chrome, ubuntu-22.04) (push) Has been cancelled Details
tests 2 / Test ${{ matrix.channel }} on ${{ matrix.runs-on }} (chrome, windows-latest) (push) Has been cancelled Details
tests 2 / Test ${{ matrix.channel }} on ${{ matrix.runs-on }} (chrome-beta, macos-latest) (push) Has been cancelled Details
tests 2 / Test ${{ matrix.channel }} on ${{ matrix.runs-on }} (chrome-beta, ubuntu-22.04) (push) Has been cancelled Details
tests 2 / Test ${{ matrix.channel }} on ${{ matrix.runs-on }} (chrome-beta, windows-latest) (push) Has been cancelled Details
tests 2 / Test ${{ matrix.channel }} on ${{ matrix.runs-on }} (msedge, macos-latest) (push) Has been cancelled Details
tests 2 / Test ${{ matrix.channel }} on ${{ matrix.runs-on }} (msedge, ubuntu-22.04) (push) Has been cancelled Details
tests 2 / Test ${{ matrix.channel }} on ${{ matrix.runs-on }} (msedge, windows-latest) (push) Has been cancelled Details
tests 2 / Test ${{ matrix.channel }} on ${{ matrix.runs-on }} (msedge-beta, macos-latest) (push) Has been cancelled Details
tests 2 / Test ${{ matrix.channel }} on ${{ matrix.runs-on }} (msedge-beta, ubuntu-22.04) (push) Has been cancelled Details
tests 2 / Test ${{ matrix.channel }} on ${{ matrix.runs-on }} (msedge-beta, windows-latest) (push) Has been cancelled Details
tests 2 / Test ${{ matrix.channel }} on ${{ matrix.runs-on }} (msedge-dev, macos-latest) (push) Has been cancelled Details
tests 2 / Test ${{ matrix.channel }} on ${{ matrix.runs-on }} (msedge-dev, ubuntu-22.04) (push) Has been cancelled Details
tests 2 / Test ${{ matrix.channel }} on ${{ matrix.runs-on }} (msedge-dev, windows-latest) (push) Has been cancelled Details
tests 2 / Chromium tip-of-tree ${{ matrix.os }}${{ matrix.headed }} (, macos-13) (push) Has been cancelled Details
tests 2 / Chromium tip-of-tree ${{ matrix.os }}${{ matrix.headed }} (, windows-latest) (push) Has been cancelled Details
tests 2 / Chromium tip-of-tree ${{ matrix.os }}${{ matrix.headed }} (--headed, macos-13) (push) Has been cancelled Details
tests 2 / Chromium tip-of-tree ${{ matrix.os }}${{ matrix.headed }} (--headed, ubuntu-22.04) (push) Has been cancelled Details
tests 2 / Chromium tip-of-tree ${{ matrix.os }}${{ matrix.headed }} (--headed, windows-latest) (push) Has been cancelled Details
tests 2 / Chromium tip-of-tree headless-shell-${{ matrix.os }} (ubuntu-22.04) (push) Has been cancelled Details
tests 2 / Firefox Beta ${{ matrix.os }} (macos-latest) (push) Has been cancelled Details
tests 2 / Firefox Beta ${{ matrix.os }} (ubuntu-22.04) (push) Has been cancelled Details
tests 2 / Firefox Beta ${{ matrix.os }} (windows-latest) (push) Has been cancelled Details
tests 2 / build-playwright-driver (push) Has been cancelled Details
tests 2 / Test channel=chromium (macos-latest) (push) Has been cancelled Details
tests 2 / Test channel=chromium (ubuntu-latest) (push) Has been cancelled Details
tests 2 / Test channel=chromium (windows-latest) (push) Has been cancelled Details
tests Video / Video Linux (chromium, ubuntu-22.04) (push) Has been cancelled Details
tests Video / Video Linux (chromium, ubuntu-24.04) (push) Has been cancelled Details
tests Video / Video Linux (firefox, ubuntu-22.04) (push) Has been cancelled Details
tests Video / Video Linux (firefox, ubuntu-24.04) (push) Has been cancelled Details
tests Video / Video Linux (webkit, ubuntu-22.04) (push) Has been cancelled Details
tests Video / Video Linux (webkit, ubuntu-24.04) (push) Has been cancelled Details
Internal Tests / trigger (push) Has been cancelled Details
publish canary / publish canary NPM (push) Has been cancelled Details
publish canary / publish Trace Viewer to trace.playwright.dev (push) Has been cancelled Details

This commit is contained in:
Yury Semikhatsky 2025-08-01 14:13:28 -07:00 committed by GitHub
parent 33e70e3995
commit 5f7db5bab4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 31 additions and 3 deletions

View File

@ -34,6 +34,7 @@ export const defineConfig = (...configs: any[]) => {
let result = configs[0];
for (let i = 1; i < configs.length; ++i) {
const config = configs[i];
const prevProjects = result.projects;
result = {
...result,
...config,
@ -63,7 +64,7 @@ export const defineConfig = (...configs: any[]) => {
projectOverrides.set(project.name, project);
const projects = [];
for (const project of result.projects || []) {
for (const project of prevProjects || []) {
const projectOverride = projectOverrides.get(project.name);
if (projectOverride) {
projects.push({

View File

@ -661,8 +661,8 @@ test('should merge configs', async ({ runInlineTest }) => {
use: { foo: 1, bar: 2 },
expect: { timeout: 12 },
projects: [
{ name: 'B', timeout: 40, use: {} },
{ name: 'A', timeout: 50, use: {} }
{ name: 'A', timeout: 50, use: {} },
{ name: 'B', timeout: 40 },
],
webServer: [{
command: 'echo 123',
@ -680,6 +680,33 @@ test('should merge configs', async ({ runInlineTest }) => {
expect(result.exitCode).toBe(0);
});
test('should merge projects in the config', async ({ runInlineTest }) => {
const result = await runInlineTest({
'playwright.config.ts': `
import { defineConfig, expect } from '@playwright/test';
const baseConfig = defineConfig({
projects: [{ name: 'A', timeout: 5_000 }, { name: 'B', timeout: 6_000 }],
});
const derivedConfig = defineConfig(baseConfig, {
projects: [{ name: 'A', timeout: 7_000 }, { name: 'C', timeout: 8_000 }],
});
expect(derivedConfig).toEqual(expect.objectContaining({
projects: [
{ name: 'A', timeout: 7_000, use: {} },
{ name: 'B', timeout: 6_000 },
{ name: 'C', timeout: 8_000 },
],
}));
`,
'a.test.ts': `
import { test } from '@playwright/test';
test('pass', async ({}) => {});
`
});
expect(result.exitCode).toBe(0);
});
test('should merge ct configs', async ({ runInlineTest }) => {
const result = await runInlineTest({
'playwright.config.ts': `