Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test #142

Merged
merged 27 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/elixir-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--max-cases 1 has no effect here. ExUnit will run async: true modules in parallel with each other, but runs the tests within each module in series. Since there is only one module (aka case) with the integration tag, there will only be one case being run no matter what.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You right but If I remove --max-cases 1, it seems the integration test can be broken again 😒
I'll just keep it like this.

mix coveralls --exclude integration --warnings-as-errors --import-cover cover

- name: Upload coverage report
run: bash <(curl -s https://codecov.io/bash)
Expand Down
5 changes: 4 additions & 1 deletion test/config_cat_test.exs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/integration_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading