Skip to content

Commit

Permalink
Exclude certain tests for CI test runners.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpursley committed Dec 27, 2023
1 parent 89c45d0 commit 918142c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
- name: Install dependencies
run: mix deps.get
- name: Run tests
run: mix test
run: mix test --exclude skip_ci
15 changes: 15 additions & 0 deletions test/walex/config/config_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ defmodule WalEx.ConfigTest do
end

describe "start_link/2" do
@tag :skip_ci
test "should start a process" do
assert {:ok, pid} = Config.start_link(configs: get_base_configs())

assert is_pid(pid)
end

@tag :skip_ci
test "should accept database url as config and split it into the right configs" do
configs = [
name: :test_name,
Expand Down Expand Up @@ -80,10 +82,12 @@ defmodule WalEx.ConfigTest do
:ok
end

@tag :skip_ci
test "should return only selected configs when second parameter is an atom" do
assert ["subscriptions"] == Config.get_configs(:test_name, :subscriptions)
end

@tag :skip_ci
test "should return only selected configs when second parameter is a list" do
assert [
modules: [MyApp.CustomModule, :"TestName.Events.Subscriptions"],
Expand All @@ -94,6 +98,7 @@ defmodule WalEx.ConfigTest do
Config.get_configs(:test_name, [:modules, :hostname, :ssl, :ssl_opts])
end

@tag :skip_ci
test "should filter configs by process name" do
configs =
get_base_configs()
Expand Down Expand Up @@ -126,6 +131,7 @@ defmodule WalEx.ConfigTest do
:ok
end

@tag :skip_ci
test "should add new values when new_values is a list" do
Config.add_config(:test_name, :subscriptions, [
"new_subscriptions_1",
Expand All @@ -136,6 +142,7 @@ defmodule WalEx.ConfigTest do
Config.get_configs(:test_name)[:subscriptions]
end

@tag :skip_ci
test "should add new values when new_value is not a list" do
Config.add_config(:test_name, :subscriptions, "new_subscriptions")

Expand All @@ -150,6 +157,7 @@ defmodule WalEx.ConfigTest do
:ok
end

@tag :skip_ci
test "should remove existing value from list if it exists" do
Config.add_config(:test_name, :subscriptions, [
"new_subscriptions_1",
Expand All @@ -172,6 +180,7 @@ defmodule WalEx.ConfigTest do
:ok
end

@tag :skip_ci
test "should replace existing value when value is not a list" do
assert "password" == Config.get_configs(:test_name)[:password]

Expand All @@ -187,19 +196,22 @@ defmodule WalEx.ConfigTest do
:ok
end

@tag :skip_ci
test "should create list of modules from subscriptions config when no modules" do
subscriptions = ["subscriptions"]

assert [:"TestName.Events.Subscriptions"] ==
Config.build_module_names(:test_name, [], subscriptions)
end

@tag :skip_ci
test "should create list of modules from modules config when no subscriptions" do
modules = [MyApp.CustomModule]

assert modules == Config.build_module_names(:test_name, modules, [])
end

@tag :skip_ci
test "should create list of modules when both modules and subscriptions config" do
subscriptions = ["subscriptions"]
modules = [MyApp.CustomModule]
Expand All @@ -215,14 +227,17 @@ defmodule WalEx.ConfigTest do
:ok
end

@tag :skip_ci
test "should convert standard atom into Module atom" do
assert "TestName" == Config.to_module_name(:test_name)
end

@tag :skip_ci
test "should convert binary string into Module atom" do
assert "TestName" == Config.to_module_name("test_name")
end

@tag :skip_ci
test "should convert remove 'Elixir.' from module name" do
assert "TestName" == Config.to_module_name(:"Elixir.TestName")
end
Expand Down
1 change: 1 addition & 0 deletions test/walex/config/registry_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ defmodule WalEx.Config.RegistryTest do
:ok
end

@tag :skip_ci
test "should set agent state" do
name = WalExRegistry.set_name(:set_agent, __MODULE__, :app_name_test)

Expand Down
4 changes: 2 additions & 2 deletions test/walex/database_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule WalEx.DatabaseTest do
@test_database "todos_test"

describe "logical replication" do
@tag :skip
@tag :skip_ci
test "should have logical replication set up" do
{:ok, pid} = start_database()
show_wall_level = "SHOW wal_level;"
Expand All @@ -15,7 +15,7 @@ defmodule WalEx.DatabaseTest do
assert [%{"wal_level" => "logical"}] == query(pid, show_wall_level)
end

@tag :skip
@tag :skip_ci
test "should start replication slot" do
# Is starting link necessary (I think so as it creates the slot)
assert {:ok, replication_pid} = WalExSupervisor.start_link(get_configs())
Expand Down

0 comments on commit 918142c

Please sign in to comment.