test: Test-Suite für Single-Server-Konfig, Loop-Logik und Skripte
Node-eigener Test-Runner (keine Dependencies). 35 Tests: - pure-logic: parseVerdict/parseBlockers/normalizeForComparison (real aus der Extension extrahiert), inkl. PASS-WITH-CONCERNS-Abgrenzung - config: models.json/settings.json-Invarianten (kein Port 8002, nur llama-cpp-single/qwen3.5-single), Querkonsistenz - extension-guards: Regression-Schutz fuer jeden Fix (select positional, kein switchModel, before_agent_start-Hook, passed-Logik, Loop-Fallback) - scripts: bash -n + Single-Server-Invarianten Start: ./run-tests.sh Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
56904329d0
commit
ba733fe684
6 changed files with 266 additions and 0 deletions
46
tests/scripts.test.mjs
Normal file
46
tests/scripts.test.mjs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
// Testet die Shell-Skripte: Syntax + Single-Server-Invarianten.
|
||||
|
||||
import { test } from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { readdirSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { repoRoot, readRepoFile } from "./helpers.mjs";
|
||||
|
||||
const shellScripts = readdirSync(repoRoot).filter((f) => f.endsWith(".sh"));
|
||||
|
||||
for (const script of shellScripts) {
|
||||
test(`bash -n: ${script} hat gültige Syntax`, () => {
|
||||
// execFileSync wirft bei Exit != 0 (Syntaxfehler).
|
||||
execFileSync("bash", ["-n", join(repoRoot, script)]);
|
||||
});
|
||||
}
|
||||
|
||||
test("Dual-GPU-Skripte sind entfernt", () => {
|
||||
for (const gone of ["start-coder.sh", "start-judge.sh", "start-servers.sh"]) {
|
||||
assert.ok(!shellScripts.includes(gone), `${gone} sollte in der Single-GPU-Welt entfernt sein`);
|
||||
}
|
||||
});
|
||||
|
||||
test("start-single.sh nutzt eine GPU und registriert Alias qwen3.5-single", () => {
|
||||
const s = readRepoFile("start-single.sh");
|
||||
assert.match(s, /--alias\s+"\$\{MODEL_ALIAS\}"/);
|
||||
assert.match(s, /MODEL_ALIAS="qwen3\.5-single"/);
|
||||
assert.match(s, /device=\$\{GPU_DEVICE\}/, "GPU muss konfigurierbar/einzeln sein");
|
||||
});
|
||||
|
||||
test("stop-servers.sh stoppt den Single-Container", () => {
|
||||
assert.match(readRepoFile("stop-servers.sh"), /qwen36-27b-single/);
|
||||
});
|
||||
|
||||
test("status.sh prüft den Single-Container", () => {
|
||||
assert.match(readRepoFile("status.sh"), /qwen36-27b-single/);
|
||||
});
|
||||
|
||||
test("install-Skript deployt settings.json mit vorherigem Backup", () => {
|
||||
const s = readRepoFile("install_servers_and_pi_coder_extension.sh");
|
||||
assert.match(s, /settings\.json\.bak/, "muss settings.json vor dem Überschreiben sichern");
|
||||
assert.match(s, /cp "\$REPO\/settings\.json"/, "muss settings.json aus dem Repo deployen");
|
||||
assert.match(s, /cp "\$REPO\/models\.json"/);
|
||||
assert.match(s, /pi-coder-judge-extension\.ts/);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue