-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathshell-scripts.shell.test.mjs
More file actions
70 lines (54 loc) · 2.01 KB
/
shell-scripts.shell.test.mjs
File metadata and controls
70 lines (54 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import { spawnSync } from "node:child_process";
import { resolve, dirname } from "node:path";
import { fileURLToPath } from "node:url";
import { describe, it, expect } from "vitest";
const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
function runScript(relativePath) {
const result = spawnSync("bash", [relativePath], {
cwd: repoRoot,
encoding: "utf8",
env: process.env,
});
if (result.status !== 0) {
const output = [result.stdout, result.stderr].filter(Boolean).join("\n");
throw new Error(`${relativePath} failed (exit ${result.status})\n${output}`);
}
}
describe("shell script test suites", () => {
it("baudbot-safe-bash deny list", () => {
expect(() => runScript("bin/baudbot-safe-bash.test.sh")).not.toThrow();
});
it("redact-logs", () => {
expect(() => runScript("bin/redact-logs.test.sh")).not.toThrow();
});
it("env helper", () => {
expect(() => runScript("bin/env.test.sh")).not.toThrow();
});
it("json helper", () => {
expect(() => runScript("bin/lib/json-common.test.sh")).not.toThrow();
});
it("shell helper", () => {
expect(() => runScript("bin/lib/shell-common.test.sh")).not.toThrow();
});
it("deploy helpers", () => {
expect(() => runScript("bin/lib/deploy-common.test.sh")).not.toThrow();
});
it("release runtime helpers", () => {
expect(() => runScript("bin/lib/release-runtime-common.test.sh")).not.toThrow();
});
it("bridge restart policy helpers", () => {
expect(() => runScript("bin/lib/bridge-restart-policy.test.sh")).not.toThrow();
});
it("check report helpers", () => {
expect(() => runScript("bin/lib/check-report-common.test.sh")).not.toThrow();
});
it("doctor helpers", () => {
expect(() => runScript("bin/lib/doctor-common.test.sh")).not.toThrow();
});
it("baudbot cli", () => {
expect(() => runScript("bin/baudbot.test.sh")).not.toThrow();
});
it("runtime node path drift check", () => {
expect(() => runScript("bin/runtime-node-paths.test.sh")).not.toThrow();
});
});