From 97244261a784fc71f424997f407340ce74c1cde9 Mon Sep 17 00:00:00 2001 From: Ammar Date: Mon, 24 Nov 2025 11:58:33 -0600 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=A4=96=20ci:=20add=20self-hosted=20ol?= =?UTF-8?q?lama=20suite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86bcea98b..bd0e440a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,6 +122,59 @@ jobs: flags: integration-tests fail_ci_if_error: false + integration-test-ollama: + name: Integration Tests (Ollama) + if: github.repository_owner == 'coder' + timeout-minutes: 15 + runs-on: self-hosted + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Required for git describe to find tags + + - uses: ./.github/actions/setup-mux + + - name: Check if Ollama is pre-installed + id: check-ollama + run: | + if systemctl is-active --quiet ollama 2>/dev/null && curl -sf http://localhost:11434/api/tags > /dev/null 2>&1; then + echo "installed=true" >> $GITHUB_OUTPUT + echo "✅ Ollama already running (self-hosted runner)" + else + echo "installed=false" >> $GITHUB_OUTPUT + echo "⚙️ Ollama not found, will install" + fi + + - name: Setup Ollama + if: steps.check-ollama.outputs.installed != 'true' + uses: ./.github/actions/setup-ollama + + - name: Verify Ollama server + run: | + echo "Verifying Ollama server..." + timeout 5 sh -c 'until curl -sf http://localhost:11434/api/tags > /dev/null 2>&1; do sleep 0.2; done' + echo "Ollama ready - integration tests will pull models on demand" + + - name: Build worker files + run: make build-main + + - name: Run Ollama integration tests with coverage + run: TEST_INTEGRATION=1 TEST_OLLAMA=1 bun x jest --coverage --maxWorkers=100% --silent "$TEST_TARGET" + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + OLLAMA_BASE_URL: http://localhost:11434/api + TEST_TARGET: ${{ github.event.inputs.test_filter || 'tests/ipcMain/ollama.test.ts' }} + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage/lcov.info + flags: integration-tests-ollama + fail_ci_if_error: false + storybook-test: name: Storybook Interaction Tests runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} From 765faf24d304ae4285b0b2c9daa4cb1dfc4a60d6 Mon Sep 17 00:00:00 2001 From: Ammar Date: Mon, 24 Nov 2025 12:32:36 -0600 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=A4=96=20ci:=20use=20ollama=20filter?= =?UTF-8?q?=20pattern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd0e440a2..1babb9536 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -165,7 +165,7 @@ jobs: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} OLLAMA_BASE_URL: http://localhost:11434/api - TEST_TARGET: ${{ github.event.inputs.test_filter || 'tests/ipcMain/ollama.test.ts' }} + TEST_TARGET: ${{ github.event.inputs.test_filter || 'ollama' }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 From 276aa498ae6d6f580a1d253dfe6335530bc03b9b Mon Sep 17 00:00:00 2001 From: Ammar Date: Mon, 24 Nov 2025 12:39:43 -0600 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=A4=96=20ci:=20use=20larger=20depot?= =?UTF-8?q?=20runner=20for=20integration=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1babb9536..da2136050 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,7 @@ jobs: integration-test: name: Integration Tests timeout-minutes: 10 - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-24.04-32' || 'ubuntu-latest' }} steps: - name: Checkout code uses: actions/checkout@v4 From 3257aaeb690a28a157ac564c684615d7006c84cc Mon Sep 17 00:00:00 2001 From: Ammar Date: Mon, 24 Nov 2025 12:55:26 -0600 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=A4=96=20fix:=20add=20retries=20to=20?= =?UTF-8?q?flaky=20integration=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/ipcMain/runtimeFileEditing.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/ipcMain/runtimeFileEditing.test.ts b/tests/ipcMain/runtimeFileEditing.test.ts index 3f64640d4..7cc2caa1d 100644 --- a/tests/ipcMain/runtimeFileEditing.test.ts +++ b/tests/ipcMain/runtimeFileEditing.test.ts @@ -68,9 +68,16 @@ let sshConfig: SSHServerConfig | undefined; // ============================================================================ describeIntegration("Runtime File Editing Tools", () => { +<<<<<<< HEAD // Enable retries in CI for flaky API tests configureTestRetries(3); +||||||| parent of 846841cd (🤖 fix: add retries to flaky integration tests) +======= + // Add retries to handle potential AI flakiness (e.g. failing to call tools) + configureTestRetries(3); + +>>>>>>> 846841cd (🤖 fix: add retries to flaky integration tests) beforeAll(async () => { // Check if Docker is available (required for SSH tests) if (!(await isDockerAvailable())) { From 8793b280f6a02bc3f06d897648ac181dd7125a76 Mon Sep 17 00:00:00 2001 From: Ammar Date: Tue, 2 Dec 2025 21:22:56 -0600 Subject: [PATCH 5/5] fix: resolve merge conflict markers --- tests/ipcMain/runtimeFileEditing.test.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/ipcMain/runtimeFileEditing.test.ts b/tests/ipcMain/runtimeFileEditing.test.ts index 7cc2caa1d..3f64640d4 100644 --- a/tests/ipcMain/runtimeFileEditing.test.ts +++ b/tests/ipcMain/runtimeFileEditing.test.ts @@ -68,16 +68,9 @@ let sshConfig: SSHServerConfig | undefined; // ============================================================================ describeIntegration("Runtime File Editing Tools", () => { -<<<<<<< HEAD // Enable retries in CI for flaky API tests configureTestRetries(3); -||||||| parent of 846841cd (🤖 fix: add retries to flaky integration tests) -======= - // Add retries to handle potential AI flakiness (e.g. failing to call tools) - configureTestRetries(3); - ->>>>>>> 846841cd (🤖 fix: add retries to flaky integration tests) beforeAll(async () => { // Check if Docker is available (required for SSH tests) if (!(await isDockerAvailable())) {