

























@@ -197,6 +197,35 @@ describe("ci workflow guards", () => {
197197);
198198});
199199200+it("fails Windows Testbox setup when Blacksmith phone-home is not accepted", () => {
201+const workflow = readFileSync(".github/workflows/windows-blacksmith-testbox.yml", "utf8");
202+203+expect(workflow).toContain('echo "phone_home_hydrating_http=${hydrating_http_code}"');
204+expect(workflow).toContain('echo "phone_home_ready_http=${http_code}"');
205+const hydratingFailureBlock = workflow.slice(
206+workflow.indexOf('if [[ ! "$hydrating_http_code" =~ ^2 ]]; then'),
207+workflow.indexOf('response="$(cat "$hydrating_response")"'),
208+);
209+const missingSshKeyFailureBlock = workflow.slice(
210+workflow.indexOf('if [ -z "$ssh_public_key" ]; then'),
211+workflow.indexOf("mkdir -p ~/.ssh"),
212+);
213+const readyFailureBlock = workflow.slice(
214+workflow.indexOf('if [[ ! "$http_code" =~ ^2 ]]; then'),
215+workflow.indexOf('echo "============================================"'),
216+);
217+218+expect(hydratingFailureBlock).toContain("exit 1");
219+expect(missingSshKeyFailureBlock).toContain("exit 1");
220+expect(readyFailureBlock).toContain("exit 1");
221+expect(workflow).toContain(
222+"Blacksmith phone-home did not return an SSH public key; testbox cannot accept CLI connections.",
223+);
224+expect(workflow).not.toContain(
225+'phone_home_ready_http=${http_code}"\n\n echo "============================================"',
226+);
227+});
228+200229it("runs dependency policy guards in PR CI preflight", () => {
201230const workflow = readFileSync(".github/workflows/ci.yml", "utf8");
202231const preflightGuards = workflow.slice(
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。