Files
clawhub/scripts/claws-feed-openclaw-workflow.test.ts
Gio Della-Libera 348851eeb9 feat(claws): align package layers with schema v1 (#3328)
Adds conventional harness profiles, package-root BOOTSTRAP.md, strict OpenClaw validation, portable path hardening, and an official upstream contract pin.
2026-08-09 07:46:06 -07:00

49 lines
1.6 KiB
TypeScript

import { readFile } from "node:fs/promises";
import { describe, expect, it } from "vitest";
import { parse as parseYaml } from "yaml";
describe("Claw feed OpenClaw contract workflow", () => {
it("runs the real bridge against a pinned OpenClaw source revision", async () => {
const workflow = parseYaml(await readFile(".github/workflows/ci.yml", "utf8")) as {
jobs: Record<
string,
{
env?: Record<string, string>;
steps?: Array<{
uses?: string;
with?: Record<string, string>;
env?: Record<string, string>;
run?: string;
}>;
}
>;
};
const job = workflow.jobs["claws-openclaw-contract"];
expect(job?.env).toMatchObject({
OPENCLAW_CONTRACT_REPOSITORY: "openclaw/openclaw",
OPENCLAW_CONTRACT_SHA: "7422222788c4b75581c0370e0614be9e635ec3cd",
});
expect(job?.steps).toContainEqual(
expect.objectContaining({
uses: "actions/checkout@v7.0.1",
with: expect.objectContaining({
repository: "${{ env.OPENCLAW_CONTRACT_REPOSITORY }}",
ref: "${{ env.OPENCLAW_CONTRACT_SHA }}",
path: ".artifacts/openclaw-contract",
}),
}),
);
expect(job?.steps?.some((step) => step.run?.includes("pnpm install --frozen-lockfile"))).toBe(
true,
);
expect(
job?.steps?.some(
(step) =>
step.env?.OPENCLAW_CLAWS_CHECKOUT ===
"${{ github.workspace }}/.artifacts/openclaw-contract" &&
step.run?.includes("claws-feed-openclaw-e2e.test.ts"),
),
).toBe(true);
});
});