From abb9eb6afe06d273f28a4fa01e8bb589e102e379 Mon Sep 17 00:00:00 2001 From: Peter Adam Korodi <52385411+kp-cat@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:21:30 +0100 Subject: [PATCH] Fix test (#142) * fix test * comment out block test * remove commented block * async: false test comment * comment out block test * test trace * validate sdk integration test turned off * remove trace from github CI * block test is back * - block test + test trace * print Registry entry * add registry items to warning message * message fix * test finished log * allow IO.puts * print registry * clear registry before all test * add extra print_registry_contents * cleanup * move block test into integration test * fix module in integration_test * revert clear_registry + inline using_block_test * run CI tests with max-cases 1 * run CI integration tests with max-cases 1 * CI: merge coverall reports * remove max-cases 1 * Revert "remove max-cases 1" This reverts commit 877ed289987c5c89e3b040004a36716e386fda0f. --- .github/workflows/elixir-ci.yml | 4 +++- test/config_cat_test.exs | 5 ++++- test/integration_test.exs | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/elixir-ci.yml b/.github/workflows/elixir-ci.yml index b42aac3..fc0e5af 100644 --- a/.github/workflows/elixir-ci.yml +++ b/.github/workflows/elixir-ci.yml @@ -58,7 +58,9 @@ jobs: run: mix dialyzer - name: Execute tests - run: mix coveralls.json --warnings-as-errors + run: | + mix test --only integration --warnings-as-errors --max-cases 1 --cover --export-coverage integration-coverage + mix coveralls --exclude integration --warnings-as-errors --import-cover cover - name: Upload coverage report run: bash <(curl -s https://codecov.io/bash) diff --git a/test/config_cat_test.exs b/test/config_cat_test.exs index 9253e82..4503312 100644 --- a/test/config_cat_test.exs +++ b/test/config_cat_test.exs @@ -1,5 +1,8 @@ defmodule ConfigCatTest do - use ConfigCat.ClientCase, async: true + # Must be async: false to avoid a collision with other tests. + # Now that we only allow a single ConfigCat instance to use the same SDK key, + # one of the async tests would fail due to the existing running instance. + use ConfigCat.ClientCase, async: false import ExUnit.CaptureLog import Jason.Sigil diff --git a/test/integration_test.exs b/test/integration_test.exs index 78b687b..44d5d3d 100644 --- a/test/integration_test.exs +++ b/test/integration_test.exs @@ -9,6 +9,8 @@ defmodule ConfigCat.IntegrationTest do alias ConfigCat.InMemoryCache alias ConfigCat.LocalMapDataSource + @moduletag :integration + @sdk_key "configcat-sdk-1/PKDVCLf-Hq-h-kCzMp-L7Q/1cGEJXUwYUGZCBOL-E2sOw" describe "SDK key validation" do