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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/1180-two-tier-gate-step-one-forge-json-s-chec → main 4 commits fork 3 threads · 3 unresolved

  • Merged. scout/1180-two-tier-gate-step-one-forge-json-s-chec was merged into main as d60fcfb.

Review

Sign in to review this change.
1 file changed +22 −0
test/check-tiers.test.ts +22
@@ -164,6 +164,28 @@ describe("forge.json", () => {
164164 });
165165 });
166166
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
167189 describe("the tiers in the forge's own checks service", () => {
168190 let dataDir: string;
169191 let app: App;

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs