From 6902e3e53fda4614c92f85df4705127adfcf2b27 Mon Sep 17 00:00:00 2001 From: Daniel Riccio Date: Mon, 1 Sep 2025 14:31:17 -0600 Subject: [PATCH 1/2] fix: resolve CI e2e test ETIMEDOUT errors when downloading VS Code - Add caching for VS Code test runtime to prevent re-downloads - Pin VS Code version to 1.101.2 for deterministic caching - Add pre-download step to isolate download failures from test failures - Configure version via VSCODE_VERSION environment variable This fixes the network timeout issues occurring when @vscode/test-electron attempts to download VS Code from Microsoft's CDN during CI runs. --- .github/workflows/code-qa.yml | 21 +++++++++++++++++++++ apps/vscode-e2e/src/runTest.ts | 1 + 2 files changed, 22 insertions(+) diff --git a/.github/workflows/code-qa.yml b/.github/workflows/code-qa.yml index ba85a01b21..bedb9ec31d 100644 --- a/.github/workflows/code-qa.yml +++ b/.github/workflows/code-qa.yml @@ -86,6 +86,27 @@ jobs: - name: Create .env.local file working-directory: apps/vscode-e2e run: echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.local + - name: Set VS Code test version + run: echo "VSCODE_VERSION=1.101.2" >> $GITHUB_ENV + - name: Cache VS Code test runtime + uses: actions/cache@v4 + with: + path: apps/vscode-e2e/.vscode-test + key: ${{ runner.os }}-vscode-test-${{ env.VSCODE_VERSION }} + restore-keys: | + ${{ runner.os }}-vscode-test- + - name: Pre-download VS Code test runtime + working-directory: apps/vscode-e2e + run: | + node -e " + const { downloadAndUnzipVSCode } = require('@vscode/test-electron'); + downloadAndUnzipVSCode({ version: process.env.VSCODE_VERSION || '1.101.2' }) + .then(() => console.log('✅ VS Code test runtime downloaded successfully')) + .catch(err => { + console.error('❌ Failed to download VS Code:', err); + process.exit(1); + }); + " - name: Run integration tests working-directory: apps/vscode-e2e run: xvfb-run -a pnpm test:ci diff --git a/apps/vscode-e2e/src/runTest.ts b/apps/vscode-e2e/src/runTest.ts index 2e8b262a49..2bec946b4a 100644 --- a/apps/vscode-e2e/src/runTest.ts +++ b/apps/vscode-e2e/src/runTest.ts @@ -38,6 +38,7 @@ async function main() { extensionTestsPath, launchArgs: [testWorkspace], extensionTestsEnv, + version: process.env.VSCODE_VERSION || "1.101.2", }) // Clean up the temporary workspace From d51ccb34ef1a8dd8c073540b1bed0d2e916ec661 Mon Sep 17 00:00:00 2001 From: Daniel Riccio Date: Mon, 1 Sep 2025 16:51:19 -0600 Subject: [PATCH 2/2] fix: address PR review feedback for VS Code download reliability - Remove cache restore-keys fallback to prevent loading incompatible versions - Add retry logic (3 attempts) to handle transient network failures - Add 5-second delay between retry attempts These changes address the high-priority concerns raised by roomote to make the CI pipeline more robust against network issues while ensuring version consistency. --- .github/workflows/code-qa.yml | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/code-qa.yml b/.github/workflows/code-qa.yml index bedb9ec31d..51f973252b 100644 --- a/.github/workflows/code-qa.yml +++ b/.github/workflows/code-qa.yml @@ -93,20 +93,31 @@ jobs: with: path: apps/vscode-e2e/.vscode-test key: ${{ runner.os }}-vscode-test-${{ env.VSCODE_VERSION }} - restore-keys: | - ${{ runner.os }}-vscode-test- - - name: Pre-download VS Code test runtime + - name: Pre-download VS Code test runtime with retry working-directory: apps/vscode-e2e run: | - node -e " - const { downloadAndUnzipVSCode } = require('@vscode/test-electron'); - downloadAndUnzipVSCode({ version: process.env.VSCODE_VERSION || '1.101.2' }) - .then(() => console.log('✅ VS Code test runtime downloaded successfully')) - .catch(err => { - console.error('❌ Failed to download VS Code:', err); - process.exit(1); - }); - " + for attempt in 1 2 3; do + echo "Download attempt $attempt of 3..." + node -e " + const { downloadAndUnzipVSCode } = require('@vscode/test-electron'); + downloadAndUnzipVSCode({ version: process.env.VSCODE_VERSION || '1.101.2' }) + .then(() => { + console.log('✅ VS Code test runtime downloaded successfully'); + process.exit(0); + }) + .catch(err => { + console.error('❌ Failed to download VS Code (attempt $attempt):', err); + process.exit(1); + }); + " && break || { + if [ $attempt -eq 3 ]; then + echo "All download attempts failed" + exit 1 + fi + echo "Retrying in 5 seconds..." + sleep 5 + } + done - name: Run integration tests working-directory: apps/vscode-e2e run: xvfb-run -a pnpm test:ci