mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-28 01:23:31 +00:00
test(plugin-sdk): ratchet surface budget checks
This commit is contained in:
@@ -131,6 +131,21 @@ describe("ci workflow guards", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("runs plugin SDK API and surface drift checks in workflow sanity", () => {
|
||||
const workflow = readWorkflowSanityWorkflow();
|
||||
const steps = workflow.jobs["generated-doc-baselines"].steps;
|
||||
const stepNames = steps.map((step) => step.name);
|
||||
|
||||
expect(stepNames).toContain("Check plugin SDK API baseline drift");
|
||||
expect(stepNames).toContain("Check plugin SDK surface budget");
|
||||
expect(stepNames.indexOf("Check plugin SDK API baseline drift")).toBeLessThan(
|
||||
stepNames.indexOf("Check plugin SDK surface budget"),
|
||||
);
|
||||
expect(steps.find((step) => step.name === "Check plugin SDK surface budget").run).toBe(
|
||||
"pnpm plugin-sdk:surface:check",
|
||||
);
|
||||
});
|
||||
|
||||
it("bounds platform checkout fetches without GNU timeout", () => {
|
||||
const workflow = readCiWorkflow();
|
||||
|
||||
|
||||
@@ -39,4 +39,22 @@ describe("plugin SDK surface report", () => {
|
||||
);
|
||||
expect(result.stderr).not.toContain("at ");
|
||||
});
|
||||
|
||||
it("accepts exact deprecated export budget overrides by public entrypoint", () => {
|
||||
const result = runSurfaceReport({
|
||||
OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_DEPRECATED_EXPORTS_BY_ENTRYPOINT: JSON.stringify({ core: 2 }),
|
||||
});
|
||||
|
||||
expect(result.status).toBe(0);
|
||||
expect(result.stderr).toBe("");
|
||||
});
|
||||
|
||||
it("rejects deprecated export growth by public entrypoint", () => {
|
||||
const result = runSurfaceReport({
|
||||
OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_DEPRECATED_EXPORTS_BY_ENTRYPOINT: JSON.stringify({ core: 1 }),
|
||||
});
|
||||
|
||||
expect(result.status).toBe(1);
|
||||
expect(result.stderr).toContain("public deprecated exports in core 2 > 1");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user