Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
019fb1a
test: run the capture journeys as integration tests against the playg…
Upd4ting Nov 19, 2026
aabf814
ci: run the journey integration tests and build the playground with e…
Upd4ting Nov 19, 2026
f67d94d
test(package): drop the package journeys that tests/package.test.ts a…
Upd4ting Nov 19, 2026
abe6c6f
test(logs): run the logs journeys as integration tests
Upd4ting Nov 19, 2026
c72a86e
test(overview): run the overview journeys as integration tests
Upd4ting Nov 19, 2026
b3e6289
Merge branch 't3/8141ffd0' into test/wdf26acfc-84-port-inventory
Upd4ting Nov 19, 2026
ec2ab01
test(access): run the access journeys as integration tests
Upd4ting Nov 19, 2026
ebdc069
test(tester): run the tester token journey as an integration test
Upd4ting Nov 19, 2026
df8a7c3
test(routes): run the routes contract journey as an integration test
Upd4ting Nov 19, 2026
804e478
test(capture): run the capture redaction journeys as integration tests
Upd4ting Nov 19, 2026
eca0225
Merge branch 't3/bcfdab2f' into test/wdf26acfc-84-port-inventory
Upd4ting Nov 19, 2026
14637ec
test(e2e): tag the access redirect journey @smoke in place of the por…
Upd4ting Nov 19, 2026
168b7f5
test(automation): run the automation, retention and settings journeys…
Upd4ting Nov 19, 2026
90decc3
Merge branch 't3/957aeb7d' into test/wdf26acfc-84-port-inventory
Upd4ting Nov 19, 2026
a08e6b7
test: let knip read the journey tests and name each journey's databas…
Upd4ting Nov 19, 2026
90a0cd6
test(e2e): drop the journey helpers the ported journeys alone used
Upd4ting Nov 19, 2026
4aec4d6
ci: start the checks on the ready pull request
Upd4ting Nov 19, 2026
a3623e5
build: type-check the playground's declaration files so e2e:build pas…
Upd4ting Nov 19, 2026
50eb0d5
fix(test): read only the restarted backend's log, and build the front…
Upd4ting Nov 19, 2026
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
3 changes: 1 addition & 2 deletions .agents/skills/verify-dms-api/playground/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"useDefineForClassFields": true,
"types": ["node"],
"skipLibCheck": true
"types": ["node"]
},
"include": ["./src/**/*.ts"]
}
34 changes: 31 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,36 @@ jobs:
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm build

# The journeys that call the API or run commands, as Vitest integration
# tests against backends of the verification playground on one MongoDB.
journeys:
needs: select
if: needs.select.outputs.run == 'true'
runs-on: ubuntu-latest
timeout-minutes: 20
env:
TZ: UTC
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- run: corepack enable
- run: pnpm install --frozen-lockfile --ignore-scripts
- uses: actions/cache@v4
with:
path: ~/.cache/mongodb-binaries
key: journeys-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm e2e:build
- run: pnpm test:journeys

# The journeys of e2e/ as a Playwright suite: the @smoke ones on a pull
# request or a push, every journey in two shards in the merge queue, the
# nightly run, a manual run and a pull request labelled ci:full, nothing on
# a draft. Its global setup prepares and starts one dms-control run.
# a draft. `pnpm e2e:build` builds the module and the playground, then the
# kit's global setup starts one run of them.
e2e:
needs: select
if: needs.select.outputs.e2e != 'none'
Expand All @@ -125,6 +151,7 @@ jobs:
shard: ${{ fromJSON(needs.select.outputs.e2e == 'all' && '[1, 2]' || '[1]') }}
env:
E2E: ${{ needs.select.outputs.e2e }}
DMS_E2E_PREBUILT: "1"
TZ: UTC
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -154,6 +181,7 @@ jobs:
fi
echo "::warning::Chromium's system packages did not install: installing the browser alone"
pnpm exec playwright install --only-shell chromium
- run: pnpm e2e:build
- if: env.E2E == 'smoke'
run: pnpm e2e --grep @smoke
- if: env.E2E == 'all'
Expand Down Expand Up @@ -214,12 +242,12 @@ jobs:
# it, so merge-when-green cannot merge on the draft run.
ubuntu:
if: always()
needs: [select, ci, build, formal-route-statistics, e2e]
needs: [select, ci, build, formal-route-statistics, journeys, e2e]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- if: >-
needs.select.result != 'success' || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || needs.ci.result == 'skipped' || (needs.select.outputs.run == 'true' && (needs.build.result == 'skipped' || needs.formal-route-statistics.result == 'skipped')) || (needs.select.outputs.e2e != 'none' && needs.e2e.result == 'skipped')
needs.select.result != 'success' || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || needs.ci.result == 'skipped' || (needs.select.outputs.run == 'true' && (needs.build.result == 'skipped' || needs.formal-route-statistics.result == 'skipped' || needs.journeys.result == 'skipped')) || (needs.select.outputs.e2e != 'none' && needs.e2e.result == 'skipped')
run: exit 1
- if: needs.select.outputs.tier == 'draft'
run: |
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,8 @@ e2e/playwright-report
e2e/test-results
e2e/blob-report
e2e/blob-reports

# What a backend of the verification playground writes when it starts
.agents/skills/verify-dms-api/playground/antelope-lock
.agents/skills/verify-dms-api/playground/.codex
.agents/skills/verify-dms-api/playground/.mcp.json
64 changes: 0 additions & 64 deletions e2e/api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,6 @@ export const FIXTURE_ROUTES = 23;
/** The console's HTTP API, which the dashboard calls. */
export const MONITOR = "/api/monitoring";

/**
* The log file of the journey's backend: dms-control names it after the
* journey's database, so each journey's backend writes its own.
*
* @param {Ctx} ctx The journey
* @returns {string} Its path
*/
export function backendLog(ctx) {
const backend = ctx.state.processes.find((entry) => entry.name === "backend");
if (!backend) throw new Error("the run has no backend");
return backend.log;
}

/**
* @param {unknown} value Anything a JSON answer holds
* @returns {value is Row} Whether it is an object
Expand Down Expand Up @@ -272,18 +259,6 @@ export async function raw(ctx, label, request) {
return { folder, status: response.status, headers: received, bytes, text: body, json: parseJson(body) };
}

/**
* Records checks against the evidence folder `raw` made.
*
* @param {Ctx} ctx The journey
* @param {Raw} answer The answer
* @param {Check[]} checks The checks
* @returns {boolean} Whether they all passed
*/
export function recordRaw(ctx, answer, checks) {
return ctx.record(answer.folder, checks);
}

/**
* @param {Uint8Array} bytes Some bytes
* @returns {string} Their SHA-256, hex
Expand All @@ -305,33 +280,6 @@ export function saveSettings(ctx, label, values, as) {
return mon(ctx, `settings: ${label}`, "/settings", { method: "POST", body: values, as });
}

/**
* Sends one call to the project's routes with the headers, query and body given, and reads the request log it made.
*
* @param {Ctx} ctx The journey
* @param {string} label What the call is
* @param {{ method?: string, path: string, headers?: Record<string, string>, body?: string }} request What to send
* @returns {Promise<{ status: number, log: Row }>} The status answered and the captured request in full
*/
export async function sendAndRead(ctx, label, request) {
const sent = await raw(ctx, label, request);
const marker = `${request.method ?? "GET"} ${request.path.split("?")[0]}`;
const deadline = Date.now() + 15_000;
/** @type {Row} */
let found = {};
while (Date.now() < deadline) {
const listed = await mon(ctx, `${label}: find it`, "/logs?limit=50");
const row = list(listed.body, "results").find((entry) => entry.requestId === request.headers?.["x-request-id"] || (text(entry, "path") === request.path.split("?")[0] && `${text(entry, "method")} ${text(entry, "path")}` === marker));
if (row) {
const detail = await mon(ctx, `${label}: open it`, `/logs/${text(row, "_id")}`);
found = isRow(detail.body) ? detail.body : {};
break;
}
await new Promise((resolve) => setTimeout(resolve, 300));
}
return { status: sent.status ?? 0, log: found };
}

/**
* A check that a radio, switch or toggle button is on (or off), once it shows.
*
Expand Down Expand Up @@ -425,15 +373,3 @@ export async function withEnv(ctx, env, body) {
await ctx.restartBackend();
}
}

/**
* Runs an automation action the module registered with the stand-in provider.
*
* @param {Ctx} ctx The journey
* @param {string} id The action's id
* @param {unknown} input Its input
* @returns {Promise<Answer>} The action's output
*/
export function runAction(ctx, id, input) {
return ctx.api(`run ${id} ${JSON.stringify(input).slice(0, 60)}`, { method: "POST", path: `/dms/verify-api/nodes/action/${id}`, body: input, as: "anon" });
}
97 changes: 2 additions & 95 deletions e2e/journeys/access.mjs
Original file line number Diff line number Diff line change
@@ -1,108 +1,15 @@
import { guarded } from "../guard.mjs";
import { check, isText, list, member, mon, raw, same, saveSettings, settled, text, traffic, openPage } from "../api.mjs";
import { check, list, member, mon, raw, same, saveSettings, settled, text, traffic, openPage } from "../api.mjs";

/** @typedef {import("../api.mjs").Ctx} Ctx */
/** @typedef {import("../api.mjs").Row} Row */

const TESTER_HEADER = "x-antelopejs-api-source";

/** Every route of the console: method and path under /api/monitoring. */
const ROUTES = [
["GET", "/overview/health"], ["GET", "/overview/traffic"], ["GET", "/overview/classes"], ["GET", "/overview/error-share"], ["GET", "/overview/attention"], ["GET", "/overview/slowest"], ["GET", "/overview/activity"],
["GET", "/logs"], ["GET", "/logs/recent"], ["GET", "/logs/routes?route=GET%20%2Ffx%2Fok"], ["GET", "/logs/tester?requestId=x"], ["GET", "/logs/live"],
["GET", "/logs/missing"], ["GET", "/logs/recent/missing"], ["GET", "/logs/tester/missing"], ["GET", "/logs/routes/missing"],
["GET", "/routes/list"], ["GET", "/routes/detail?route=GET%20%2Ffx%2Fok"], ["GET", "/routes/statistics/activity?route=GET%20%2Ffx%2Fok"], ["GET", "/routes/statistics/summary?route=GET%20%2Ffx%2Fok"],
["GET", "/routes/statistics/status?route=GET%20%2Ffx%2Fok"], ["GET", "/routes/statistics/latency-chart?route=GET%20%2Ffx%2Fok"], ["GET", "/routes/statistics/errors?route=GET%20%2Ffx%2Fok"],
["GET", "/settings"], ["POST", "/settings"], ["GET", "/settings/retention-impact?field=requestLogRetentionDays&days=30"], ["GET", "/settings/summary"], ["GET", "/tester/source"],
];

/** The permission each route of the console names in a refusal: one block, one id. */
const BLOCK_OF = new Map([
["GET /overview/health", "modules.api.monitor.overview.health"],
["GET /overview/traffic", "modules.api.monitor.overview.dashboard.traffic.chart"],
["GET /overview/classes", "modules.api.monitor.overview.dashboard.traffic.classes"],
["GET /overview/error-share", "modules.api.monitor.overview.dashboard.health.errorShare"],
["GET /overview/attention", "modules.api.monitor.overview.dashboard.health.attention"],
["GET /overview/slowest", "modules.api.monitor.overview.dashboard.health.slowest"],
["GET /overview/activity", "modules.api.monitor.overview.dashboard.recent.activity"],
["GET /logs", "modules.api.monitor.logs.requests"],
["GET /logs/recent", "modules.api.monitor.overview.dashboard.recent.requests.table"],
["GET /logs/routes", "modules.api.explore.routes.explorer.tabs.statistics.recent.requests.table"],
["GET /logs/tester", "modules.api.explore.routes.explorer.tabs.tester"],
["GET /logs/live", "modules.api.monitor.logs.live"],
["GET /logs/missing", "modules.api.monitor.logs.requests"],
["GET /logs/recent/missing", "modules.api.monitor.overview.dashboard.recent.requests.table"],
["GET /logs/tester/missing", "modules.api.explore.routes.explorer.tabs.tester"],
["GET /logs/routes/missing", "modules.api.explore.routes.explorer.tabs.statistics.recent.requests.table"],
["GET /routes/list", "modules.api.explore.routes.explorer.tree"],
["GET /routes/detail", "modules.api.explore.routes.explorer"],
["GET /routes/statistics/activity", "modules.api.explore.routes.explorer.tabs.statistics"],
["GET /routes/statistics/summary", "modules.api.explore.routes.explorer.tabs.statistics.grid.summary.summary"],
["GET /routes/statistics/status", "modules.api.explore.routes.explorer.tabs.statistics.grid.charts.status"],
["GET /routes/statistics/latency-chart", "modules.api.explore.routes.explorer.tabs.statistics.grid.charts.latency"],
["GET /routes/statistics/errors", "modules.api.explore.routes.explorer.tabs.statistics.grid.detail.errors"],
["GET /settings", "modules.api.configure.settings.form"],
["POST /settings", "modules.api.configure.settings.form"],
["GET /settings/retention-impact", "modules.api.configure.settings.form"],
["GET /tester/source", "modules.api.explore.routes.explorer.tabs.tester"],
]);

/**
* @param {Ctx} ctx The journey
* @param {string} as The account
* @returns {Promise<{ route: string, status: number | null, message: string }[]>} What each route answered
*/
async function sweep(ctx, as) {
const seen = [];
for (const [method, path] of ROUTES) {
const answer = await mon(ctx, `${method} ${path} as ${as}`, path, { method, as, body: method === "POST" ? {} : undefined });
const body = answer.body;
seen.push({ route: `${method} ${path.split("?")[0]}`, status: answer.status, message: isText(body) ? body : text(body, "message") || text(body, "error") });
}
return seen;
}

export const journeys = guarded([
{
id: "every-console-route-needs-a-session-and-the-block-it-serves",
tag: "@smoke",
title: "every route of the console answers 401 without a session and 403 naming the missing permission to a member whose role holds none, while the owner passes every one",
entryPoint: "every /api/monitoring route",
async run(/** @type {Ctx} */ ctx) {
await traffic(ctx, "a request to read", [{ path: "/fx/ok", count: 1 }]);
await member(ctx, "plain", []);
const anonymous = await sweep(ctx, "anon");
const plain = await sweep(ctx, "plain");
const owner = await sweep(ctx, "admin");
await ctx.verify("without a session", anonymous.map((entry) => same(`${entry.route} is 401`, entry.status, 401)));
await ctx.verify("a member with no permission", plain.map((entry) => same(`${entry.route} refuses with its own block's permission`, entry.message, entry.route === "GET /settings/summary" ? "Owner-only" : `Forbidden: missing permission ${BLOCK_OF.get(entry.route)}`)));
await ctx.verify("the owner", owner.map((entry) => check(`${entry.route} passes the guard`, entry.status !== 401 && entry.status !== 403, entry)));
},
},
{
id: "the-console-is-the-owners-and-a-role-holding-a-block-is-refused",
title: "a role holding the Request logs table's permission, or the Tester's, is still refused on every route of the console, while the owner opens both",
entryPoint: "GET /api/monitoring/logs and /api/monitoring/tester/source as members",
async run(/** @type {Ctx} */ ctx) {
await traffic(ctx, "a request to read", [{ path: "/fx/ok", count: 1 }]);
await member(ctx, "plain", []);
const refused = await sweep(ctx, "plain");
const needed = (/** @type {string} */ route) => /missing permission ([\w.-]+)/.exec(refused.find((entry) => entry.route === route)?.message ?? "")?.[1] ?? "";
const logsPermission = needed("GET /logs");
const testerPermission = needed("GET /tester/source");
await ctx.verify("the permissions the refusals name", [check("the logs table has its own permission", logsPermission.startsWith("modules.api."), logsPermission), check("the Tester has its own permission", testerPermission.startsWith("modules.api.") && testerPermission !== logsPermission, testerPermission)]);
await member(ctx, "reader", [logsPermission]);
await member(ctx, "tester", [testerPermission]);
const reader = await sweep(ctx, "reader");
const tester = await sweep(ctx, "tester");
const owner = await sweep(ctx, "admin");
await ctx.verify("the reader", reader.map((entry) => check(`${entry.route} is refused`, entry.status === 403, entry)));
await ctx.verify("the tester", tester.map((entry) => check(`${entry.route} is refused`, entry.status === 403, entry)));
await ctx.verify("the owner", ["GET /logs", "GET /tester/source"].map((route) => check(`${route} opens`, owner.find((entry) => entry.route === route)?.status === 200, owner.find((entry) => entry.route === route))));
},
},
{
id: "a-member-without-the-modules-permissions-is-sent-to-their-settings",
tag: "@smoke",
title: "every page of the console sends a member whose role holds none of its permissions to their own Settings page, where none of the console's headings show, while the owner stays on the page",
entryPoint: "/modules/api, /modules/api/overview, /modules/api/logs, /modules/api/routes and /modules/api/settings",
async run(/** @type {Ctx} */ ctx) {
Expand Down
Loading
Loading