Close remaining IAM JSON doors and re-walk the lab.
Some checks are pending
offline / test (push) Waiting to run

CS/sales/accounting/staff list endpoints and sales pricing writes
require IAM; fleet service env sets STAFF_AUTH=1. Department tests
use a private books file so lab NATS does not leak into them.
This commit is contained in:
George Lambert 2026-09-11 19:08:20 -04:00
parent c32b65038a
commit 2bb3884a1b
14 changed files with 37 additions and 8 deletions

View file

@ -1,6 +1,8 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { spawn } from 'node:child_process';
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
@ -12,14 +14,15 @@ test('web plane can read statement after authz, cannot skip authz', async () =>
const authzPort = 18021;
const booksPort = 18022;
const webPort = 18023;
const booksFile = path.join(os.tmpdir(), `web-books-${process.pid}.json`);
const authz = spawn(process.execPath, ['src/server.js'], {
cwd: authzRoot,
env: { ...process.env, PORT: String(authzPort) },
env: { ...process.env, PORT: String(authzPort), NATS_URL: '' },
stdio: ['ignore', 'pipe', 'pipe'],
});
const books = spawn(process.execPath, ['src/server.js'], {
cwd: booksRoot,
env: { ...process.env, PORT: String(booksPort) },
env: { ...process.env, PORT: String(booksPort), BOOKS_PATH: booksFile, NATS_URL: '' },
stdio: ['ignore', 'pipe', 'pipe'],
});
const web = spawn(process.execPath, ['src/server.js'], {
@ -29,6 +32,7 @@ test('web plane can read statement after authz, cannot skip authz', async () =>
PORT: String(webPort),
AUTHZ_URL: `http://127.0.0.1:${authzPort}`,
ACCOUNT_BALANCE_URL: `http://127.0.0.1:${booksPort}`,
NATS_URL: '',
},
stdio: ['ignore', 'pipe', 'pipe'],
});
@ -51,5 +55,6 @@ test('web plane can read statement after authz, cannot skip authz', async () =>
web.kill('SIGTERM');
books.kill('SIGTERM');
authz.kill('SIGTERM');
fs.rmSync(booksFile, { force: true });
}
});