Enhance internal payment handling and e2e testing setup

This commit is contained in:
Marshal
2026-08-02 18:39:17 +00:00
parent ff772fddef
commit 930e39c4fc
10 changed files with 210 additions and 16 deletions

View File

@@ -16,7 +16,7 @@
*/
import { execFileSync, spawnSync } from "node:child_process";
import { generateKeyPairSync } from "node:crypto";
import { createHash, generateKeyPairSync } from "node:crypto";
import { existsSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { createServer } from "node:net";
import { dirname, join, resolve } from "node:path";
@@ -25,7 +25,17 @@ import { fileURLToPath } from "node:url";
const e2eDir = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const repoRoot = resolve(e2eDir, "..", "..");
const stateFile = join(e2eDir, ".e2e-ports.json");
const composeBase = ["compose", "-f", join(repoRoot, "docker-compose.e2e.yaml")];
// Per-checkout compose project: parallel checkouts on one docker daemon
// otherwise share the yaml's fixed `name:` and recreate/kill each other's
// containers mid-run.
const projectName = `edr-freight-e2e-${createHash("sha1").update(repoRoot).digest("hex").slice(0, 6)}`;
const composeBase = [
"compose",
"-p",
projectName,
"-f",
join(repoRoot, "docker-compose.e2e.yaml"),
];
const DEFAULT_PORTS = {
E2E_API_PORT: 3101,