test: verify qa runtime values · openclaw/openclaw@98c825c
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
File tree
qa-matrix/src/runners/contract
| Original file line number | Diff line number | Diff line change |
|---|
@@ -172,8 +172,8 @@ describe("createQaScenarioRuntimeApi", () => {
|
172 | 172 | to: "dm:qa-operator", |
173 | 173 | text: "hi", |
174 | 174 | }); |
175 | | -expect(inbound.id).toEqual(expect.stringMatching(/\S/)); |
176 | | -expect(outbound.id).toEqual(expect.stringMatching(/\S/)); |
| 175 | +expect(inbound.id.trim()).not.toBe(""); |
| 176 | +expect(outbound.id.trim()).not.toBe(""); |
177 | 177 | api.readTransportMessage({ accountId: "qa-channel", messageId: outbound.id }); |
178 | 178 | await api.reset(); |
179 | 179 | await api.resetBus(); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -271,7 +271,7 @@ describe("qa suite runtime agent process helpers", () => {
|
271 | 271 | expect(agentPayload?.channel).toBe("qa-channel"); |
272 | 272 | expect(agentPayload?.replyChannel).toBe("reply-channel"); |
273 | 273 | expect(agentPayload?.replyTo).toBe("reply-target"); |
274 | | -expect(gatewayArgs?.[2]).toEqual(expect.any(Object)); |
| 274 | +expect(gatewayArgs?.[2]).toBeTypeOf("object"); |
275 | 275 | }); |
276 | 276 | |
277 | 277 | it("finds managed dreaming cron jobs across legacy and current payload contracts", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -33,7 +33,7 @@ describe("qa suite runtime agent session helpers", () => {
|
33 | 33 | const [method, params, options] = gatewayCall.mock.calls[0] ?? []; |
34 | 34 | expect(method).toBe("sessions.create"); |
35 | 35 | expect(params).toEqual({ label: "Test Session" }); |
36 | | -expect(options?.timeoutMs).toEqual(expect.any(Number)); |
| 36 | +expect(options?.timeoutMs).toBe(60_000); |
37 | 37 | }); |
38 | 38 | |
39 | 39 | it("reads effective tool ids once and drops blanks", async () => { |
@@ -56,7 +56,7 @@ describe("qa suite runtime agent session helpers", () => {
|
56 | 56 | const [method, params, options] = gatewayCall.mock.calls[0] ?? []; |
57 | 57 | expect(method).toBe("skills.status"); |
58 | 58 | expect(params).toEqual({ agentId: "qa" }); |
59 | | -expect(options?.timeoutMs).toEqual(expect.any(Number)); |
| 59 | +expect(options?.timeoutMs).toBe(45_000); |
60 | 60 | }); |
61 | 61 | |
62 | 62 | it("reads the raw qa session store from disk", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import fs from "node:fs/promises"; |
| 2 | +import { createRequire } from "node:module"; |
2 | 3 | import path from "node:path"; |
3 | 4 | import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; |
4 | 5 | |
| 6 | +const requireFromHere = createRequire(import.meta.url); |
| 7 | + |
5 | 8 | const connectMock = vi.hoisted(() => vi.fn(async () => undefined)); |
6 | 9 | const listToolsMock = vi.hoisted(() => vi.fn(async () => ({ tools: [] }))); |
7 | 10 | const callToolMock = vi.hoisted(() => vi.fn(async () => ({ content: [] }))); |
@@ -133,7 +136,7 @@ describe("qa suite runtime agent tools helpers", () => {
|
133 | 136 | command: "/usr/bin/node", |
134 | 137 | args: [ |
135 | 138 | "--import", |
136 | | -expect.stringContaining(path.join("node_modules", "tsx")), |
| 139 | +requireFromHere.resolve("tsx"), |
137 | 140 | path.join(repoRoot, "src", "mcp", "plugin-tools-serve.ts"), |
138 | 141 | ], |
139 | 142 | stderr: "pipe", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4712,12 +4712,14 @@ describe("matrix live qa scenarios", () => {
|
4712 | 4712 | expect(endStdin).toHaveBeenCalledTimes(1); |
4713 | 4713 | expect(wait).toHaveBeenCalledTimes(1); |
4714 | 4714 | expect(kill).toHaveBeenCalledTimes(1); |
4715 | | -expect(registerWithToken).toHaveBeenCalledWith({ |
4716 | | -deviceName: "OpenClaw Matrix QA CLI Self Verification Owner", |
4717 | | -localpart: expect.stringMatching(/^qa-cli-self-verification-[a-f0-9]{8}$/), |
4718 | | -password: expect.stringMatching(/^matrix-qa-/), |
4719 | | -registrationToken: "registration-token", |
4720 | | -}); |
| 4715 | +const registrationRequest = registerWithToken.mock.calls[0]?.[0]; |
| 4716 | +expect(registrationRequest?.deviceName).toBe( |
| 4717 | +"OpenClaw Matrix QA CLI Self Verification Owner", |
| 4718 | +); |
| 4719 | +expect(registrationRequest?.localpart?.startsWith("qa-cli-self-verification-")).toBe(true); |
| 4720 | +expect(registrationRequest?.localpart).toHaveLength("qa-cli-self-verification-".length + 8); |
| 4721 | +expect(registrationRequest?.password?.startsWith("matrix-qa-")).toBe(true); |
| 4722 | +expect(registrationRequest?.registrationToken).toBe("registration-token"); |
4721 | 4723 | expect(loginWithPassword).toHaveBeenCalledWith({ |
4722 | 4724 | deviceName: "OpenClaw Matrix QA CLI Self Verification Device", |
4723 | 4725 | password: "cli-owner-password", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。