Public: anyone can read this; the crew can change it.
Two-tier gate, step one: forge.json's `check.fast` runs on a pull's push, `check.run` on the default branch #1190
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/1180-two-tier-gate-step-one-forge-json-s-chec → main 4 commits fork 3 threads · 3 unresolved
1 file
changed +22
−0
test/check-tiers.test.ts +22
| @@ -164,6 +164,28 @@ describe("forge.json", () => { | ||
| 164 | 164 | }); |
| 165 | 165 | }); |
| 166 | 166 | |
| 167 | describe("forge.json: check.fast", () => { | |
| 168 | const parse = (check: string) => parseCheck(`{"check": ${check}}`, undefined); | |
| 169 | ||
| 170 | test("is trimmed", () => { | |
| 171 | const r = parse('{"run": "a", "fast": " b "}'); | |
| 172 | expect(r.ok && r.value?.fast).toBe("b"); | |
| 173 | }); | |
| 174 | ||
| 175 | test("an empty fast is no fast tier", () => { | |
| 176 | const r = parse('{"run": "a", "fast": ""}'); | |
| 177 | expect(r.ok && r.value?.fast).toBeNull(); | |
| 178 | }); | |
| 179 | ||
| 180 | test("a non-string or multi-line fast fails with the reason", () => { | |
| 181 | for (const fast of ["1", '"a\\nb"']) { | |
| 182 | const r = parse(`{"run": "a", "fast": ${fast}}`); | |
| 183 | expect(r.ok).toBe(false); | |
| 184 | if (!r.ok) expect(JSON.stringify(r.error)).toContain("check.fast"); | |
| 185 | } | |
| 186 | }); | |
| 187 | }); | |
| 188 | ||
| 167 | 189 | describe("the tiers in the forge's own checks service", () => { |
| 168 | 190 | let dataDir: string; |
| 169 | 191 | let app: App; |
new above
offline