diff --git a/.github/workflows/elixir.yaml b/.github/workflows/elixir.yaml index 6efb23d..188aaf8 100644 --- a/.github/workflows/elixir.yaml +++ b/.github/workflows/elixir.yaml @@ -118,8 +118,7 @@ jobs: # Step: Install ChromeDriver for integration tests - name: Setup ChromeDriver uses: nanasess/setup-chromedriver@v2 - with: - chromedriver-version: '119.0.6045.105' + # Note: Using latest stable version instead of pinned version for better compatibility # Step: Execute the tests. - name: Run tests @@ -128,3 +127,8 @@ jobs: # Step: Run integration tests separately with Wallaby - name: Run integration tests run: mix test --only integration + timeout-minutes: 10 + env: + # Increase timeouts for browser tests in CI environment + WALLABY_SCREENSHOT_ON_FAILURE: true + WALLABY_MAX_WAIT_TIME: 30000 diff --git a/config/test.exs b/config/test.exs index a3ee755..dcbf15b 100644 --- a/config/test.exs +++ b/config/test.exs @@ -83,7 +83,20 @@ config :swoosh, :api_client, false # Configure Wallaby config :wallaby, driver: Wallaby.Chrome, - chromedriver: [headless: true], + chromedriver: [ + headless: true, + # Additional Chrome options for CI stability + args: [ + "--no-sandbox", + "--disable-dev-shm-usage", + "--disable-gpu", + "--window-size=1280,720" + ] + ], screenshot_on_failure: true, screenshot_dir: "test/screenshots", - base_url: "http://localhost:4002" + base_url: "http://localhost:4002", + # 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 diff --git a/test/integration/map_integration_test.exs b/test/integration/map_integration_test.exs index 6e21cfc..ae8c118 100644 --- a/test/integration/map_integration_test.exs +++ b/test/integration/map_integration_test.exs @@ -9,13 +9,14 @@ defmodule AprsmeWeb.MapIntegrationTest do import Wallaby.Browser alias Aprsme.Repo + alias Ecto.Adapters.SQL.Sandbox alias Wallaby.Query @moduletag :integration setup do - :ok = Ecto.Adapters.SQL.Sandbox.checkout(Repo) - Ecto.Adapters.SQL.Sandbox.mode(Repo, {:shared, self()}) + :ok = Sandbox.checkout(Repo) + Sandbox.mode(Repo, {:shared, self()}) {:ok, %{}} end @@ -38,4 +39,4 @@ defmodule AprsmeWeb.MapIntegrationTest do |> visit("/info") |> assert_has(Query.css("body")) end -end \ No newline at end of file +end diff --git a/test/integration/simple_integration_test.exs b/test/integration/simple_integration_test.exs index cde6a5c..5845f4b 100644 --- a/test/integration/simple_integration_test.exs +++ b/test/integration/simple_integration_test.exs @@ -6,14 +6,15 @@ defmodule AprsmeWeb.SimpleIntegrationTest do use Wallaby.Feature import Wallaby.Browser - + + alias Ecto.Adapters.SQL.Sandbox alias Wallaby.Query @moduletag :integration setup do - :ok = Ecto.Adapters.SQL.Sandbox.checkout(Aprsme.Repo) - Ecto.Adapters.SQL.Sandbox.mode(Aprsme.Repo, {:shared, self()}) + :ok = Sandbox.checkout(Aprsme.Repo) + Sandbox.mode(Aprsme.Repo, {:shared, self()}) {:ok, %{}} end @@ -22,4 +23,4 @@ defmodule AprsmeWeb.SimpleIntegrationTest do |> visit("/") |> assert_has(Query.text("APRS")) end -end \ No newline at end of file +end