Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
Pre-compile the app bundle and run tests against that
Rūdolfs Ošiņš committed 2 months ago
commit b251040fa33c11a880050e87a0461053ab4e6aaa
parent dd24361
2 files changed +10 -1
modified playwright.config.ts
@@ -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,
modified tests/support/globalSetup.ts
@@ -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",