2026-06-15 02:58:21 +02:00
|
|
|
// 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`);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
refactor: Modell- und Container-Alias auf coding_model vereinheitlicht
Statt modell-spezifischer Namen (qwen3.5-single, qwen36-27b-single) wird
überall der semantisch neutrale Bezeichner coding_model verwendet.
Dadurch kann das Modell bei Bedarf ausgetauscht werden, ohne Konfiguration,
Skripte oder Tests anpassen zu müssen.
Geändert: models.json, settings.json, start-single.sh, stop-servers.sh,
status.sh, pi-coder-judge-extension.ts, tests/, README.md, BEDIENUNGSANLEITUNG.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-15 05:26:58 +02:00
|
|
|
test("start-single.sh nutzt eine GPU und registriert Alias coding_model", () => {
|
2026-06-15 02:58:21 +02:00
|
|
|
const s = readRepoFile("start-single.sh");
|
|
|
|
|
assert.match(s, /--alias\s+"\$\{MODEL_ALIAS\}"/);
|
refactor: Modell- und Container-Alias auf coding_model vereinheitlicht
Statt modell-spezifischer Namen (qwen3.5-single, qwen36-27b-single) wird
überall der semantisch neutrale Bezeichner coding_model verwendet.
Dadurch kann das Modell bei Bedarf ausgetauscht werden, ohne Konfiguration,
Skripte oder Tests anpassen zu müssen.
Geändert: models.json, settings.json, start-single.sh, stop-servers.sh,
status.sh, pi-coder-judge-extension.ts, tests/, README.md, BEDIENUNGSANLEITUNG.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-15 05:26:58 +02:00
|
|
|
assert.match(s, /MODEL_ALIAS="coding_model"/);
|
2026-06-15 02:58:21 +02:00
|
|
|
assert.match(s, /device=\$\{GPU_DEVICE\}/, "GPU muss konfigurierbar/einzeln sein");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test("stop-servers.sh stoppt den Single-Container", () => {
|
refactor: Modell- und Container-Alias auf coding_model vereinheitlicht
Statt modell-spezifischer Namen (qwen3.5-single, qwen36-27b-single) wird
überall der semantisch neutrale Bezeichner coding_model verwendet.
Dadurch kann das Modell bei Bedarf ausgetauscht werden, ohne Konfiguration,
Skripte oder Tests anpassen zu müssen.
Geändert: models.json, settings.json, start-single.sh, stop-servers.sh,
status.sh, pi-coder-judge-extension.ts, tests/, README.md, BEDIENUNGSANLEITUNG.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-15 05:26:58 +02:00
|
|
|
assert.match(readRepoFile("stop-servers.sh"), /coding_model/);
|
2026-06-15 02:58:21 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test("status.sh prüft den Single-Container", () => {
|
refactor: Modell- und Container-Alias auf coding_model vereinheitlicht
Statt modell-spezifischer Namen (qwen3.5-single, qwen36-27b-single) wird
überall der semantisch neutrale Bezeichner coding_model verwendet.
Dadurch kann das Modell bei Bedarf ausgetauscht werden, ohne Konfiguration,
Skripte oder Tests anpassen zu müssen.
Geändert: models.json, settings.json, start-single.sh, stop-servers.sh,
status.sh, pi-coder-judge-extension.ts, tests/, README.md, BEDIENUNGSANLEITUNG.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-15 05:26:58 +02:00
|
|
|
assert.match(readRepoFile("status.sh"), /coding_model/);
|
2026-06-15 02:58:21 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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/);
|
|
|
|
|
});
|