From 918142ca4198b01ba9b12b5d1ea5c69557595eaa Mon Sep 17 00:00:00 2001 From: Chase Pursley Date: Wed, 27 Dec 2023 15:28:26 -0500 Subject: [PATCH] Exclude certain tests for CI test runners. --- .github/workflows/elixir.yml | 2 +- test/walex/config/config_test.exs | 15 +++++++++++++++ test/walex/config/registry_test.exs | 1 + test/walex/database_test.exs | 4 ++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index 7866dd9..cd4e9cf 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -36,4 +36,4 @@ jobs: - name: Install dependencies run: mix deps.get - name: Run tests - run: mix test + run: mix test --exclude skip_ci diff --git a/test/walex/config/config_test.exs b/test/walex/config/config_test.exs index 3003fec..bea0007 100644 --- a/test/walex/config/config_test.exs +++ b/test/walex/config/config_test.exs @@ -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, @@ -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"], @@ -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() @@ -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", @@ -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") @@ -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", @@ -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] @@ -187,6 +196,7 @@ defmodule WalEx.ConfigTest do :ok end + @tag :skip_ci test "should create list of modules from subscriptions config when no modules" do subscriptions = ["subscriptions"] @@ -194,12 +204,14 @@ defmodule WalEx.ConfigTest do 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] @@ -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 diff --git a/test/walex/config/registry_test.exs b/test/walex/config/registry_test.exs index 4d56dc9..53537bc 100644 --- a/test/walex/config/registry_test.exs +++ b/test/walex/config/registry_test.exs @@ -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) diff --git a/test/walex/database_test.exs b/test/walex/database_test.exs index a50ff04..6400b64 100644 --- a/test/walex/database_test.exs +++ b/test/walex/database_test.exs @@ -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;" @@ -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())