mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-23 16:01:17 +00:00
CI: stabilize extension-fast and publish timing metrics
This commit is contained in:
@@ -17,6 +17,16 @@ function readPlan(args: string[], cwd = process.cwd()) {
|
||||
return JSON.parse(stdout) as ReturnType<typeof resolveExtensionTestPlan>;
|
||||
}
|
||||
|
||||
function findZeroTestExtensionId(): string | undefined {
|
||||
for (const extensionId of listAvailableExtensionIds()) {
|
||||
const plan = resolveExtensionTestPlan({ targetArg: extensionId, cwd: process.cwd() });
|
||||
if (plan.testFiles.length === 0) {
|
||||
return extensionId;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
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 +82,13 @@ describe("scripts/test-extension.mjs", () => {
|
||||
[...extensionIds].toSorted((left, right) => left.localeCompare(right)),
|
||||
);
|
||||
});
|
||||
|
||||
it("permits zero-test extensions when --allow-empty is passed", () => {
|
||||
const extensionId = findZeroTestExtensionId();
|
||||
expect(extensionId).toBeTruthy();
|
||||
|
||||
const plan = readPlan([extensionId!, "--allow-empty"]);
|
||||
expect(plan.extensionId).toBe(extensionId);
|
||||
expect(plan.testFiles).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user