Skip to content

Commit ae92a75

Browse files
authored
test(smoke): skip the non-headless viewer smoke without a host display (#71)
Every assertion in this smoke describes a session that can open a host-visible viewer: ready_for_host_viewer=true, viewer steps present in the task plan, auto-open on workspace_start. With no DISPLAY and no WAYLAND_DISPLAY the MCP is correct to report the viewer unavailable, so the script could only fail there — and it failed on the first assertion with a wall of task-plan JSON that says nothing about the change under test. A contributor running scripts/integration_smoke.sh on a headless box hit exactly that on #69 and reasonably read it as a failure in their own work. Skip with a one-line reason instead, matching how the terminal-TUI and browser CDP smokes handle a missing prerequisite. mcp_no_host_display_viewer_smoke.js already covers the session shape a headless machine can assert.
1 parent 0fa40d8 commit ae92a75

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

scripts/mcp_non_headless_viewer_smoke.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,21 @@ if (!fs.existsSync(bin)) {
1515
throw new Error(`agent-workspace-linux binary not found at ${bin}; run cargo build first`);
1616
}
1717

18+
// Everything below asserts the shape of a session that can open a host-visible
19+
// viewer: ready_for_host_viewer=true, viewer steps present in the task plan,
20+
// auto-open on workspace_start. On a machine with no host display the MCP is
21+
// right to report the viewer unavailable, so running these assertions there only
22+
// produces a failure that says nothing about the code — which is exactly what a
23+
// headless contributor hit on #69. mcp_no_host_display_viewer_smoke.js is the
24+
// smoke that covers that session shape. Empty is absent, matching the
25+
// non-empty-var check in host_display_check().
26+
if (!process.env.DISPLAY && !process.env.WAYLAND_DISPLAY) {
27+
console.log(
28+
"non-headless mcp viewer smoke skipped: no DISPLAY or WAYLAND_DISPLAY (run it from a desktop session)",
29+
);
30+
process.exit(0);
31+
}
32+
1833
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "agent-workspace-non-headless-mcp-smoke-"));
1934
const configDir = path.join(tempDir, "config");
2035
const runtimeDir = path.join(tempDir, "runtime");

0 commit comments

Comments
 (0)