Skip to content

Commit b98bc08

Browse files
committed
build: Add codecov test analytics for playwright tests
1 parent ae4451d commit b98bc08

File tree

8 files changed

+30
-5
lines changed

8 files changed

+30
-5
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,13 @@ jobs:
610610
overwrite: true
611611
retention-days: 7
612612

613+
- name: Upload test results to Codecov
614+
if: ${{ !cancelled() }}
615+
uses: codecov/test-results-action@v1
616+
with:
617+
directory: dev-packages/browser-integration-tests
618+
token: ${{ secrets.CODECOV_TOKEN }}
619+
613620
job_browser_loader_tests:
614621
name: PW ${{ matrix.bundle }} Tests
615622
needs: [job_get_metadata, job_build]
@@ -653,6 +660,7 @@ jobs:
653660
run: |
654661
cd dev-packages/browser-integration-tests
655662
yarn test:loader
663+
656664
- name: Upload Playwright Traces
657665
uses: actions/upload-artifact@v4
658666
if: failure()
@@ -662,6 +670,13 @@ jobs:
662670
overwrite: true
663671
retention-days: 7
664672

673+
- name: Upload test results to Codecov
674+
if: ${{ !cancelled() }}
675+
uses: codecov/test-results-action@v1
676+
with:
677+
directory: dev-packages/browser-integration-tests
678+
token: ${{ secrets.CODECOV_TOKEN }}
679+
665680
job_check_for_faulty_dts:
666681
name: Check for faulty .d.ts files
667682
needs: [job_get_metadata, job_build]
@@ -1013,6 +1028,13 @@ jobs:
10131028
overwrite: true
10141029
retention-days: 7
10151030

1031+
- name: Upload test results to Codecov
1032+
if: ${{ !cancelled() }}
1033+
uses: codecov/test-results-action@v1
1034+
with:
1035+
directory: dev-packages/e2e-tests
1036+
token: ${{ secrets.CODECOV_TOKEN }}
1037+
10161038
job_optional_e2e_tests:
10171039
name: E2E ${{ matrix.label || matrix.test-application }} Test
10181040
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks

dev-packages/browser-integration-tests/playwright.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const config: PlaywrightTestConfig = {
3030
},
3131
],
3232

33+
reporter: process.env.CI ? [['line'], ['junit', { outputFile: 'results.junit.xml' }]] : 'list',
34+
3335
globalSetup: require.resolve('./playwright.setup.ts'),
3436
globalTeardown: require.resolve('./playwright.teardown.ts'),
3537
};

dev-packages/e2e-tests/test-applications/ember-classic/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const config: PlaywrightTestConfig = {
3535
forbidOnly: !!process.env.CI,
3636
retries: 0,
3737
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
38-
reporter: 'list',
38+
reporter: process.env.CI ? [['line'], ['junit', { outputFile: 'results.junit.xml' }]] : 'list',
3939
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
4040
use: {
4141
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */

dev-packages/e2e-tests/test-applications/ember-embroider/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const config: PlaywrightTestConfig = {
3535
forbidOnly: !!process.env.CI,
3636
retries: 0,
3737
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
38-
reporter: 'list',
38+
reporter: process.env.CI ? [['line'], ['junit', { outputFile: 'results.junit.xml' }]] : 'list',
3939
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
4040
use: {
4141
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */

dev-packages/e2e-tests/test-applications/node-express-send-to-sentry/playwright.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const config = {
2323
/* Retry on CI only */
2424
retries: 0,
2525
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
26-
reporter: 'list',
26+
reporter: process.env.CI ? [['line'], ['junit', { outputFile: 'results.junit.xml' }]] : 'list',
2727
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2828
use: {
2929
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */

dev-packages/e2e-tests/test-applications/react-send-to-sentry/playwright.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const config = {
2323
/* Opt out of parallel tests on CI. */
2424
workers: 1,
2525
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
26-
reporter: 'list',
26+
reporter: process.env.CI ? [['line'], ['junit', { outputFile: 'results.junit.xml' }]] : 'list',
2727
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2828
use: {
2929
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */

dev-packages/test-utils/src/playwright-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function getPlaywrightConfig(
3737
/* In dev mode some apps are flaky, so we allow retry there... */
3838
retries: testEnv === 'development' ? 3 : 0,
3939
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
40-
reporter: process.env.CI ? 'line' : 'list',
40+
reporter: process.env.CI ? [['line'], ['junit', { outputFile: 'results.junit.xml' }]] : 'list',
4141
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
4242
use: {
4343
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */

packages/remix/playwright.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const config: PlaywrightTestConfig = {
88
},
99
// Run tests inside of a single file in parallel
1010
fullyParallel: true,
11+
reporter: process.env.CI ? [['line'], ['junit', { outputFile: 'results.junit.xml' }]] : 'list',
1112
// Use 3 workers on CI, else use defaults (based on available CPU cores)
1213
// Note that 3 is a random number selected to work well with our CI setup
1314
workers: process.env.CI ? 3 : undefined,

0 commit comments

Comments
 (0)