From 6e504f72095ff5f7dd0515d605fa7fa883df3823 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sun, 3 Aug 2025 15:41:28 -0500 Subject: [PATCH] fix: Configure Wallaby integration tests for GitHub CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Wallaby integration tests were timing out in CI. This adds proper configuration for running browser tests in the CI environment. Changes: - Start ChromeDriver explicitly in the background on port 4444 - Pass CHROMEDRIVER_URL environment variable to tests - Add chromedriver_base_url configuration to use env var if available - Increase test timeout to 60 seconds for integration tests - Add additional Chrome flags for better CI stability: - --disable-setuid-sandbox - --disable-extensions - --disable-background-timer-throttling - --disable-backgrounding-occluded-windows - --disable-renderer-backgrounding These changes ensure ChromeDriver is properly started and accessible in the CI environment, preventing connection timeouts. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/elixir.yaml | 7 +++++++ config/test.exs | 9 ++++++++- test/integration/historical_loading_integration_test.exs | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/elixir.yaml b/.github/workflows/elixir.yaml index 188aaf8..12505e3 100644 --- a/.github/workflows/elixir.yaml +++ b/.github/workflows/elixir.yaml @@ -120,6 +120,12 @@ jobs: uses: nanasess/setup-chromedriver@v2 # Note: Using latest stable version instead of pinned version for better compatibility + # Step: Start ChromeDriver in the background + - name: Start ChromeDriver + run: | + chromedriver --port=4444 --url-base=/wd/hub & + sleep 2 + # Step: Execute the tests. - name: Run tests run: mix test @@ -132,3 +138,4 @@ jobs: # Increase timeouts for browser tests in CI environment WALLABY_SCREENSHOT_ON_FAILURE: true WALLABY_MAX_WAIT_TIME: 30000 + CHROMEDRIVER_URL: http://localhost:4444/wd/hub diff --git a/config/test.exs b/config/test.exs index af0c485..39acc02 100644 --- a/config/test.exs +++ b/config/test.exs @@ -95,6 +95,11 @@ config :wallaby, "--no-sandbox", "--disable-dev-shm-usage", "--disable-gpu", + "--disable-setuid-sandbox", + "--disable-extensions", + "--disable-background-timer-throttling", + "--disable-backgrounding-occluded-windows", + "--disable-renderer-backgrounding", "--window-size=1280,720" ] ], @@ -104,4 +109,6 @@ config :wallaby, # Increase default timeouts for CI environment max_wait_time: "WALLABY_MAX_WAIT_TIME" |> System.get_env("5000") |> String.to_integer(), # Pool configuration for concurrent tests - pool_size: 1 + pool_size: 1, + # Use ChromeDriver URL from environment if available (for CI) + chromedriver_base_url: System.get_env("CHROMEDRIVER_URL") diff --git a/test/integration/historical_loading_integration_test.exs b/test/integration/historical_loading_integration_test.exs index 249ea3d..eb82087 100644 --- a/test/integration/historical_loading_integration_test.exs +++ b/test/integration/historical_loading_integration_test.exs @@ -31,6 +31,7 @@ defmodule AprsmeWeb.HistoricalLoadingIntegrationTest do describe "historical packet loading on page load" do @describetag :integration + @describetag timeout: 60_000 feature "displays historical packets immediately after map loads", %{session: session} do # Create test packets with known positions now = DateTime.utc_now()