CI: skip empty extension-fast suites
This commit is contained in:
parent
0a50065d84
commit
79a525c70d
@ -272,10 +272,10 @@ async function run() {
|
||||
}
|
||||
|
||||
if (plan.testFiles.length === 0) {
|
||||
console.error(
|
||||
`No tests found for ${plan.extensionDir}. Run "pnpm test:extension ${plan.extensionId} -- --dry-run" to inspect the resolved roots.`,
|
||||
console.log(
|
||||
`[test-extension] No tests found for ${plan.extensionDir}; skipping. Run "pnpm test:extension ${plan.extensionId} -- --dry-run" to inspect the resolved roots.`,
|
||||
);
|
||||
process.exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (dryRun) {
|
||||
|
||||
@ -35,6 +35,14 @@ describe("scripts/test-extension.mjs", () => {
|
||||
expect(plan.testFiles.some((file) => file.startsWith("extensions/firecrawl/"))).toBe(true);
|
||||
});
|
||||
|
||||
it("returns an empty test list for provider extensions without dedicated tests", () => {
|
||||
const plan = resolveExtensionTestPlan({ targetArg: "openrouter", cwd: process.cwd() });
|
||||
|
||||
expect(plan.extensionId).toBe("openrouter");
|
||||
expect(plan.config).toBe("vitest.extensions.config.ts");
|
||||
expect(plan.testFiles).toEqual([]);
|
||||
});
|
||||
|
||||
it("includes paired src roots when they contain tests", () => {
|
||||
const plan = resolveExtensionTestPlan({ targetArg: "line", cwd: process.cwd() });
|
||||
|
||||
@ -52,6 +60,15 @@ describe("scripts/test-extension.mjs", () => {
|
||||
expect(plan.extensionDir).toBe("extensions/slack");
|
||||
});
|
||||
|
||||
it("treats extensions without dedicated tests as a clean dry-run skip", () => {
|
||||
const stdout = execFileSync(process.execPath, [scriptPath, "openrouter"], {
|
||||
cwd: process.cwd(),
|
||||
encoding: "utf8",
|
||||
});
|
||||
|
||||
expect(stdout).toContain("No tests found for extensions/openrouter; skipping.");
|
||||
});
|
||||
|
||||
it("maps changed paths back to extension ids", () => {
|
||||
const extensionIds = detectChangedExtensionIds([
|
||||
"extensions/slack/src/channel.ts",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user