mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 16:44:45 +00:00
test: tighten gateway response assertions
This commit is contained in:
@@ -94,7 +94,7 @@ describe("completion-cli write-state", () => {
|
||||
await program.parseAsync(["completion", "--write-state"], { from: "user" });
|
||||
|
||||
const cacheDir = path.join(stateDir, "completions");
|
||||
expect((await fs.readdir(cacheDir)).sort()).toEqual([
|
||||
expect((await fs.readdir(cacheDir)).toSorted()).toEqual([
|
||||
"openclaw.bash",
|
||||
"openclaw.fish",
|
||||
"openclaw.ps1",
|
||||
@@ -137,7 +137,7 @@ describe("completion-cli write-state", () => {
|
||||
[program, "qa", process.argv, { purpose: "completion" }],
|
||||
]);
|
||||
expect(registerPluginCliCommandsFromValidatedConfigMock).not.toHaveBeenCalled();
|
||||
expect((await fs.readdir(path.join(stateDir, "completions"))).sort()).toEqual([
|
||||
expect((await fs.readdir(path.join(stateDir, "completions"))).toSorted()).toEqual([
|
||||
"openclaw.bash",
|
||||
"openclaw.fish",
|
||||
"openclaw.ps1",
|
||||
|
||||
@@ -124,10 +124,8 @@ describe("gateway stability lane", () => {
|
||||
expect(lastSeq).toBeGreaterThan(firstSeq);
|
||||
expect(snapshot.summary.byType["diagnostic.memory.sample"]).toBeGreaterThan(0);
|
||||
expect(snapshot.summary.byType["message.queued"]).toBeGreaterThan(0);
|
||||
expect(snapshot.summary.memory).toMatchObject({
|
||||
maxRssBytes: maxSyntheticRssBytes,
|
||||
pressureCount: 0,
|
||||
});
|
||||
expect(snapshot.summary.memory?.maxRssBytes).toBe(maxSyntheticRssBytes);
|
||||
expect(snapshot.summary.memory?.pressureCount).toBe(0);
|
||||
expect(snapshot.summary.memory?.maxHeapUsedBytes).toBeLessThan(96 * MB);
|
||||
expect(snapshot.summary.payloadLarge?.chunked).toBeGreaterThan(0);
|
||||
expect(snapshot.summary.payloadLarge?.bySurface["gateway.stability.probe"]).toBeGreaterThan(0);
|
||||
|
||||
@@ -58,10 +58,11 @@ describe("openresponses phase support", () => {
|
||||
phase: "commentary",
|
||||
status: "completed",
|
||||
}),
|
||||
).toMatchObject({
|
||||
).toEqual({
|
||||
type: "message",
|
||||
id: "msg_commentary",
|
||||
role: "assistant",
|
||||
content: [{ type: "output_text", text: "Checking logs." }],
|
||||
phase: "commentary",
|
||||
status: "completed",
|
||||
});
|
||||
@@ -73,10 +74,11 @@ describe("openresponses phase support", () => {
|
||||
phase: "final_answer",
|
||||
status: "completed",
|
||||
}),
|
||||
).toMatchObject({
|
||||
).toEqual({
|
||||
type: "message",
|
||||
id: "msg_final",
|
||||
role: "assistant",
|
||||
content: [{ type: "output_text", text: "Root cause found." }],
|
||||
phase: "final_answer",
|
||||
status: "completed",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user