diff --git a/.github/workflows/ci-rsc.yml b/.github/workflows/ci-rsc.yml index 19107c4d..15184b76 100644 --- a/.github/workflows/ci-rsc.yml +++ b/.github/workflows/ci-rsc.yml @@ -35,17 +35,19 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [windows-latest] browser: [chromium] + # os: [ubuntu-latest, macos-latest, windows-latest] + # browser: [chromium] rolldown: [false] - include: - - os: ubuntu-latest - browser: firefox - - os: macos-latest - browser: webkit - - os: ubuntu-latest - browser: chromium - rolldown: true + # include: + # - os: ubuntu-latest + # browser: firefox + # - os: macos-latest + # browser: webkit + # - os: ubuntu-latest + # browser: chromium + # rolldown: true fail-fast: false steps: - uses: actions/checkout@v4 diff --git a/packages/plugin-rsc/e2e/basic.test.ts b/packages/plugin-rsc/e2e/basic.test.ts index 77066ce4..5b70b48e 100644 --- a/packages/plugin-rsc/e2e/basic.test.ts +++ b/packages/plugin-rsc/e2e/basic.test.ts @@ -3,6 +3,8 @@ import { readFileSync } from 'node:fs' import { type Page, expect, test } from '@playwright/test' import { type Fixture, setupIsolatedFixture, useFixture } from './fixture' import { expectNoReload, testNoJs, waitForHydration } from './helper' +import os from 'node:os' +import path from 'node:path' // TODO: parallel? // TODO: all tests don't need to be tested in all variants? @@ -103,11 +105,18 @@ test.describe('build-react-compiler', () => { defineTest(f) }) -test.describe(() => { - // disabled by default - if (process.env.TEST_ISOLATED !== 'true') return +test.describe.configure({ mode: 'serial' }) - let tmpRoot = '/tmp/test-vite-rsc' +test.describe.only(() => { + // disabled by default + // if (process.env.TEST_ISOLATED !== 'true') return + + // use RUNNER_TEMP on Github Actions + // https://github.com/actions/toolkit/issues/518 + const tmpRoot = path.join( + process.env['RUNNER_TEMP'] || os.tmpdir(), + 'test-vite-rsc', + ) test.beforeAll(async () => { await setupIsolatedFixture({ src: 'examples/basic', dest: tmpRoot }) }) diff --git a/packages/plugin-rsc/e2e/fixture.ts b/packages/plugin-rsc/e2e/fixture.ts index 7d99f99d..b9cf2f07 100644 --- a/packages/plugin-rsc/e2e/fixture.ts +++ b/packages/plugin-rsc/e2e/fixture.ts @@ -153,10 +153,9 @@ export async function setupIsolatedFixture(options: { }) { // copy fixture fs.rmSync(options.dest, { recursive: true, force: true }) - fs.cpSync(options.src, options.dest, { recursive: true }) - fs.rmSync(path.join(options.dest, 'node_modules'), { + fs.cpSync(options.src, options.dest, { recursive: true, - force: true, + filter: (src) => !src.includes('node_modules'), }) // setup package.json overrides @@ -174,7 +173,11 @@ export async function setupIsolatedFixture(options: { throwOnError: true, nodeOptions: { cwd: options.dest, - stdio: process.env.TEST_DEBUG ? 'inherit' : undefined, + stdio: [ + 'ignore', + process.env.TEST_DEBUG ? 'inherit' : 'ignore', + 'inherit', + ], }, }) } diff --git a/packages/plugin-rsc/playwright.config.ts b/packages/plugin-rsc/playwright.config.ts index cea3a550..64bc3dbf 100644 --- a/packages/plugin-rsc/playwright.config.ts +++ b/packages/plugin-rsc/playwright.config.ts @@ -3,7 +3,8 @@ import { defineConfig, devices } from '@playwright/test' export default defineConfig({ testDir: 'e2e', use: { - trace: 'on-first-retry', + // trace: 'on-first-retry', + trace: 'retain-on-failure', }, expect: { toPass: { timeout: 5000 }, @@ -27,8 +28,8 @@ export default defineConfig({ }, ], workers: 1, - forbidOnly: !!process.env.CI, - retries: process.env.CI ? 2 : 0, + // forbidOnly: !!process.env.CI, + // retries: process.env.CI ? 2 : 0, reporter: ['list', process.env.CI && 'github'] .filter(Boolean) .map((name) => [name] as any),