mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-18 19:30:27 +08:00
Pre-compile the app bundle and run tests against that
Speed difference is 3min vs 30sec to run all tests.
This commit is contained in:
@@ -84,10 +84,12 @@ const config: PlaywrightTestConfig = {
|
||||
|
||||
webServer: [
|
||||
{
|
||||
command: "npm run start -- --strictPort --port 3001",
|
||||
// Use preview server (pre-built app) for main server - much faster startup
|
||||
command: "npm run serve -- --strictPort --port 3001",
|
||||
port: 3001,
|
||||
},
|
||||
// Required by test tests/e2e/repo/commits.spec.ts "loading more commits, adds them to the commits list"
|
||||
// Keep dev server here since it needs custom runtime config
|
||||
{
|
||||
command: "npm run start -- --strictPort --port 3002",
|
||||
port: 3002,
|
||||
|
||||
@@ -53,6 +53,13 @@ export default async function globalSetup(): Promise<() => void> {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Build the app once before running tests to avoid compilation
|
||||
// overhead on each worker.
|
||||
console.log("Building the app for tests...");
|
||||
const { execa: exec } = await import("execa");
|
||||
await exec("npm", ["run", "build"], { stdio: "inherit" });
|
||||
console.log("Build complete");
|
||||
|
||||
if (!process.env.SKIP_FIXTURE_CREATION) {
|
||||
console.log(
|
||||
"Recreating static fixtures. Set SKIP_FIXTURE_CREATION to skip this",
|
||||
|
||||
Reference in New Issue
Block a user