Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-rsc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 8 additions & 1 deletion packages/plugin-rsc/e2e/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -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 })
})
Expand Down
11 changes: 7 additions & 4 deletions packages/plugin-rsc/e2e/fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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',
],
},
})
}
Expand Down
Loading