mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:40:44 +00:00
QA: fix triage follow-ups
This commit is contained in:
@@ -42,6 +42,15 @@ function createBlockedQaRunnerContribution(): QaRunnerCliContribution {
|
||||
};
|
||||
}
|
||||
|
||||
function createConflictingQaRunnerContribution(commandName: string): QaRunnerCliContribution {
|
||||
return {
|
||||
pluginId: TEST_QA_RUNNER.pluginId,
|
||||
commandName,
|
||||
description: TEST_QA_RUNNER.description,
|
||||
status: "blocked",
|
||||
};
|
||||
}
|
||||
|
||||
const {
|
||||
runQaCredentialsAddCommand,
|
||||
runQaCredentialsListCommand,
|
||||
@@ -138,6 +147,16 @@ describe("qa cli registration", () => {
|
||||
).rejects.toThrow(`Enable or allow plugin "${TEST_QA_RUNNER.pluginId}"`);
|
||||
});
|
||||
|
||||
it("rejects discovered runners that collide with built-in qa subcommands", () => {
|
||||
listQaRunnerCliContributions
|
||||
.mockReset()
|
||||
.mockReturnValue([createConflictingQaRunnerContribution("manual")]);
|
||||
|
||||
expect(() => registerQaLabCli(new Command())).toThrow(
|
||||
'QA runner command "manual" conflicts with an existing qa subcommand',
|
||||
);
|
||||
});
|
||||
|
||||
it("routes telegram CLI defaults into the lane runtime", async () => {
|
||||
await program.parseAsync(["node", "openclaw", "qa", "telegram"]);
|
||||
|
||||
|
||||
@@ -183,6 +183,12 @@ export function isQaLabCliAvailable(): boolean {
|
||||
return hasQaScenarioPack();
|
||||
}
|
||||
|
||||
function assertNoQaSubcommandCollision(qa: Command, commandName: string) {
|
||||
if (qa.commands.some((command) => command.name() === commandName)) {
|
||||
throw new Error(`QA runner command "${commandName}" conflicts with an existing qa subcommand`);
|
||||
}
|
||||
}
|
||||
|
||||
export function registerQaLabCli(program: Command) {
|
||||
const qa = program
|
||||
.command("qa")
|
||||
@@ -284,10 +290,6 @@ export function registerQaLabCli(program: Command) {
|
||||
},
|
||||
);
|
||||
|
||||
for (const lane of listLiveTransportQaCliRegistrations()) {
|
||||
lane.register(qa);
|
||||
}
|
||||
|
||||
qa.command("character-eval")
|
||||
.description("Run the character QA scenario across live models and write a judged report")
|
||||
.option("--repo-root <path>", "Repository root to target when running from a neutral cwd")
|
||||
@@ -579,4 +581,9 @@ export function registerQaLabCli(program: Command) {
|
||||
.action(async (opts: { host?: string; port?: number }) => {
|
||||
await runQaMockOpenAi(opts);
|
||||
});
|
||||
|
||||
for (const lane of listLiveTransportQaCliRegistrations()) {
|
||||
assertNoQaSubcommandCollision(qa, lane.commandName);
|
||||
lane.register(qa);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export async function fetchHealthUrl(url: string): Promise<{ ok: boolean }> {
|
||||
signal: AbortSignal.timeout(2_000),
|
||||
},
|
||||
policy: { allowPrivateNetwork: true },
|
||||
auditContext: "qa-lab-docker-health-check",
|
||||
auditContext: "qa-matrix-docker-health-check",
|
||||
});
|
||||
try {
|
||||
return { ok: response.ok };
|
||||
|
||||
9
pnpm-lock.yaml
generated
9
pnpm-lock.yaml
generated
@@ -994,6 +994,15 @@ importers:
|
||||
specifier: workspace:*
|
||||
version: link:../..
|
||||
|
||||
extensions/qa-matrix:
|
||||
devDependencies:
|
||||
'@openclaw/plugin-sdk':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/plugin-sdk
|
||||
openclaw:
|
||||
specifier: workspace:*
|
||||
version: link:../..
|
||||
|
||||
extensions/qianfan:
|
||||
devDependencies:
|
||||
'@openclaw/plugin-sdk':
|
||||
|
||||
Reference in New Issue
Block a user