Skip to content

Commit f43b290

Browse files
Dumbrisclaude
andcommitted
fix(ci): fix E2E test and Windows npm install failures
**E2E Test Fix (TestE2E_InspectQuarantined):** - Fixed type assertion for mcp.TextContent in quarantine inspection test - Test was only checking for *mcp.TextContent (pointer) but content can be value type - Added value type check consistent with debug logging (lines 1073-1078) **Windows CI Fix:** - Added PowerShell retry logic for npm ci on Windows (3 attempts with 5s wait) - Windows has intermittent EPERM errors during npm cleanup - Cleanup node_modules between retries to avoid stale state - Uses --prefer-offline and --no-audit flags for faster installs - Only applies to Windows matrix (Unix uses standard npm ci) **Testing:** - Verified TestE2E_InspectQuarantined passes locally - Windows npm install will now retry on permission errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 442269a commit f43b290

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.github/workflows/unit-tests.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,41 @@ jobs:
171171
with:
172172
node-version: '20'
173173

174-
- name: Install frontend dependencies
174+
- name: Install frontend dependencies (Windows)
175+
if: matrix.os == 'windows-latest'
176+
shell: pwsh
177+
run: |
178+
cd frontend
179+
$maxRetries = 3
180+
$retryCount = 0
181+
182+
while ($retryCount -lt $maxRetries) {
183+
$retryCount++
184+
Write-Host "Attempting npm ci (attempt $retryCount/$maxRetries)..."
185+
186+
npm ci --prefer-offline --no-audit 2>&1 | Out-Host
187+
188+
if ($LASTEXITCODE -eq 0) {
189+
Write-Host "npm ci succeeded"
190+
break
191+
}
192+
193+
if ($retryCount -lt $maxRetries) {
194+
Write-Host "npm ci failed with exit code $LASTEXITCODE, waiting 5 seconds before retry..."
195+
Start-Sleep -Seconds 5
196+
197+
if (Test-Path node_modules) {
198+
Write-Host "Cleaning up node_modules..."
199+
Remove-Item -Recurse -Force node_modules -ErrorAction SilentlyContinue
200+
}
201+
} else {
202+
Write-Host "npm ci failed after $maxRetries attempts"
203+
exit 1
204+
}
205+
}
206+
207+
- name: Install frontend dependencies (Unix)
208+
if: matrix.os != 'windows-latest'
175209
run: cd frontend && npm ci
176210

177211
- name: Build frontend

internal/server/e2e_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,8 +1070,11 @@ func TestE2E_InspectQuarantined(t *testing.T) {
10701070
// Verify the result contains information about the tools
10711071
var resultText string
10721072
for _, content := range inspectResult.Content {
1073+
// Handle both pointer and value types
10731074
if textContent, ok := content.(*mcp.TextContent); ok {
10741075
resultText += textContent.Text
1076+
} else if textContent, ok := content.(mcp.TextContent); ok {
1077+
resultText += textContent.Text
10751078
}
10761079
}
10771080
assert.Contains(t, resultText, "test_tool_1", "Result should mention test_tool_1")

0 commit comments

Comments
 (0)