From c1612eb4709bbe92fc6f7e606d3100ce0f8ce105 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Fri, 11 Jul 2025 14:16:15 +0900 Subject: [PATCH 1/2] test(rsc): fix `setupIsolatedFixture` on windows ci --- packages/plugin-rsc/e2e/basic.test.ts | 9 ++++++++- packages/plugin-rsc/e2e/fixture.ts | 11 +++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/plugin-rsc/e2e/basic.test.ts b/packages/plugin-rsc/e2e/basic.test.ts index 77066ce42..cc6cadd06 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 path from 'node:path' +import os from 'node:os' // TODO: parallel? // TODO: all tests don't need to be tested in all variants? @@ -107,7 +109,12 @@ test.describe(() => { // disabled by default if (process.env.TEST_ISOLATED !== 'true') return - let tmpRoot = '/tmp/test-vite-rsc' + // 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 7d99f99da..b9cf2f070 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', + ], }, }) } From 7068fbd93b59e4e29a008e865a2ec11c638840f1 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Fri, 11 Jul 2025 14:17:03 +0900 Subject: [PATCH 2/2] ci: unflag --- .github/workflows/ci-rsc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-rsc.yml b/.github/workflows/ci-rsc.yml index 19107c4da..b21b0d0b3 100644 --- a/.github/workflows/ci-rsc.yml +++ b/.github/workflows/ci-rsc.yml @@ -63,7 +63,7 @@ jobs: - run: pnpm -C packages/plugin-rsc exec playwright install ${{ matrix.browser }} - run: pnpm -C packages/plugin-rsc test-e2e-ci --project=${{ matrix.browser }} env: - TEST_ISOLATED: ${{ matrix.os != 'windows-latest' }} + TEST_ISOLATED: true - uses: actions/upload-artifact@v4 if: always() with: