forked from phenom/healer-man
Release Healer Man 0.1.47
This commit is contained in:
1 parent
9ff574ac0b
commit
2162039b49
24 files changed
+486
-55
No files matched your search
@@ -8,6 +8,7 @@ import test from "node:test";
|
||||
import {
|
||||
balanceLabCommand,
|
||||
createBalanceLabJobService,
|
||||
inspectBalanceLabRuntime,
|
||||
normalizeBalanceLabJobSpec,
|
||||
} from "./balance-lab-jobs.mjs";
|
||||
|
||||
@@ -50,6 +51,39 @@ test("builds an argument-array command without a shell", () => {
|
||||
assert.equal(command.cwd, path.resolve("C:/app"));
|
||||
});
|
||||
|
||||
test("detects available and missing Python 3 runtimes", () => {
|
||||
const available = inspectBalanceLabRuntime("python3", () => ({
|
||||
status: 0, stdout: "Python 3.12.8\n", stderr: "",
|
||||
}));
|
||||
assert.equal(available.available, true);
|
||||
assert.equal(available.version, "Python 3.12.8");
|
||||
const missing = inspectBalanceLabRuntime("python3", () => ({
|
||||
status: 127, stdout: "", stderr: "python3: not found",
|
||||
}));
|
||||
assert.equal(missing.available, false);
|
||||
assert.match(missing.error, /could not execute python3/i);
|
||||
});
|
||||
|
||||
test("rejects a job before queueing when the server runtime is unavailable", () => {
|
||||
const directory = mkdtempSync(path.join(os.tmpdir(), "healer-man-balance-runtime-"));
|
||||
try {
|
||||
const service = createBalanceLabJobService({
|
||||
dataDir: directory,
|
||||
projectRoot: directory,
|
||||
runtimeProbe: () => ({ available: false, executable: "python3", version: null, error: "python3 is missing." }),
|
||||
});
|
||||
assert.throws(() => service.start({
|
||||
source: "wow", level: 40, partyConfigurations: 1, simulationsPerParty: 1,
|
||||
durationSeconds: 5, partySeed: 1, bossCategory: "all", bossKeys: ["gundrak/entry-29932"],
|
||||
}, { username: "Phenom" }), /Install Python 3 in the server container/);
|
||||
assert.equal(service.list().length, 0);
|
||||
assert.equal(service.runtime().available, false);
|
||||
service.close();
|
||||
} finally {
|
||||
rmSync(directory, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
test("queues a job, reports progress, and exposes only allow-listed artifacts", async () => {
|
||||
const directory = mkdtempSync(path.join(os.tmpdir(), "healer-man-balance-job-"));
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user