fix(ci): skip extension lanes with no tests

This commit is contained in:
Vincent Koc
2026-03-18 17:52:28 -07:00
parent 8884643f40
commit de86e25fd4
2 changed files with 40 additions and 7 deletions

View File

@@ -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.");
});
});