From: Alex Gleason Date: Wed, 22 Dec 2021 04:04:15 +0000 (-0600) Subject: Skip erratic tests X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=2ce7dae6de793f62b1e8e50492615dc28b9ab6fc;p=akkoma Skip erratic tests --- diff --git a/test/pleroma/config/transfer_task_test.exs b/test/pleroma/config/transfer_task_test.exs index 7d51fd84c..9e3f11f1a 100644 --- a/test/pleroma/config/transfer_task_test.exs +++ b/test/pleroma/config/transfer_task_test.exs @@ -82,6 +82,7 @@ defmodule Pleroma.Config.TransferTaskTest do on_exit(fn -> Restarter.Pleroma.refresh() end) end + @tag :erratic test "don't restart if no reboot time settings were changed" do clear_config(:emoji) insert(:config, key: :emoji, value: [groups: [a: 1, b: 2]]) @@ -92,18 +93,21 @@ defmodule Pleroma.Config.TransferTaskTest do ) end + @tag :erratic test "on reboot time key" do clear_config(:shout) insert(:config, key: :shout, value: [enabled: false]) assert capture_log(fn -> TransferTask.start_link([]) end) =~ "pleroma restarted" end + @tag :erratic test "on reboot time subkey" do clear_config(Pleroma.Captcha) insert(:config, key: Pleroma.Captcha, value: [seconds_valid: 60]) assert capture_log(fn -> TransferTask.start_link([]) end) =~ "pleroma restarted" end + @tag :erratic test "don't restart pleroma on reboot time key and subkey if there is false flag" do clear_config(:shout) clear_config(Pleroma.Captcha) diff --git a/test/pleroma/web/plugs/rate_limiter_test.exs b/test/pleroma/web/plugs/rate_limiter_test.exs index d007e3f26..b7cfde1f7 100644 --- a/test/pleroma/web/plugs/rate_limiter_test.exs +++ b/test/pleroma/web/plugs/rate_limiter_test.exs @@ -48,6 +48,7 @@ defmodule Pleroma.Web.Plugs.RateLimiterTest do refute RateLimiter.disabled?(build_conn()) end + @tag :erratic test "it restricts based on config values" do limiter_name = :test_plug_opts scale = 80 @@ -137,6 +138,7 @@ defmodule Pleroma.Web.Plugs.RateLimiterTest do end describe "unauthenticated users" do + @tag :erratic test "are restricted based on remote IP" do limiter_name = :test_unauthenticated clear_config([:rate_limit, limiter_name], [{1000, 5}, {1, 10}]) @@ -174,6 +176,7 @@ defmodule Pleroma.Web.Plugs.RateLimiterTest do :ok end + @tag :erratic test "can have limits separate from unauthenticated connections" do limiter_name = :test_authenticated1 @@ -199,6 +202,7 @@ defmodule Pleroma.Web.Plugs.RateLimiterTest do assert conn.halted end + @tag :erratic test "different users are counted independently" do limiter_name = :test_authenticated2 clear_config([:rate_limit, limiter_name], [{1, 10}, {1000, 5}]) diff --git a/test/test_helper.exs b/test/test_helper.exs index 0c9783076..9fb41e985 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only os_exclude = if :os.type() == {:unix, :darwin}, do: [skip_on_mac: true], else: [] -ExUnit.start(exclude: [:federated | os_exclude]) +ExUnit.start(exclude: [:federated, :erratic] ++ os_exclude) Ecto.Adapters.SQL.Sandbox.mode(Pleroma.Repo, :manual)