feat: complete REA remediation program
This commit is contained in:
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
process.stderr.write("fixture MCP startup exit\n");
|
||||
process.exitCode = 23;
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
import { writeFile } from "node:fs/promises";
|
||||
|
||||
if (process.env.REA_MCP_DOCTOR_PID_PATH !== undefined)
|
||||
await writeFile(process.env.REA_MCP_DOCTOR_PID_PATH, String(process.pid));
|
||||
setInterval(() => undefined, 1_000);
|
||||
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
import { mkdtemp, realpath, rm } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
|
||||
import { onTestFinished } from "vitest";
|
||||
|
||||
const TEMPORARY_PREFIX = /^[A-Za-z0-9][A-Za-z0-9._-]*-$/u;
|
||||
|
||||
/** Creates a canonical temporary directory owned by the current Vitest case. */
|
||||
export const createTestTempDirectory = async (
|
||||
prefix: string,
|
||||
): Promise<string> => {
|
||||
if (!TEMPORARY_PREFIX.test(prefix) || prefix.length > 80) {
|
||||
throw new TypeError(
|
||||
"Test temporary directory prefixes must be safe basenames ending in '-'",
|
||||
);
|
||||
}
|
||||
|
||||
const canonicalTemporaryRoot = await realpath(tmpdir());
|
||||
const created = await mkdtemp(join(canonicalTemporaryRoot, prefix));
|
||||
const canonicalDirectory = await realpath(created);
|
||||
|
||||
onTestFinished(async () => {
|
||||
await rm(canonicalDirectory, {
|
||||
recursive: true,
|
||||
force: true,
|
||||
maxRetries: 3,
|
||||
retryDelay: 25,
|
||||
});
|
||||
});
|
||||
|
||||
return canonicalDirectory;
|
||||
};
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
fixture = str(Path(__file__).resolve())
|
||||
subprocess.Popen(
|
||||
[sys.executable, "-c", "import time; time.sleep(60)", fixture],
|
||||
)
|
||||
while True:
|
||||
time.sleep(60)
|
||||
Reference in New Issue
Block a user