mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-28 06:29:32 +00:00
fix(ci): kill wedged checkout fetches
This commit is contained in:
@@ -2,6 +2,28 @@ import { readFileSync } from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
describe("ci workflow guards", () => {
|
||||
it("kills timed manual checkout fetches after the grace period", () => {
|
||||
const workflowPaths = [
|
||||
".github/workflows/ci.yml",
|
||||
".github/workflows/ci-check-testbox.yml",
|
||||
".github/workflows/ci-build-artifacts-testbox.yml",
|
||||
];
|
||||
|
||||
for (const workflowPath of workflowPaths) {
|
||||
const workflow = readFileSync(workflowPath, "utf8");
|
||||
const fetchTimeouts = workflow.match(
|
||||
/timeout --signal=TERM[^\n]* 30s git -C "\$workdir"/g,
|
||||
);
|
||||
|
||||
expect(fetchTimeouts?.length, workflowPath).toBeGreaterThan(0);
|
||||
expect(fetchTimeouts, workflowPath).toEqual(
|
||||
fetchTimeouts?.map(
|
||||
() => 'timeout --signal=TERM --kill-after=10s 30s git -C "$workdir"',
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
it("runs dependency policy guards in PR CI preflight", () => {
|
||||
const workflow = readFileSync(".github/workflows/ci.yml", "utf8");
|
||||
const preflightGuards = workflow.slice(
|
||||
|
||||
Reference in New Issue
Block a user