Skip to content

Commit 5d7e0b7

Browse files
committed
fix(e2e): bound mcp client logs
1 parent bab18d5 commit 5d7e0b7

6 files changed

Lines changed: 26 additions & 10 deletions

scripts/e2e/cron-mcp-cleanup-docker.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ set -e
7676

7777
if [ "$status" -ne 0 ]; then
7878
echo "Docker cron/subagent MCP cleanup smoke failed"
79-
cat "$CLIENT_LOG"
79+
docker_e2e_print_log "$CLIENT_LOG"
8080
exit "$status"
8181
fi
8282

83-
cat "$CLIENT_LOG"
83+
docker_e2e_print_log "$CLIENT_LOG"
8484
echo "OK"

scripts/e2e/mcp-channels-docker.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ set -e
7373

7474
if [ "$status" -ne 0 ]; then
7575
echo "Docker MCP smoke failed"
76-
cat "$CLIENT_LOG"
76+
docker_e2e_print_log "$CLIENT_LOG"
7777
exit "$status"
7878
fi
7979

80-
cat "$CLIENT_LOG"
80+
docker_e2e_print_log "$CLIENT_LOG"
8181
echo "OK"

scripts/e2e/mcp-code-mode-gateway-docker.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ set -e
7373

7474
if [ "$status" -ne 0 ]; then
7575
echo "Docker MCP code-mode API-file smoke failed"
76-
cat "$CLIENT_LOG"
76+
docker_e2e_print_log "$CLIENT_LOG"
7777
exit "$status"
7878
fi
7979

80-
cat "$CLIENT_LOG"
80+
docker_e2e_print_log "$CLIENT_LOG"
8181
echo "OK"

scripts/e2e/mcp-code-mode-gateway-live-docker.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ set -e
116116

117117
if [ "$status" -ne 0 ]; then
118118
echo "Live Docker MCP code-mode API-file smoke failed"
119-
cat "$CLIENT_LOG"
119+
docker_e2e_print_log "$CLIENT_LOG"
120120
exit "$status"
121121
fi
122122

123-
cat "$CLIENT_LOG"
123+
docker_e2e_print_log "$CLIENT_LOG"
124124
echo "OK"

test/scripts/docker-build-helper.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ const CENTRALIZED_BUILD_SCRIPTS = [
9999
"scripts/test-install-sh-e2e-docker.sh",
100100
"scripts/test-live-build-docker.sh",
101101
] as const;
102+
const BOUNDED_CLIENT_LOG_DOCKER_E2E_SCRIPTS = [
103+
"scripts/e2e/cron-mcp-cleanup-docker.sh",
104+
"scripts/e2e/mcp-channels-docker.sh",
105+
"scripts/e2e/mcp-code-mode-gateway-docker.sh",
106+
"scripts/e2e/mcp-code-mode-gateway-live-docker.sh",
107+
] as const;
102108

103109
function packageBackedDockerRunnerPaths(): string[] {
104110
return readdirSync("scripts/e2e")
@@ -185,6 +191,16 @@ describe("docker build helper", () => {
185191
expect(installE2eSmoke).not.toContain("docker run --rm \\");
186192
});
187193

194+
it("prints Docker MCP client logs through the bounded helper", () => {
195+
for (const scriptPath of BOUNDED_CLIENT_LOG_DOCKER_E2E_SCRIPTS) {
196+
const script = readFileSync(scriptPath, "utf8");
197+
198+
expect(script, scriptPath).toContain('source "$ROOT_DIR/scripts/lib/docker-e2e-image.sh"');
199+
expect(script.match(/docker_e2e_print_log "\$CLIENT_LOG"/g), scriptPath).toHaveLength(2);
200+
expect(script, scriptPath).not.toContain('cat "$CLIENT_LOG"');
201+
}
202+
});
203+
188204
it("runs cleanup smoke on the native ARM platform instead of pulling an amd64 tag", () => {
189205
expect(runCleanupDefaultPlatform({ CI: "true" }, "aarch64")).toBe("linux/arm64");
190206
expect(runCleanupDefaultPlatform({ GITHUB_ACTIONS: "true" }, "x86_64")).toBe("linux/amd64");

test/scripts/docker-e2e-observability.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ describe("Docker E2E observability", () => {
99
const script = readFileSync(scriptPath, "utf8");
1010
const successTail = script.slice(script.lastIndexOf('if [ "$status" -ne 0 ]; then'));
1111

12-
expect(successTail).toContain('cat "$CLIENT_LOG"');
13-
expect(successTail.indexOf('cat "$CLIENT_LOG"')).toBeLessThan(
12+
expect(successTail).toContain('docker_e2e_print_log "$CLIENT_LOG"');
13+
expect(successTail.indexOf('docker_e2e_print_log "$CLIENT_LOG"')).toBeLessThan(
1414
successTail.indexOf('echo "OK"'),
1515
);
1616
},

0 commit comments

Comments
 (0)