From 64e233ca20144f48305b0a1624e52e51ce277814 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Fri, 4 Aug 2023 12:50:50 +0100 Subject: [PATCH] Tag `Mock`-tests as "mocked" and run them seperately --- .woodpecker/test.yml | 3 ++- lib/pleroma/object/fetcher.ex | 5 +++++ test/mix/tasks/pleroma/ecto/migrate_test.exs | 2 +- test/mix/tasks/pleroma/uploads_test.exs | 1 + test/mix/tasks/pleroma/user_test.exs | 1 + test/pleroma/activity/ir/topics_test.exs | 1 + test/pleroma/akkoma/translators/argos_translate_test.exs | 3 ++- test/pleroma/application_requirements_test.exs | 1 + test/pleroma/config_db_test.exs | 4 ++-- test/pleroma/notification_test.exs | 1 + test/pleroma/object/fetcher_test.exs | 1 + test/pleroma/search/elasticsearch_test.exs | 1 + test/pleroma/search/meilisearch_test.exs | 1 + test/pleroma/signature_test.exs | 1 + test/pleroma/upload/filter/mogrifun_test.exs | 2 ++ test/pleroma/upload/filter/mogrify_test.exs | 1 + test/pleroma/uploaders/s3_test.exs | 1 + test/pleroma/user/backup_test.exs | 1 + test/pleroma/user_relationship_test.exs | 1 + test/pleroma/web/activity_pub/activity_pub_test.exs | 1 + .../web/activity_pub/mrf/media_proxy_warming_policy_test.exs | 1 + test/pleroma/web/activity_pub/publisher_test.exs | 1 + test/pleroma/web/activity_pub/relay_test.exs | 1 + test/pleroma/web/activity_pub/side_effects_test.exs | 1 + .../web/activity_pub/transmogrifier/follow_handling_test.exs | 1 + .../web/activity_pub/transmogrifier/note_handling_test.exs | 1 + test/pleroma/web/activity_pub/transmogrifier_test.exs | 4 ++-- .../controllers/media_proxy_cache_controller_test.exs | 1 + .../web/admin_api/controllers/user_controller_test.exs | 1 + test/pleroma/web/common_api_test.exs | 1 + test/pleroma/web/federator_test.exs | 1 + .../web/mastodon_api/controllers/filter_controller_test.exs | 1 + .../web/mastodon_api/controllers/search_controller_test.exs | 1 + test/pleroma/web/mastodon_api/update_credentials_test.exs | 1 + test/pleroma/web/mastodon_api/views/account_view_test.exs | 1 + test/pleroma/web/media_proxy/invalidation_test.exs | 1 + test/pleroma/web/media_proxy/media_proxy_controller_test.exs | 1 + test/pleroma/web/o_auth/ldap_authorization_test.exs | 1 + .../pleroma_api/controllers/emoji_file_controller_test.exs | 1 + .../pleroma_api/controllers/emoji_pack_controller_test.exs | 1 + .../pleroma_api/controllers/user_import_controller_test.exs | 1 + .../web/plugs/admin_secret_authentication_plug_test.exs | 1 + test/pleroma/web/plugs/frontend_static_plug_test.exs | 1 + test/pleroma/web/plugs/http_signature_plug_test.exs | 1 + test/pleroma/web/plugs/o_auth_scopes_plug_test.exs | 1 + test/pleroma/web/plugs/plug_helper_test.exs | 1 + test/pleroma/web/static_fe/static_fe_controller_test.exs | 1 + test/pleroma/web/twitter_api/util_controller_test.exs | 1 + test/pleroma/workers/receiver_worker_test.exs | 1 + 49 files changed, 58 insertions(+), 7 deletions(-) diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml index 66b4a2b33..be8ea0dfa 100644 --- a/.woodpecker/test.yml +++ b/.woodpecker/test.yml @@ -110,4 +110,5 @@ pipeline: - mix ecto.create - mix ecto.migrate - mkdir -p test/tmp - - mix test --preload-modules --exclude erratic --exclude federated + - mix test --preload-modules --exclude erratic --exclude federated --exclude mocked + - mix test --preload-modules --only mocked diff --git a/lib/pleroma/object/fetcher.ex b/lib/pleroma/object/fetcher.ex index aeaf05986..9e62ca69f 100644 --- a/lib/pleroma/object/fetcher.ex +++ b/lib/pleroma/object/fetcher.ex @@ -117,6 +117,8 @@ defmodule Pleroma.Object.Fetcher do # Note: will create a Create activity, which we need internally at the moment. def fetch_object_from_id(id, options \\ []) do with %URI{} = uri <- URI.parse(id), + # let's check the URI is even vaguely valid first + {:scheme, true} <- {:scheme, uri.scheme == "http" or uri.scheme == "https"}, # If we have instance restrictions, apply them here to prevent fetching from unwanted instances {:ok, nil} <- Pleroma.Web.ActivityPub.MRF.SimplePolicy.check_reject(uri), {:ok, _} <- Pleroma.Web.ActivityPub.MRF.SimplePolicy.check_accept(uri), @@ -135,6 +137,9 @@ defmodule Pleroma.Object.Fetcher do {:allowed_depth, false} -> {:error, "Max thread distance exceeded."} + {:scheme, false} -> + {:error, "URI Scheme Invalid"} + {:containment, _} -> {:error, "Object containment failed."} diff --git a/test/mix/tasks/pleroma/ecto/migrate_test.exs b/test/mix/tasks/pleroma/ecto/migrate_test.exs index 3bfdde1c0..d60a172ff 100644 --- a/test/mix/tasks/pleroma/ecto/migrate_test.exs +++ b/test/mix/tasks/pleroma/ecto/migrate_test.exs @@ -9,7 +9,7 @@ defmodule Mix.Tasks.Pleroma.Ecto.MigrateTest do test "ecto.migrate info message" do level = Logger.level() - Logger.configure(level: :warn) + Logger.configure(level: :warning) assert capture_log(fn -> Mix.Tasks.Pleroma.Ecto.Migrate.run() diff --git a/test/mix/tasks/pleroma/uploads_test.exs b/test/mix/tasks/pleroma/uploads_test.exs index 5976255e1..4a6800099 100644 --- a/test/mix/tasks/pleroma/uploads_test.exs +++ b/test/mix/tasks/pleroma/uploads_test.exs @@ -5,6 +5,7 @@ defmodule Mix.Tasks.Pleroma.UploadsTest do alias Pleroma.Upload use Pleroma.DataCase, async: false + @moduletag :mocked import Mock diff --git a/test/mix/tasks/pleroma/user_test.exs b/test/mix/tasks/pleroma/user_test.exs index 219490708..414b87bec 100644 --- a/test/mix/tasks/pleroma/user_test.exs +++ b/test/mix/tasks/pleroma/user_test.exs @@ -15,6 +15,7 @@ defmodule Mix.Tasks.Pleroma.UserTest do use Pleroma.DataCase, async: false use Oban.Testing, repo: Pleroma.Repo + @moduletag :mocked import ExUnit.CaptureIO import Mock diff --git a/test/pleroma/activity/ir/topics_test.exs b/test/pleroma/activity/ir/topics_test.exs index 13cfc9d77..2aa5977c8 100644 --- a/test/pleroma/activity/ir/topics_test.exs +++ b/test/pleroma/activity/ir/topics_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Activity.Ir.TopicsTest do use Pleroma.DataCase, async: false + @moduletag :mocked alias Pleroma.Activity alias Pleroma.Activity.Ir.Topics diff --git a/test/pleroma/akkoma/translators/argos_translate_test.exs b/test/pleroma/akkoma/translators/argos_translate_test.exs index 977df1693..1afb77021 100644 --- a/test/pleroma/akkoma/translators/argos_translate_test.exs +++ b/test/pleroma/akkoma/translators/argos_translate_test.exs @@ -3,7 +3,8 @@ defmodule Pleroma.Akkoma.Translators.ArgosTranslateTest do import Mock - use Pleroma.DataCase, async: true + use Pleroma.DataCase, async: false + @moduletag :mocked setup do clear_config([:argos_translate, :command_argos_translate], "argos-translate_test") diff --git a/test/pleroma/application_requirements_test.exs b/test/pleroma/application_requirements_test.exs index 297acb63d..586af4d8e 100644 --- a/test/pleroma/application_requirements_test.exs +++ b/test/pleroma/application_requirements_test.exs @@ -6,6 +6,7 @@ defmodule Pleroma.ApplicationRequirementsTest do use Pleroma.DataCase, async: false import ExUnit.CaptureLog + @moduletag :mocked import Mock alias Pleroma.ApplicationRequirements diff --git a/test/pleroma/config_db_test.exs b/test/pleroma/config_db_test.exs index ace347f65..43bb38afe 100644 --- a/test/pleroma/config_db_test.exs +++ b/test/pleroma/config_db_test.exs @@ -428,13 +428,13 @@ defmodule Pleroma.ConfigDBTest do test "common keyword" do assert ConfigDB.to_elixir_types([ - %{"tuple" => [":level", ":warn"]}, + %{"tuple" => [":level", ":warning"]}, %{"tuple" => [":meta", [":all"]]}, %{"tuple" => [":path", ""]}, %{"tuple" => [":val", nil]}, %{"tuple" => [":webhook_url", "https://hooks.slack.com/services/YOUR-KEY-HERE"]} ]) == [ - level: :warn, + level: :warning, meta: [:all], path: "", val: nil, diff --git a/test/pleroma/notification_test.exs b/test/pleroma/notification_test.exs index 69ff27466..c3ba399a6 100644 --- a/test/pleroma/notification_test.exs +++ b/test/pleroma/notification_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.NotificationTest do use Pleroma.DataCase, async: false + @moduletag :mocked import Pleroma.Factory import Mock diff --git a/test/pleroma/object/fetcher_test.exs b/test/pleroma/object/fetcher_test.exs index e4d4fe8a3..8cf0bce48 100644 --- a/test/pleroma/object/fetcher_test.exs +++ b/test/pleroma/object/fetcher_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Object.FetcherTest do use Pleroma.DataCase, async: false + @moduletag :mocked alias Pleroma.Activity alias Pleroma.Instances diff --git a/test/pleroma/search/elasticsearch_test.exs b/test/pleroma/search/elasticsearch_test.exs index 05725f7a7..a1c25c9c3 100644 --- a/test/pleroma/search/elasticsearch_test.exs +++ b/test/pleroma/search/elasticsearch_test.exs @@ -6,6 +6,7 @@ defmodule Pleroma.Search.ElasticsearchTest do require Pleroma.Constants use Pleroma.DataCase, async: false + @moduletag :mocked use Oban.Testing, repo: Pleroma.Repo import Pleroma.Factory diff --git a/test/pleroma/search/meilisearch_test.exs b/test/pleroma/search/meilisearch_test.exs index f51e04eb1..0a39b2004 100644 --- a/test/pleroma/search/meilisearch_test.exs +++ b/test/pleroma/search/meilisearch_test.exs @@ -6,6 +6,7 @@ defmodule Pleroma.Search.MeilisearchTest do require Pleroma.Constants use Pleroma.DataCase, async: false + @moduletag :mocked use Oban.Testing, repo: Pleroma.Repo import Pleroma.Factory diff --git a/test/pleroma/signature_test.exs b/test/pleroma/signature_test.exs index a94610e66..1f52484a5 100644 --- a/test/pleroma/signature_test.exs +++ b/test/pleroma/signature_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.SignatureTest do use Pleroma.DataCase, async: false + @moduletag :mocked import ExUnit.CaptureLog import Pleroma.Factory diff --git a/test/pleroma/upload/filter/mogrifun_test.exs b/test/pleroma/upload/filter/mogrifun_test.exs index 5a21017fa..54cb75e18 100644 --- a/test/pleroma/upload/filter/mogrifun_test.exs +++ b/test/pleroma/upload/filter/mogrifun_test.exs @@ -4,6 +4,8 @@ defmodule Pleroma.Upload.Filter.MogrifunTest do use Pleroma.DataCase, async: false + @moduletag :mocked + import Mock alias Pleroma.Upload diff --git a/test/pleroma/upload/filter/mogrify_test.exs b/test/pleroma/upload/filter/mogrify_test.exs index 5e029a2ab..1f4ca4d37 100644 --- a/test/pleroma/upload/filter/mogrify_test.exs +++ b/test/pleroma/upload/filter/mogrify_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Upload.Filter.MogrifyTest do use Pleroma.DataCase, async: false + @moduletag :mocked import Mock alias Pleroma.Upload.Filter diff --git a/test/pleroma/uploaders/s3_test.exs b/test/pleroma/uploaders/s3_test.exs index 215bb74f6..804710509 100644 --- a/test/pleroma/uploaders/s3_test.exs +++ b/test/pleroma/uploaders/s3_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Uploaders.S3Test do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked alias Pleroma.Uploaders.S3 diff --git a/test/pleroma/user/backup_test.exs b/test/pleroma/user/backup_test.exs index 94b499711..9c4c8089c 100644 --- a/test/pleroma/user/backup_test.exs +++ b/test/pleroma/user/backup_test.exs @@ -5,6 +5,7 @@ defmodule Pleroma.User.BackupTest do use Oban.Testing, repo: Pleroma.Repo use Pleroma.DataCase, async: false + @moduletag :mocked import Mock import Pleroma.Factory diff --git a/test/pleroma/user_relationship_test.exs b/test/pleroma/user_relationship_test.exs index b3a0dbe37..dcd001cdd 100644 --- a/test/pleroma/user_relationship_test.exs +++ b/test/pleroma/user_relationship_test.exs @@ -6,6 +6,7 @@ defmodule Pleroma.UserRelationshipTest do alias Pleroma.UserRelationship use Pleroma.DataCase, async: false + @moduletag :mocked import Mock import Pleroma.Factory diff --git a/test/pleroma/web/activity_pub/activity_pub_test.exs b/test/pleroma/web/activity_pub/activity_pub_test.exs index e67c80760..d4d1c2aac 100644 --- a/test/pleroma/web/activity_pub/activity_pub_test.exs +++ b/test/pleroma/web/activity_pub/activity_pub_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do use Pleroma.DataCase, async: false + @moduletag :mocked use Oban.Testing, repo: Pleroma.Repo alias Pleroma.Activity diff --git a/test/pleroma/web/activity_pub/mrf/media_proxy_warming_policy_test.exs b/test/pleroma/web/activity_pub/mrf/media_proxy_warming_policy_test.exs index 8bacedf27..e759b3fda 100644 --- a/test/pleroma/web/activity_pub/mrf/media_proxy_warming_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/media_proxy_warming_policy_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicyTest do use ExUnit.Case, async: false + @moduletag :mocked use Pleroma.Tests.Helpers alias Pleroma.HTTP diff --git a/test/pleroma/web/activity_pub/publisher_test.exs b/test/pleroma/web/activity_pub/publisher_test.exs index 97812179b..d993ab1d4 100644 --- a/test/pleroma/web/activity_pub/publisher_test.exs +++ b/test/pleroma/web/activity_pub/publisher_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked import ExUnit.CaptureLog import Pleroma.Factory diff --git a/test/pleroma/web/activity_pub/relay_test.exs b/test/pleroma/web/activity_pub/relay_test.exs index db3291aff..920aef9da 100644 --- a/test/pleroma/web/activity_pub/relay_test.exs +++ b/test/pleroma/web/activity_pub/relay_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.ActivityPub.RelayTest do use Pleroma.DataCase, async: false + @moduletag :mocked alias Pleroma.Activity alias Pleroma.User diff --git a/test/pleroma/web/activity_pub/side_effects_test.exs b/test/pleroma/web/activity_pub/side_effects_test.exs index 9b1a2296a..80714b1db 100644 --- a/test/pleroma/web/activity_pub/side_effects_test.exs +++ b/test/pleroma/web/activity_pub/side_effects_test.exs @@ -5,6 +5,7 @@ defmodule Pleroma.Web.ActivityPub.SideEffectsTest do use Oban.Testing, repo: Pleroma.Repo use Pleroma.DataCase, async: false + @moduletag :mocked alias Pleroma.Activity alias Pleroma.Notification diff --git a/test/pleroma/web/activity_pub/transmogrifier/follow_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/follow_handling_test.exs index 4caf18435..33b9657d5 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/follow_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/follow_handling_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.FollowHandlingTest do use Pleroma.DataCase, async: false + @moduletag :mocked alias Pleroma.Activity alias Pleroma.Notification alias Pleroma.Repo diff --git a/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs index f465b5cd1..16ee31483 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs @@ -5,6 +5,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.NoteHandlingTest do use Oban.Testing, repo: Pleroma.Repo use Pleroma.DataCase, async: false + @moduletag :mocked alias Pleroma.Activity alias Pleroma.Object diff --git a/test/pleroma/web/activity_pub/transmogrifier_test.exs b/test/pleroma/web/activity_pub/transmogrifier_test.exs index 62472231b..e473ae659 100644 --- a/test/pleroma/web/activity_pub/transmogrifier_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier_test.exs @@ -5,7 +5,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do use Oban.Testing, repo: Pleroma.Repo use Pleroma.DataCase, async: false - + @moduletag :mocked alias Pleroma.Activity alias Pleroma.Object alias Pleroma.Tests.ObanHelpers @@ -536,7 +536,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do test "returns nil when cannot normalize object" do assert capture_log(fn -> refute Transmogrifier.get_obj_helper("test-obj-id") - end) =~ "Unsupported URI scheme" + end) =~ "URI Scheme Invalid" end @tag capture_log: true diff --git a/test/pleroma/web/admin_api/controllers/media_proxy_cache_controller_test.exs b/test/pleroma/web/admin_api/controllers/media_proxy_cache_controller_test.exs index 5842c37d4..82faa6162 100644 --- a/test/pleroma/web/admin_api/controllers/media_proxy_cache_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/media_proxy_cache_controller_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.AdminAPI.MediaProxyCacheControllerTest do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked import Pleroma.Factory import Mock diff --git a/test/pleroma/web/admin_api/controllers/user_controller_test.exs b/test/pleroma/web/admin_api/controllers/user_controller_test.exs index 6e99fb2ba..ba6465630 100644 --- a/test/pleroma/web/admin_api/controllers/user_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/user_controller_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.AdminAPI.UserControllerTest do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked use Oban.Testing, repo: Pleroma.Repo import Mock diff --git a/test/pleroma/web/common_api_test.exs b/test/pleroma/web/common_api_test.exs index 6a95d8023..f2675ad01 100644 --- a/test/pleroma/web/common_api_test.exs +++ b/test/pleroma/web/common_api_test.exs @@ -5,6 +5,7 @@ defmodule Pleroma.Web.CommonAPITest do use Oban.Testing, repo: Pleroma.Repo use Pleroma.DataCase, async: false + @moduletag :mocked alias Pleroma.Activity alias Pleroma.Conversation.Participation diff --git a/test/pleroma/web/federator_test.exs b/test/pleroma/web/federator_test.exs index 394ab329e..76a7a6d37 100644 --- a/test/pleroma/web/federator_test.exs +++ b/test/pleroma/web/federator_test.exs @@ -10,6 +10,7 @@ defmodule Pleroma.Web.FederatorTest do alias Pleroma.Workers.PublisherWorker use Pleroma.DataCase, async: false + @moduletag :mocked use Oban.Testing, repo: Pleroma.Repo import Pleroma.Factory diff --git a/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs index 1d8a67e6b..916b02d0c 100644 --- a/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.MastodonAPI.FilterControllerTest do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked use Oban.Testing, repo: Pleroma.Repo import Mock diff --git a/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs index 3dc56c3bf..6a0d25058 100644 --- a/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked alias Pleroma.Web.CommonAPI alias Pleroma.Web.Endpoint diff --git a/test/pleroma/web/mastodon_api/update_credentials_test.exs b/test/pleroma/web/mastodon_api/update_credentials_test.exs index 2e80b6f6b..a347c7987 100644 --- a/test/pleroma/web/mastodon_api/update_credentials_test.exs +++ b/test/pleroma/web/mastodon_api/update_credentials_test.exs @@ -7,6 +7,7 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do alias Pleroma.User use Pleroma.Web.ConnCase, async: false + @moduletag :mocked import Mock import Pleroma.Factory diff --git a/test/pleroma/web/mastodon_api/views/account_view_test.exs b/test/pleroma/web/mastodon_api/views/account_view_test.exs index 192af936a..5b8aea8ac 100644 --- a/test/pleroma/web/mastodon_api/views/account_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/account_view_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do use Pleroma.DataCase, async: false + @moduletag :mocked alias Pleroma.User alias Pleroma.UserRelationship diff --git a/test/pleroma/web/media_proxy/invalidation_test.exs b/test/pleroma/web/media_proxy/invalidation_test.exs index ac62ba3e7..b10e2271b 100644 --- a/test/pleroma/web/media_proxy/invalidation_test.exs +++ b/test/pleroma/web/media_proxy/invalidation_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.MediaProxy.InvalidationTest do use Pleroma.DataCase, async: false + @moduletag :mocked alias Pleroma.Web.MediaProxy.Invalidation diff --git a/test/pleroma/web/media_proxy/media_proxy_controller_test.exs b/test/pleroma/web/media_proxy/media_proxy_controller_test.exs index 64287c4bd..30c144917 100644 --- a/test/pleroma/web/media_proxy/media_proxy_controller_test.exs +++ b/test/pleroma/web/media_proxy/media_proxy_controller_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyControllerTest do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked import Mock diff --git a/test/pleroma/web/o_auth/ldap_authorization_test.exs b/test/pleroma/web/o_auth/ldap_authorization_test.exs index 1bca3c35e..136e4edb2 100644 --- a/test/pleroma/web/o_auth/ldap_authorization_test.exs +++ b/test/pleroma/web/o_auth/ldap_authorization_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.OAuth.LDAPAuthorizationTest do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked alias Pleroma.Repo alias Pleroma.Web.OAuth.Token import Pleroma.Factory diff --git a/test/pleroma/web/pleroma_api/controllers/emoji_file_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/emoji_file_controller_test.exs index ceff6eaa5..78ca5098f 100644 --- a/test/pleroma/web/pleroma_api/controllers/emoji_file_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/emoji_file_controller_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked import Mock import Tesla.Mock diff --git a/test/pleroma/web/pleroma_api/controllers/emoji_pack_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/emoji_pack_controller_test.exs index 95498d412..b773370d8 100644 --- a/test/pleroma/web/pleroma_api/controllers/emoji_pack_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/emoji_pack_controller_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiPackControllerTest do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked import Mock import Tesla.Mock diff --git a/test/pleroma/web/pleroma_api/controllers/user_import_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/user_import_controller_test.exs index 701ff6a84..3f3dc1d38 100644 --- a/test/pleroma/web/pleroma_api/controllers/user_import_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/user_import_controller_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.PleromaAPI.UserImportControllerTest do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked use Oban.Testing, repo: Pleroma.Repo alias Pleroma.Tests.ObanHelpers diff --git a/test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs b/test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs index 783ab5aa9..7a52d47ea 100644 --- a/test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs +++ b/test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.Plugs.AdminSecretAuthenticationPlugTest do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked import Mock import Pleroma.Factory diff --git a/test/pleroma/web/plugs/frontend_static_plug_test.exs b/test/pleroma/web/plugs/frontend_static_plug_test.exs index 1dceacf28..c99d1a79b 100644 --- a/test/pleroma/web/plugs/frontend_static_plug_test.exs +++ b/test/pleroma/web/plugs/frontend_static_plug_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.Plugs.FrontendStaticPlugTest do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked import Mock @dir "test/tmp/instance_static" diff --git a/test/pleroma/web/plugs/http_signature_plug_test.exs b/test/pleroma/web/plugs/http_signature_plug_test.exs index 34d0dc00e..a90c6533e 100644 --- a/test/pleroma/web/plugs/http_signature_plug_test.exs +++ b/test/pleroma/web/plugs/http_signature_plug_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.Plugs.HTTPSignaturePlugTest do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked import Pleroma.Factory alias Pleroma.Web.Plugs.HTTPSignaturePlug alias Pleroma.Instances.Instance diff --git a/test/pleroma/web/plugs/o_auth_scopes_plug_test.exs b/test/pleroma/web/plugs/o_auth_scopes_plug_test.exs index 0385a5efc..b2af966b9 100644 --- a/test/pleroma/web/plugs/o_auth_scopes_plug_test.exs +++ b/test/pleroma/web/plugs/o_auth_scopes_plug_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.Plugs.OAuthScopesPlugTest do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked alias Pleroma.Repo alias Pleroma.Web.Plugs.OAuthScopesPlug diff --git a/test/pleroma/web/plugs/plug_helper_test.exs b/test/pleroma/web/plugs/plug_helper_test.exs index 962e6ce7b..26a9efcb0 100644 --- a/test/pleroma/web/plugs/plug_helper_test.exs +++ b/test/pleroma/web/plugs/plug_helper_test.exs @@ -12,6 +12,7 @@ defmodule Pleroma.Web.Plugs.PlugHelperTest do import Mock use Pleroma.Web.ConnCase, async: false + @moduletag :mocked describe "when plug is skipped, " do setup_with_mocks( diff --git a/test/pleroma/web/static_fe/static_fe_controller_test.exs b/test/pleroma/web/static_fe/static_fe_controller_test.exs index a66504ac8..935e44171 100644 --- a/test/pleroma/web/static_fe/static_fe_controller_test.exs +++ b/test/pleroma/web/static_fe/static_fe_controller_test.exs @@ -15,6 +15,7 @@ defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do import Pleroma.Factory setup_all do: clear_config([:static_fe, :enabled], true) + setup do: clear_config([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local) setup %{conn: conn} do conn = put_req_header(conn, "accept", "text/html") diff --git a/test/pleroma/web/twitter_api/util_controller_test.exs b/test/pleroma/web/twitter_api/util_controller_test.exs index 53a347d42..169e9981c 100644 --- a/test/pleroma/web/twitter_api/util_controller_test.exs +++ b/test/pleroma/web/twitter_api/util_controller_test.exs @@ -4,6 +4,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do use Pleroma.Web.ConnCase, async: false + @moduletag :mocked use Oban.Testing, repo: Pleroma.Repo alias Pleroma.Tests.ObanHelpers diff --git a/test/pleroma/workers/receiver_worker_test.exs b/test/pleroma/workers/receiver_worker_test.exs index fbd2b82e7..e816d8db5 100644 --- a/test/pleroma/workers/receiver_worker_test.exs +++ b/test/pleroma/workers/receiver_worker_test.exs @@ -5,6 +5,7 @@ defmodule Pleroma.Workers.ReceiverWorkerTest do use Pleroma.DataCase, async: false use Oban.Testing, repo: Pleroma.Repo + @moduletag :mocked import Mock import Pleroma.Factory