All checks were successful
Validation applicative / TypeScript, tests et build (push) Successful in 3m20s
30 lines
1.4 KiB
TypeScript
30 lines
1.4 KiB
TypeScript
import { readFileSync } from "node:fs";
|
||
import { join } from "node:path";
|
||
import { describe, expect, it } from "vitest";
|
||
|
||
describe("routage et persistance de déploiement", () => {
|
||
it("utilise le domaine fourni par l’environnement avec la recette comme repli", () => {
|
||
const composeFile = readFileSync(join(process.cwd(), "docker-compose.yml"), "utf8");
|
||
|
||
expect(composeFile).toContain(
|
||
"Host(`${APP_DOMAIN:-demat-facturation.recette.santinova-soft.org}`)"
|
||
);
|
||
expect(composeFile).toContain("source: demat_facturation_storage");
|
||
expect(composeFile).toContain("target: /app/storage");
|
||
});
|
||
|
||
it("refuse de recréer le volume PDF et contrôle son montage avant le démarrage", () => {
|
||
const composeFile = readFileSync(join(process.cwd(), "docker-compose.yml"), "utf8");
|
||
const dockerfile = readFileSync(join(process.cwd(), "Dockerfile"), "utf8");
|
||
const guardScript = readFileSync(join(process.cwd(), "scripts", "ensure-storage-volume.sh"), "utf8");
|
||
|
||
expect(composeFile).toContain("STORAGE_BASE_PATH: /app/storage");
|
||
expect(composeFile).toContain("external: true");
|
||
expect(composeFile).toContain("nocopy: true");
|
||
expect(composeFile).toContain("grep -qs ' /app/storage ' /proc/mounts");
|
||
expect(dockerfile).toContain('CMD ["/app/scripts/ensure-storage-volume.sh"]');
|
||
expect(guardScript).toContain("Volume persistant non monté");
|
||
expect(guardScript).toContain("/proc/mounts");
|
||
});
|
||
});
|