Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/integration/playwright_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ func TestPlaywrightMCPServer(t *testing.T) {
stderrStr := stderr.String()

// Check that tools were registered
if !strings.Contains(stderrStr, "Registered 22 tools from playwright") &&
!strings.Contains(stderrStr, "Registered tool: playwright___browser_close") {
if !strings.Contains(stderrStr, "tools from playwright") &&

Copilot AI Mar 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strings.Contains(stderrStr, "tools from playwright") is too broad and can match failure logs. internal/server/unified.go emits e.g. "Warning: failed to register tools from %s", which still contains the substring "tools from playwright"; in that scenario this test would pass even though no tools were registered.

Instead, assert on a success-only message such as the log.Printf("Registered %d tools from %s: ...") prefix (e.g. match "Registered " + " tools from playwright"), or rely solely on a specific "Registered tool: playwright-browser_close" entry.

Suggested change
if !strings.Contains(stderrStr, "tools from playwright") &&
if !(strings.Contains(stderrStr, "Registered ") && strings.Contains(stderrStr, " tools from playwright")) &&

Copilot uses AI. Check for mistakes.
!strings.Contains(stderrStr, "Registered tool: playwright-browser_close") {
t.Fatal("Expected playwright tools to be registered in server logs")
}

Expand Down
Loading