mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-27 09:21:35 +07:00
fix(ci): skip extension lanes with no tests
This commit is contained in:
@@ -17,6 +17,13 @@ function readPlan(args: string[], cwd = process.cwd()) {
|
||||
return JSON.parse(stdout) as ReturnType<typeof resolveExtensionTestPlan>;
|
||||
}
|
||||
|
||||
function runScript(args: string[], cwd = process.cwd()) {
|
||||
return execFileSync(process.execPath, [scriptPath, ...args], {
|
||||
cwd,
|
||||
encoding: "utf8",
|
||||
});
|
||||
}
|
||||
|
||||
describe("scripts/test-extension.mjs", () => {
|
||||
it("resolves channel-root extensions onto the channel vitest config", () => {
|
||||
const plan = resolveExtensionTestPlan({ targetArg: "slack", cwd: process.cwd() });
|
||||
@@ -72,4 +79,18 @@ describe("scripts/test-extension.mjs", () => {
|
||||
[...extensionIds].toSorted((left, right) => left.localeCompare(right)),
|
||||
);
|
||||
});
|
||||
|
||||
it("dry-run still reports a plan for extensions without tests", () => {
|
||||
const plan = readPlan(["copilot-proxy"]);
|
||||
|
||||
expect(plan.extensionId).toBe("copilot-proxy");
|
||||
expect(plan.testFiles).toEqual([]);
|
||||
});
|
||||
|
||||
it("treats extensions without tests as a no-op by default", () => {
|
||||
const stdout = runScript(["copilot-proxy"]);
|
||||
|
||||
expect(stdout).toContain("No tests found for extensions/copilot-proxy.");
|
||||
expect(stdout).toContain("Skipping.");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user