From dfa4ab8726c417a602d028e590b39d8e38a8b23c Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Fri, 4 Oct 2024 10:06:56 +0200 Subject: [PATCH] test: speed up only-changed CT test (#32947) --- tests/playwright-test/only-changed.spec.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/playwright-test/only-changed.spec.ts b/tests/playwright-test/only-changed.spec.ts index b632ba262ac54..5a9c6ee121a6d 100644 --- a/tests/playwright-test/only-changed.spec.ts +++ b/tests/playwright-test/only-changed.spec.ts @@ -21,7 +21,7 @@ const test = baseTest.extend<{ git(command: string): void }>({ git: async ({}, use, testInfo) => { const baseDir = testInfo.outputPath(); - const git = (command: string) => execSync(`git ${command}`, { cwd: baseDir }); + const git = (command: string) => execSync(`git ${command}`, { cwd: baseDir, stdio: process.env.PWTEST_DEBUG ? 'inherit' : 'ignore' }); git(`init --initial-branch=main`); git(`config --local user.name "Robert Botman"`); @@ -204,7 +204,7 @@ test('should suppport component tests', async ({ runInlineTest, git, writeFiles test('pass', async ({ mount }) => { const component = await mount(); - await expect(component).toHaveText('Button'); + await expect(component).toHaveText('Button', { timeout: 1000 }); }); `, 'src/button2.test.tsx': ` @@ -213,7 +213,7 @@ test('should suppport component tests', async ({ runInlineTest, git, writeFiles test('pass', async ({ mount }) => { const component = await mount(); - await expect(component).toHaveText('Button'); + await expect(component).toHaveText('Button', { timeout: 1000 }); }); `, 'src/button3.test.tsx': ` @@ -229,7 +229,7 @@ test('should suppport component tests', async ({ runInlineTest, git, writeFiles git(`add .`); git(`commit -m "init"`); - const result = await runInlineTest({}, { 'workers': 1, 'only-changed': true }); + const result = await runInlineTest({}, { 'only-changed': true }); expect(result.exitCode).toBe(0); expect(result.passed).toBe(0); @@ -242,10 +242,10 @@ test('should suppport component tests', async ({ runInlineTest, git, writeFiles test('pass', async ({ mount }) => { const component = await mount(); - await expect(component).toHaveText('Different Button'); + await expect(component).toHaveText('Different Button', { timeout: 1000 }); }); ` - }, { 'workers': 1, 'only-changed': true }); + }, { 'only-changed': true }); expect(result2.exitCode).toBe(1); expect(result2.failed).toBe(1); @@ -260,7 +260,7 @@ test('should suppport component tests', async ({ runInlineTest, git, writeFiles 'src/contents.ts': ` export const content = 'Changed Content'; ` - }, { 'workers': 1, 'only-changed': true }); + }, { 'only-changed': true }); expect(result3.exitCode).toBe(1); expect(result3.failed).toBe(2);