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
7 changes: 7 additions & 0 deletions .github/workflows/web-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,10 @@ jobs:
name: ${{ matrix.name }}-playwright-report
path: ${{ matrix.name }}/playwright-report/
retention-days: 30

- uses: actions/upload-artifact@v4
if: always() && matrix.name == 'web-admin'
with:
name: web-admin-services-log
path: web-admin/playwright/logs/admin-runtime.log
retention-days: 30
19 changes: 14 additions & 5 deletions web-admin/tests/setup/setup.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { chromium, expect } from "@playwright/test";
import {
execAsync,
spawnAndMatch,
} from "@rilldata/web-common/tests/utils/spawn";
import axios from "axios";
import { spawn } from "child_process";
import dotenv from "dotenv";
import { openSync } from "fs";
import { mkdir } from "fs/promises";
import path from "path";
import { fileURLToPath } from "url";
import { writeFileEnsuringDir } from "../utils/fs";
import {
execAsync,
spawnAndMatch,
} from "@rilldata/web-common/tests/utils/spawn";
import type { StorageState } from "../utils/storage-state";
import { test as setup } from "./base";
import {
Expand Down Expand Up @@ -61,6 +63,11 @@ setup.describe("global setup", () => {
);
}

// Setup a log file to capture the output of the admin and runtime services
await mkdir("playwright/logs", { recursive: true });
const logPath = path.resolve("playwright/logs/admin-runtime.log");
const logFd = openSync(logPath, "w");

// Start the admin and runtime services in a detached background process.
// A detached process ensures they are not cleaned up when this setup project completes.
// However, we need to be sure to clean-up the processes manually in the teardown project.
Expand All @@ -69,10 +76,12 @@ setup.describe("global setup", () => {
["devtool", "start", "e2e", "--only", "admin,runtime"],
{
detached: true,
stdio: "ignore",
stdio: ["ignore", logFd, logFd],
cwd: repoRoot,
},
);
child.unref();

// Write the pid to a file, so I can kill it later
if (child.pid) {
writeFileEnsuringDir(
Expand Down
Loading