Update Healer Man server
This commit is contained in:
1 parent
1fedb9368d
commit
cc3b2fa4d5
27 files changed
+1988
-83
No files matched your search
@@ -378,6 +378,8 @@ export function createBalanceLabJobService(options = {}) {
|
||||
function appendLog(job, line) {
|
||||
job.logTail.push(line.slice(0, 1_000));
|
||||
if (job.logTail.length > 80) job.logTail.splice(0, job.logTail.length - 80);
|
||||
const planned = /^Running\s+[\d,]+\s+simulations\s+\((\d+)\s+parties\s+x/i.exec(line);
|
||||
if (planned) job.progress.partiesTotal = Number(planned[1]);
|
||||
const party = /^Party\s+(\d+)\/(\d+):/i.exec(line);
|
||||
if (party) {
|
||||
job.progress.party = Number(party[1]);
|
||||
|
||||
@@ -144,6 +144,7 @@ test("queues a job, reports progress, and exposes only allow-listed artifacts",
|
||||
setImmediate(() => {
|
||||
mkdirSync(outputDir, { recursive: true });
|
||||
writeFileSync(path.join(outputDir, "suite-report.json"), "{}\n");
|
||||
child.stdout.write("Running 1 simulations (1 parties x 1 bosses x 1 runs per party/boss)...\n");
|
||||
child.stdout.write("Party 1/1: wow-party-001\n");
|
||||
child.stderr.write("[balance-lab] 1/1 Eck the Ferocious seed 1\n");
|
||||
child.stdout.end();
|
||||
@@ -176,6 +177,48 @@ test("queues a job, reports progress, and exposes only allow-listed artifacts",
|
||||
}
|
||||
});
|
||||
|
||||
test("corrects queued party progress when the eligible pool caps unique compositions", async () => {
|
||||
const directory = mkdtempSync(path.join(os.tmpdir(), "healer-man-balance-capacity-"));
|
||||
try {
|
||||
const spawnProcess = (_executable, args) => {
|
||||
const child = new EventEmitter();
|
||||
child.stdout = new PassThrough();
|
||||
child.stderr = new PassThrough();
|
||||
child.kill = () => child.emit("close", null);
|
||||
const outputDir = args[args.indexOf("--output-dir") + 1];
|
||||
setImmediate(() => {
|
||||
mkdirSync(outputDir, { recursive: true });
|
||||
writeFileSync(path.join(outputDir, "suite-report.json"), "{}\n");
|
||||
child.stdout.write("Running 1 simulations (1 parties x 1 bosses x 1 runs per party/boss)...\n");
|
||||
child.stdout.write("Party 1/1: wow-party-001\n");
|
||||
child.stdout.end();
|
||||
child.stderr.end();
|
||||
child.emit("close", 0);
|
||||
});
|
||||
return child;
|
||||
};
|
||||
const service = createBalanceLabJobService({
|
||||
dataDir: directory,
|
||||
projectRoot: directory,
|
||||
spawnProcess,
|
||||
pythonExecutable: "python-test",
|
||||
});
|
||||
const started = service.start({
|
||||
source: "wow", level: 40, partyConfigurations: 10, simulationsPerParty: 1,
|
||||
durationSeconds: 5, partySeed: 1, bossCategory: "all", bossKeys: ["gundrak/entry-29932"],
|
||||
}, { username: "Phenom" });
|
||||
assert.equal(started.progress.partiesTotal, 10);
|
||||
await new Promise((resolve) => setImmediate(resolve));
|
||||
const completed = service.get(started.id);
|
||||
assert.equal(completed.status, "complete");
|
||||
assert.equal(completed.progress.partiesTotal, 1);
|
||||
assert.equal(completed.progress.partiesCompleted, 1);
|
||||
service.close();
|
||||
} finally {
|
||||
rmSync(directory, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
test("snapshots the published companion readiness policy for each server job", async () => {
|
||||
const directory = mkdtempSync(path.join(os.tmpdir(), "healer-man-balance-readiness-"));
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user