logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 9ba60f70d2076017b610708691f9b88a025c6d97
parent c9d73af74dc816dac484f1be2e842baac6fdaa6c
Author: lain <lain@soykaf.club>
Date:   Mon, 21 Dec 2020 12:21:40 +0100

Tests: Make as many tests as possible async.

In general, tests that match these criteria can be made async:

- Doesn't use real Cachex.
- Doesn't write to the Config / Application Environment.
- Uses Mock. Using Mox is fine.
- Uses the streamer.

Diffstat:

Mtest/mix/tasks/pleroma/count_statuses_test.exs1+
Mtest/mix/tasks/pleroma/database_test.exs2+-
Mtest/mix/tasks/pleroma/ecto/rollback_test.exs2+-
Mtest/mix/tasks/pleroma/instance_test.exs7+++----
Mtest/mix/tasks/pleroma/refresh_counter_cache_test.exs1+
Mtest/pleroma/activity/ir/topics_test.exs2+-
Mtest/pleroma/activity/search_test.exs2+-
Mtest/pleroma/bbs/handler_test.exs2+-
Mtest/pleroma/bookmark_test.exs2+-
Mtest/pleroma/config_test.exs2+-
Mtest/pleroma/conversation/participation_test.exs2+-
Mtest/pleroma/earmark_renderer_test.exs2+-
Mtest/pleroma/ecto_type/activity_pub/object_validators/date_time_test.exs2+-
Mtest/pleroma/ecto_type/activity_pub/object_validators/object_id_test.exs2+-
Mtest/pleroma/ecto_type/activity_pub/object_validators/recipients_test.exs2+-
Mtest/pleroma/ecto_type/activity_pub/object_validators/safe_text_test.exs2+-
Mtest/pleroma/emails/admin_email_test.exs2+-
Mtest/pleroma/emails/user_email_test.exs2+-
Mtest/pleroma/emoji/formatter_test.exs2+-
Mtest/pleroma/emoji/pack_test.exs2+-
Mtest/pleroma/emoji_test.exs2+-
Mtest/pleroma/filter_test.exs2+-
Mtest/pleroma/following_relationship_test.exs2+-
Mtest/pleroma/healthcheck_test.exs2+-
Mtest/pleroma/html_test.exs2+-
Mtest/pleroma/integration/mastodon_websocket_test.exs1+
Mtest/pleroma/keys_test.exs2+-
Mtest/pleroma/list_test.exs2+-
Mtest/pleroma/marker_test.exs2+-
Mtest/pleroma/mfa/backup_codes_test.exs2+-
Mtest/pleroma/mfa/totp_test.exs2+-
Mtest/pleroma/mfa_test.exs2+-
Mtest/pleroma/migration_helper/notification_backfill_test.exs2+-
Mtest/pleroma/moderation_log_test.exs2+-
Mtest/pleroma/pagination_test.exs2+-
Mtest/pleroma/registration_test.exs2+-
Mtest/pleroma/repo/migrations/fix_legacy_tags_test.exs2+-
Mtest/pleroma/repo/migrations/move_welcome_settings_test.exs2+-
Mtest/pleroma/repo_test.exs2+-
Mtest/pleroma/report_note_test.exs2+-
Mtest/pleroma/safe_jsonb_set_test.exs2+-
Mtest/pleroma/stats_test.exs2+-
Mtest/pleroma/upload/filter/dedupe_test.exs2+-
Mtest/pleroma/upload/filter/exiftool_test.exs2+-
Mtest/pleroma/uploaders/local_test.exs2+-
Mtest/pleroma/user/notification_setting_test.exs2+-
Mtest/pleroma/user/query_test.exs2+-
Mtest/pleroma/user_relationship_test.exs2+-
Mtest/pleroma/web/activity_pub/mrf/anti_followbot_policy_test.exs2+-
Mtest/pleroma/web/activity_pub/mrf/ensure_re_prepended_test.exs2+-
Mtest/pleroma/web/activity_pub/mrf/force_bot_unlisted_policy_test.exs2+-
Mtest/pleroma/web/activity_pub/mrf/no_placeholder_text_policy_test.exs2+-
Mtest/pleroma/web/activity_pub/mrf/normalize_markup_test.exs2+-
Mtest/pleroma/web/activity_pub/mrf/tag_policy_test.exs2+-
Mtest/pleroma/web/activity_pub/object_validators/accept_validation_test.exs2+-
Mtest/pleroma/web/activity_pub/object_validators/announce_validation_test.exs2+-
Mtest/pleroma/web/activity_pub/object_validators/article_note_validator_test.exs2+-
Mtest/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs2+-
Mtest/pleroma/web/activity_pub/object_validators/block_validation_test.exs2+-
Mtest/pleroma/web/activity_pub/object_validators/delete_validation_test.exs2+-
Mtest/pleroma/web/activity_pub/object_validators/emoji_react_handling_test.exs2+-
Mtest/pleroma/web/activity_pub/object_validators/follow_validation_test.exs2+-
Mtest/pleroma/web/activity_pub/object_validators/like_validation_test.exs2+-
Mtest/pleroma/web/activity_pub/object_validators/reject_validation_test.exs2+-
Mtest/pleroma/web/activity_pub/object_validators/undo_handling_test.exs2+-
Mtest/pleroma/web/activity_pub/object_validators/update_handling_test.exs2+-
Mtest/pleroma/web/activity_pub/transmogrifier/accept_handling_test.exs2+-
Mtest/pleroma/web/activity_pub/transmogrifier/block_handling_test.exs2+-
Mtest/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs2+-
Mtest/pleroma/web/activity_pub/transmogrifier/like_handling_test.exs2+-
Mtest/pleroma/web/activity_pub/transmogrifier/reject_handling_test.exs2+-
Mtest/pleroma/web/activity_pub/transmogrifier/undo_handling_test.exs2+-
Mtest/pleroma/web/activity_pub/transmogrifier/user_update_handling_test.exs2+-
Mtest/pleroma/web/activity_pub/utils_test.exs2+-
Mtest/pleroma/web/activity_pub/views/user_view_test.exs2+-
Mtest/pleroma/web/activity_pub/visibility_test.exs2+-
Mtest/pleroma/web/admin_api/controllers/chat_controller_test.exs2+-
Mtest/pleroma/web/admin_api/controllers/report_controller_test.exs2+-
Mtest/pleroma/web/admin_api/controllers/status_controller_test.exs2+-
Mtest/pleroma/web/admin_api/search_test.exs2+-
Mtest/pleroma/web/admin_api/views/moderation_log_view_test.exs2+-
Mtest/pleroma/web/admin_api/views/report_view_test.exs2+-
Mtest/pleroma/web/auth/authenticator_test.exs2+-
Mtest/pleroma/web/auth/basic_auth_test.exs2+-
Mtest/pleroma/web/auth/pleroma_authenticator_test.exs2+-
Mtest/pleroma/web/auth/totp_authenticator_test.exs2+-
Mtest/pleroma/web/endpoint/metrics_exporter_test.exs1+
Mtest/pleroma/web/mastodon_api/controllers/auth_controller_test.exs2+-
Mtest/pleroma/web/mastodon_api/controllers/conversation_controller_test.exs2+-
Mtest/pleroma/web/mastodon_api/controllers/filter_controller_test.exs2+-
Mtest/pleroma/web/mastodon_api/controllers/follow_request_controller_test.exs2+-
Mtest/pleroma/web/mastodon_api/controllers/list_controller_test.exs2+-
Mtest/pleroma/web/mastodon_api/controllers/marker_controller_test.exs2+-
Mtest/pleroma/web/mastodon_api/controllers/poll_controller_test.exs2+-
Mtest/pleroma/web/mastodon_api/controllers/report_controller_test.exs2+-
Mtest/pleroma/web/mastodon_api/controllers/subscription_controller_test.exs2+-
Mtest/pleroma/web/mastodon_api/controllers/suggestion_controller_test.exs2+-
Mtest/pleroma/web/mastodon_api/mastodon_api_controller_test.exs2+-
Mtest/pleroma/web/mastodon_api/mastodon_api_test.exs2+-
Mtest/pleroma/web/mastodon_api/views/conversation_view_test.exs2+-
Mtest/pleroma/web/mastodon_api/views/list_view_test.exs2+-
Mtest/pleroma/web/mastodon_api/views/marker_view_test.exs2+-
Mtest/pleroma/web/mastodon_api/views/scheduled_activity_view_test.exs2+-
Mtest/pleroma/web/mastodon_api/views/subscription_view_test.exs2+-
Mtest/pleroma/web/media_proxy/invalidation/script_test.exs2+-
Mtest/pleroma/web/metadata/player_view_test.exs2+-
Mtest/pleroma/web/metadata/providers/feed_test.exs2+-
Mtest/pleroma/web/metadata/providers/rel_me_test.exs2+-
Mtest/pleroma/web/metadata/utils_test.exs2+-
Mtest/pleroma/web/mongoose_im_controller_test.exs2+-
Mtest/pleroma/web/o_auth/app_test.exs2+-
Mtest/pleroma/web/o_auth/authorization_test.exs2+-
Mtest/pleroma/web/o_auth/mfa_controller_test.exs2+-
Mtest/pleroma/web/o_auth/token/utils_test.exs2+-
Mtest/pleroma/web/o_auth/token_test.exs2+-
Mtest/pleroma/web/pleroma_api/controllers/conversation_controller_test.exs2+-
Mtest/pleroma/web/pleroma_api/controllers/mascot_controller_test.exs2+-
Mtest/pleroma/web/pleroma_api/controllers/notification_controller_test.exs2+-
Mtest/pleroma/web/pleroma_api/controllers/scrobble_controller_test.exs2+-
Mtest/pleroma/web/pleroma_api/controllers/two_factor_authentication_controller_test.exs2+-
Mtest/pleroma/web/pleroma_api/views/chat_view_test.exs2+-
Mtest/pleroma/web/pleroma_api/views/scrobble_view_test.exs2+-
Mtest/pleroma/web/plugs/cache_control_test.exs2+-
Mtest/pleroma/web/plugs/cache_test.exs1+
Mtest/pleroma/web/plugs/idempotency_plug_test.exs1+
Mtest/pleroma/web/plugs/uploaded_media_plug_test.exs2+-
Mtest/pleroma/web/preload/providers/user_test.exs2+-
Mtest/pleroma/web/push/impl_test.exs2+-
Mtest/pleroma/web/rel_me_test.exs2+-
Mtest/pleroma/web/rich_media/parser/ttl/aws_signed_url_test.exs1+
Mtest/pleroma/web/twitter_api/controller_test.exs14++++++--------
Mtest/pleroma/web/uploader_controller_test.exs2+-
Mtest/pleroma/web/web_finger_test.exs2+-
Mtest/pleroma/workers/cron/new_users_digest_worker_test.exs2+-
134 files changed, 141 insertions(+), 137 deletions(-)

diff --git a/test/mix/tasks/pleroma/count_statuses_test.exs b/test/mix/tasks/pleroma/count_statuses_test.exs @@ -3,6 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.CountStatusesTest do + # Uses log capture, has to stay synchronous use Pleroma.DataCase alias Pleroma.User diff --git a/test/mix/tasks/pleroma/database_test.exs b/test/mix/tasks/pleroma/database_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.DatabaseTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true use Oban.Testing, repo: Pleroma.Repo alias Pleroma.Activity diff --git a/test/mix/tasks/pleroma/ecto/rollback_test.exs b/test/mix/tasks/pleroma/ecto/rollback_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.Ecto.RollbackTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import ExUnit.CaptureLog require Logger diff --git a/test/mix/tasks/pleroma/instance_test.exs b/test/mix/tasks/pleroma/instance_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.InstanceTest do - use ExUnit.Case + use Pleroma.DataCase, async: true setup do File.mkdir_p!(tmp_path()) @@ -15,15 +15,14 @@ defmodule Mix.Tasks.Pleroma.InstanceTest do if File.exists?(static_dir) do File.rm_rf(Path.join(static_dir, "robots.txt")) end - - Pleroma.Config.put([:instance, :static_dir], static_dir) end) :ok end + @uuid Ecto.UUID.generate() defp tmp_path do - "/tmp/generated_files/" + "/tmp/generated_files/#{@uuid}/" end test "running gen" do diff --git a/test/mix/tasks/pleroma/refresh_counter_cache_test.exs b/test/mix/tasks/pleroma/refresh_counter_cache_test.exs @@ -3,6 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.RefreshCounterCacheTest do + # Uses log capture, has to stay synchronous use Pleroma.DataCase alias Pleroma.Web.CommonAPI import ExUnit.CaptureIO, only: [capture_io: 1] diff --git a/test/pleroma/activity/ir/topics_test.exs b/test/pleroma/activity/ir/topics_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Activity.Ir.TopicsTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Activity alias Pleroma.Activity.Ir.Topics diff --git a/test/pleroma/activity/search_test.exs b/test/pleroma/activity/search_test.exs @@ -7,7 +7,7 @@ defmodule Pleroma.Activity.SearchTest do alias Pleroma.Web.CommonAPI import Pleroma.Factory - use Pleroma.DataCase + use Pleroma.DataCase, async: true test "it finds something" do user = insert(:user) diff --git a/test/pleroma/bbs/handler_test.exs b/test/pleroma/bbs/handler_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.BBS.HandlerTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Activity alias Pleroma.BBS.Handler alias Pleroma.Object diff --git a/test/pleroma/bookmark_test.exs b/test/pleroma/bookmark_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.BookmarkTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.Bookmark alias Pleroma.Web.CommonAPI diff --git a/test/pleroma/config_test.exs b/test/pleroma/config_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.ConfigTest do - use ExUnit.Case + use Pleroma.DataCase, async: true test "get/1 with an atom" do assert Pleroma.Config.get(:instance) == Application.get_env(:pleroma, :instance) diff --git a/test/pleroma/conversation/participation_test.exs b/test/pleroma/conversation/participation_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Conversation.ParticipationTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.Conversation alias Pleroma.Conversation.Participation diff --git a/test/pleroma/earmark_renderer_test.exs b/test/pleroma/earmark_renderer_test.exs @@ -2,7 +2,7 @@ # Copyright © 2020 Pleroma Authors <https://pleroma.social/> # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.EarmarkRendererTest do - use ExUnit.Case + use Pleroma.DataCase, async: true test "Paragraph" do code = ~s[Hello\n\nWorld!] diff --git a/test/pleroma/ecto_type/activity_pub/object_validators/date_time_test.exs b/test/pleroma/ecto_type/activity_pub/object_validators/date_time_test.exs @@ -4,7 +4,7 @@ defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.DateTimeTest do alias Pleroma.EctoType.ActivityPub.ObjectValidators.DateTime - use Pleroma.DataCase + use Pleroma.DataCase, async: true test "it validates an xsd:Datetime" do valid_strings = [ diff --git a/test/pleroma/ecto_type/activity_pub/object_validators/object_id_test.exs b/test/pleroma/ecto_type/activity_pub/object_validators/object_id_test.exs @@ -4,7 +4,7 @@ defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.ObjectIDTest do alias Pleroma.EctoType.ActivityPub.ObjectValidators.ObjectID - use Pleroma.DataCase + use Pleroma.DataCase, async: true @uris [ "http://lain.com/users/lain", diff --git a/test/pleroma/ecto_type/activity_pub/object_validators/recipients_test.exs b/test/pleroma/ecto_type/activity_pub/object_validators/recipients_test.exs @@ -4,7 +4,7 @@ defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.RecipientsTest do alias Pleroma.EctoType.ActivityPub.ObjectValidators.Recipients - use Pleroma.DataCase + use Pleroma.DataCase, async: true test "it asserts that all elements of the list are object ids" do list = ["https://lain.com/users/lain", "invalid"] diff --git a/test/pleroma/ecto_type/activity_pub/object_validators/safe_text_test.exs b/test/pleroma/ecto_type/activity_pub/object_validators/safe_text_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.SafeTextTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.EctoType.ActivityPub.ObjectValidators.SafeText diff --git a/test/pleroma/emails/admin_email_test.exs b/test/pleroma/emails/admin_email_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Emails.AdminEmailTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.Emails.AdminEmail diff --git a/test/pleroma/emails/user_email_test.exs b/test/pleroma/emails/user_email_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Emails.UserEmailTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Emails.UserEmail alias Pleroma.Web.Endpoint diff --git a/test/pleroma/emoji/formatter_test.exs b/test/pleroma/emoji/formatter_test.exs @@ -4,7 +4,7 @@ defmodule Pleroma.Emoji.FormatterTest do alias Pleroma.Emoji.Formatter - use Pleroma.DataCase + use Pleroma.DataCase, async: true describe "emojify" do test "it adds cool emoji" do diff --git a/test/pleroma/emoji/pack_test.exs b/test/pleroma/emoji/pack_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Emoji.PackTest do - use ExUnit.Case, async: true + use Pleroma.DataCase alias Pleroma.Emoji.Pack @emoji_path Path.join( diff --git a/test/pleroma/emoji_test.exs b/test/pleroma/emoji_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.EmojiTest do - use ExUnit.Case + use ExUnit.Case, async: true alias Pleroma.Emoji describe "is_unicode_emoji?/1" do diff --git a/test/pleroma/filter_test.exs b/test/pleroma/filter_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.FilterTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory diff --git a/test/pleroma/following_relationship_test.exs b/test/pleroma/following_relationship_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.FollowingRelationshipTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.FollowingRelationship alias Pleroma.Web.ActivityPub.InternalFetchActor diff --git a/test/pleroma/healthcheck_test.exs b/test/pleroma/healthcheck_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.HealthcheckTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Healthcheck test "system_info/0" do diff --git a/test/pleroma/html_test.exs b/test/pleroma/html_test.exs @@ -6,7 +6,7 @@ defmodule Pleroma.HTMLTest do alias Pleroma.HTML alias Pleroma.Object alias Pleroma.Web.CommonAPI - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory diff --git a/test/pleroma/integration/mastodon_websocket_test.exs b/test/pleroma/integration/mastodon_websocket_test.exs @@ -3,6 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Integration.MastodonWebsocketTest do + # Needs a streamer, needs to stay synchronous use Pleroma.DataCase import ExUnit.CaptureLog diff --git a/test/pleroma/keys_test.exs b/test/pleroma/keys_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.KeysTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Keys diff --git a/test/pleroma/list_test.exs b/test/pleroma/list_test.exs @@ -4,7 +4,7 @@ defmodule Pleroma.ListTest do alias Pleroma.Repo - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory diff --git a/test/pleroma/marker_test.exs b/test/pleroma/marker_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.MarkerTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Marker import Pleroma.Factory diff --git a/test/pleroma/mfa/backup_codes_test.exs b/test/pleroma/mfa/backup_codes_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.MFA.BackupCodesTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.MFA.BackupCodes diff --git a/test/pleroma/mfa/totp_test.exs b/test/pleroma/mfa/totp_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.MFA.TOTPTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.MFA.TOTP diff --git a/test/pleroma/mfa_test.exs b/test/pleroma/mfa_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.MFATest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.MFA diff --git a/test/pleroma/migration_helper/notification_backfill_test.exs b/test/pleroma/migration_helper/notification_backfill_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.MigrationHelper.NotificationBackfillTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Activity alias Pleroma.MigrationHelper.NotificationBackfill diff --git a/test/pleroma/moderation_log_test.exs b/test/pleroma/moderation_log_test.exs @@ -6,7 +6,7 @@ defmodule Pleroma.ModerationLogTest do alias Pleroma.Activity alias Pleroma.ModerationLog - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory diff --git a/test/pleroma/pagination_test.exs b/test/pleroma/pagination_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.PaginationTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory diff --git a/test/pleroma/registration_test.exs b/test/pleroma/registration_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.RegistrationTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory diff --git a/test/pleroma/repo/migrations/fix_legacy_tags_test.exs b/test/pleroma/repo/migrations/fix_legacy_tags_test.exs @@ -4,7 +4,7 @@ defmodule Pleroma.Repo.Migrations.FixLegacyTagsTest do alias Pleroma.User - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory import Pleroma.Tests.Helpers diff --git a/test/pleroma/repo/migrations/move_welcome_settings_test.exs b/test/pleroma/repo/migrations/move_welcome_settings_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Repo.Migrations.MoveWelcomeSettingsTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory import Pleroma.Tests.Helpers alias Pleroma.ConfigDB diff --git a/test/pleroma/repo_test.exs b/test/pleroma/repo_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.RepoTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.User diff --git a/test/pleroma/report_note_test.exs b/test/pleroma/report_note_test.exs @@ -4,7 +4,7 @@ defmodule Pleroma.ReportNoteTest do alias Pleroma.ReportNote - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory test "create/3" do diff --git a/test/pleroma/safe_jsonb_set_test.exs b/test/pleroma/safe_jsonb_set_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.SafeJsonbSetTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true test "it doesn't wipe the object when asked to set the value to NULL" do assert %{rows: [[%{"key" => "value", "test" => nil}]]} = diff --git a/test/pleroma/stats_test.exs b/test/pleroma/stats_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.StatsTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory diff --git a/test/pleroma/upload/filter/dedupe_test.exs b/test/pleroma/upload/filter/dedupe_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Upload.Filter.DedupeTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Upload alias Pleroma.Upload.Filter.Dedupe diff --git a/test/pleroma/upload/filter/exiftool_test.exs b/test/pleroma/upload/filter/exiftool_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Upload.Filter.ExiftoolTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Upload.Filter test "apply exiftool filter" do diff --git a/test/pleroma/uploaders/local_test.exs b/test/pleroma/uploaders/local_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Uploaders.LocalTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Uploaders.Local describe "get_file/1" do diff --git a/test/pleroma/user/notification_setting_test.exs b/test/pleroma/user/notification_setting_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.User.NotificationSettingTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.User.NotificationSetting diff --git a/test/pleroma/user/query_test.exs b/test/pleroma/user/query_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.User.QueryTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Repo alias Pleroma.User diff --git a/test/pleroma/user_relationship_test.exs b/test/pleroma/user_relationship_test.exs @@ -5,7 +5,7 @@ defmodule Pleroma.UserRelationshipTest do alias Pleroma.UserRelationship - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory diff --git a/test/pleroma/web/activity_pub/mrf/anti_followbot_policy_test.exs b/test/pleroma/web/activity_pub/mrf/anti_followbot_policy_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.AntiFollowbotPolicyTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.Web.ActivityPub.MRF.AntiFollowbotPolicy diff --git a/test/pleroma/web/activity_pub/mrf/ensure_re_prepended_test.exs b/test/pleroma/web/activity_pub/mrf/ensure_re_prepended_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.EnsureRePrependedTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Activity alias Pleroma.Object diff --git a/test/pleroma/web/activity_pub/mrf/force_bot_unlisted_policy_test.exs b/test/pleroma/web/activity_pub/mrf/force_bot_unlisted_policy_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicyTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicy diff --git a/test/pleroma/web/activity_pub/mrf/no_placeholder_text_policy_test.exs b/test/pleroma/web/activity_pub/mrf/no_placeholder_text_policy_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.NoPlaceholderTextPolicyTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.ActivityPub.MRF.NoPlaceholderTextPolicy test "it clears content object" do diff --git a/test/pleroma/web/activity_pub/mrf/normalize_markup_test.exs b/test/pleroma/web/activity_pub/mrf/normalize_markup_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.NormalizeMarkupTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.ActivityPub.MRF.NormalizeMarkup @html_sample """ diff --git a/test/pleroma/web/activity_pub/mrf/tag_policy_test.exs b/test/pleroma/web/activity_pub/mrf/tag_policy_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.TagPolicyTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.Web.ActivityPub.MRF.TagPolicy diff --git a/test/pleroma/web/activity_pub/object_validators/accept_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/accept_validation_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.AcceptValidationTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.ActivityPub.Builder alias Pleroma.Web.ActivityPub.ObjectValidator diff --git a/test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.AnnounceValidationTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Object alias Pleroma.Web.ActivityPub.Builder diff --git a/test/pleroma/web/activity_pub/object_validators/article_note_validator_test.exs b/test/pleroma/web/activity_pub/object_validators/article_note_validator_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNoteValidatorTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.ActivityPub.ObjectValidators.ArticleNoteValidator alias Pleroma.Web.ActivityPub.Utils diff --git a/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs b/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidatorTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidator diff --git a/test/pleroma/web/activity_pub/object_validators/block_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/block_validation_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.BlockValidationTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.ActivityPub.Builder alias Pleroma.Web.ActivityPub.ObjectValidator diff --git a/test/pleroma/web/activity_pub/object_validators/delete_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/delete_validation_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.DeleteValidationTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Object alias Pleroma.Web.ActivityPub.Builder diff --git a/test/pleroma/web/activity_pub/object_validators/emoji_react_handling_test.exs b/test/pleroma/web/activity_pub/object_validators/emoji_react_handling_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.EmojiReactHandlingTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.ActivityPub.Builder alias Pleroma.Web.ActivityPub.ObjectValidator diff --git a/test/pleroma/web/activity_pub/object_validators/follow_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/follow_validation_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.FollowValidationTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.ActivityPub.Builder alias Pleroma.Web.ActivityPub.ObjectValidator diff --git a/test/pleroma/web/activity_pub/object_validators/like_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/like_validation_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.LikeValidationTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.ActivityPub.ObjectValidator alias Pleroma.Web.ActivityPub.ObjectValidators.LikeValidator diff --git a/test/pleroma/web/activity_pub/object_validators/reject_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/reject_validation_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.RejectValidationTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.ActivityPub.Builder alias Pleroma.Web.ActivityPub.ObjectValidator diff --git a/test/pleroma/web/activity_pub/object_validators/undo_handling_test.exs b/test/pleroma/web/activity_pub/object_validators/undo_handling_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.UndoHandlingTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.ActivityPub.Builder alias Pleroma.Web.ActivityPub.ObjectValidator diff --git a/test/pleroma/web/activity_pub/object_validators/update_handling_test.exs b/test/pleroma/web/activity_pub/object_validators/update_handling_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.UpdateHandlingTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.ActivityPub.Builder alias Pleroma.Web.ActivityPub.ObjectValidator diff --git a/test/pleroma/web/activity_pub/transmogrifier/accept_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/accept_handling_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.AcceptHandlingTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.User alias Pleroma.Web.ActivityPub.Transmogrifier diff --git a/test/pleroma/web/activity_pub/transmogrifier/block_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/block_handling_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.BlockHandlingTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Activity alias Pleroma.User diff --git a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.EmojiReactHandlingTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Activity alias Pleroma.Object diff --git a/test/pleroma/web/activity_pub/transmogrifier/like_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/like_handling_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.LikeHandlingTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Activity alias Pleroma.Web.ActivityPub.Transmogrifier diff --git a/test/pleroma/web/activity_pub/transmogrifier/reject_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/reject_handling_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.RejectHandlingTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Activity alias Pleroma.User diff --git a/test/pleroma/web/activity_pub/transmogrifier/undo_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/undo_handling_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.UndoHandlingTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Activity alias Pleroma.Object diff --git a/test/pleroma/web/activity_pub/transmogrifier/user_update_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/user_update_handling_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.UserUpdateHandlingTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Activity alias Pleroma.User diff --git a/test/pleroma/web/activity_pub/utils_test.exs b/test/pleroma/web/activity_pub/utils_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.UtilsTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Activity alias Pleroma.Object alias Pleroma.Repo diff --git a/test/pleroma/web/activity_pub/views/user_view_test.exs b/test/pleroma/web/activity_pub/views/user_view_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.UserViewTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.User diff --git a/test/pleroma/web/activity_pub/visibility_test.exs b/test/pleroma/web/activity_pub/visibility_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.VisibilityTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Activity alias Pleroma.Web.ActivityPub.Visibility diff --git a/test/pleroma/web/admin_api/controllers/chat_controller_test.exs b/test/pleroma/web/admin_api/controllers/chat_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.ChatControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true import Pleroma.Factory diff --git a/test/pleroma/web/admin_api/controllers/report_controller_test.exs b/test/pleroma/web/admin_api/controllers/report_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.ReportControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true import Pleroma.Factory diff --git a/test/pleroma/web/admin_api/controllers/status_controller_test.exs b/test/pleroma/web/admin_api/controllers/status_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.StatusControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true import Pleroma.Factory diff --git a/test/pleroma/web/admin_api/search_test.exs b/test/pleroma/web/admin_api/search_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.SearchTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.Web.AdminAPI.Search diff --git a/test/pleroma/web/admin_api/views/moderation_log_view_test.exs b/test/pleroma/web/admin_api/views/moderation_log_view_test.exs @@ -2,7 +2,7 @@ # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/> # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.ModerationLogViewTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.AdminAPI.ModerationLogView diff --git a/test/pleroma/web/admin_api/views/report_view_test.exs b/test/pleroma/web/admin_api/views/report_view_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.ReportViewTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory diff --git a/test/pleroma/web/auth/authenticator_test.exs b/test/pleroma/web/auth/authenticator_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Auth.AuthenticatorTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.Web.Auth.Authenticator import Pleroma.Factory diff --git a/test/pleroma/web/auth/basic_auth_test.exs b/test/pleroma/web/auth/basic_auth_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Auth.BasicAuthTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true import Pleroma.Factory diff --git a/test/pleroma/web/auth/pleroma_authenticator_test.exs b/test/pleroma/web/auth/pleroma_authenticator_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Auth.PleromaAuthenticatorTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.Web.Auth.PleromaAuthenticator import Pleroma.Factory diff --git a/test/pleroma/web/auth/totp_authenticator_test.exs b/test/pleroma/web/auth/totp_authenticator_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Auth.TOTPAuthenticatorTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.MFA alias Pleroma.MFA.BackupCodes diff --git a/test/pleroma/web/endpoint/metrics_exporter_test.exs b/test/pleroma/web/endpoint/metrics_exporter_test.exs @@ -3,6 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Endpoint.MetricsExporterTest do + # Modifies AppEnv, has to stay synchronous use Pleroma.Web.ConnCase alias Pleroma.Web.Endpoint.MetricsExporter diff --git a/test/pleroma/web/mastodon_api/controllers/auth_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/auth_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.AuthControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.Config alias Pleroma.Repo diff --git a/test/pleroma/web/mastodon_api/controllers/conversation_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/conversation_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.ConversationControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.Conversation.Participation alias Pleroma.User diff --git a/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.FilterControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.Web.MastodonAPI.FilterView diff --git a/test/pleroma/web/mastodon_api/controllers/follow_request_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/follow_request_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.FollowRequestControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.User alias Pleroma.Web.CommonAPI diff --git a/test/pleroma/web/mastodon_api/controllers/list_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/list_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.ListControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.Repo diff --git a/test/pleroma/web/mastodon_api/controllers/marker_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/marker_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.MarkerControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true import Pleroma.Factory diff --git a/test/pleroma/web/mastodon_api/controllers/poll_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/poll_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.PollControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.Object alias Pleroma.Web.CommonAPI diff --git a/test/pleroma/web/mastodon_api/controllers/report_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/report_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.ReportControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.Web.CommonAPI diff --git a/test/pleroma/web/mastodon_api/controllers/subscription_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/subscription_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.SubscriptionControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true import Pleroma.Factory diff --git a/test/pleroma/web/mastodon_api/controllers/suggestion_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/suggestion_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.SuggestionControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true setup do: oauth_access(["read"]) diff --git a/test/pleroma/web/mastodon_api/mastodon_api_controller_test.exs b/test/pleroma/web/mastodon_api/mastodon_api_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true describe "empty_array/2 (stubs)" do test "GET /api/v1/accounts/:id/identity_proofs" do diff --git a/test/pleroma/web/mastodon_api/mastodon_api_test.exs b/test/pleroma/web/mastodon_api/mastodon_api_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.MastodonAPITest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.Notification alias Pleroma.ScheduledActivity diff --git a/test/pleroma/web/mastodon_api/views/conversation_view_test.exs b/test/pleroma/web/mastodon_api/views/conversation_view_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.ConversationViewTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Conversation.Participation alias Pleroma.Web.CommonAPI diff --git a/test/pleroma/web/mastodon_api/views/list_view_test.exs b/test/pleroma/web/mastodon_api/views/list_view_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.ListViewTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.Web.MastodonAPI.ListView diff --git a/test/pleroma/web/mastodon_api/views/marker_view_test.exs b/test/pleroma/web/mastodon_api/views/marker_view_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.MarkerViewTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.MastodonAPI.MarkerView import Pleroma.Factory diff --git a/test/pleroma/web/mastodon_api/views/scheduled_activity_view_test.exs b/test/pleroma/web/mastodon_api/views/scheduled_activity_view_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.ScheduledActivityViewTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.ScheduledActivity alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.CommonAPI diff --git a/test/pleroma/web/mastodon_api/views/subscription_view_test.exs b/test/pleroma/web/mastodon_api/views/subscription_view_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.SubscriptionViewTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.Web.MastodonAPI.SubscriptionView, as: View alias Pleroma.Web.Push diff --git a/test/pleroma/web/media_proxy/invalidation/script_test.exs b/test/pleroma/web/media_proxy/invalidation/script_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MediaProxy.Invalidation.ScriptTest do - use ExUnit.Case + use ExUnit.Case, async: true alias Pleroma.Web.MediaProxy.Invalidation import ExUnit.CaptureLog diff --git a/test/pleroma/web/metadata/player_view_test.exs b/test/pleroma/web/metadata/player_view_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Metadata.PlayerViewTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.Metadata.PlayerView diff --git a/test/pleroma/web/metadata/providers/feed_test.exs b/test/pleroma/web/metadata/providers/feed_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Metadata.Providers.FeedTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.Web.Metadata.Providers.Feed diff --git a/test/pleroma/web/metadata/providers/rel_me_test.exs b/test/pleroma/web/metadata/providers/rel_me_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Metadata.Providers.RelMeTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.Web.Metadata.Providers.RelMe diff --git a/test/pleroma/web/metadata/utils_test.exs b/test/pleroma/web/metadata/utils_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Metadata.UtilsTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.Web.Metadata.Utils diff --git a/test/pleroma/web/mongoose_im_controller_test.exs b/test/pleroma/web/mongoose_im_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MongooseIMControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true import Pleroma.Factory test "/user_exists", %{conn: conn} do diff --git a/test/pleroma/web/o_auth/app_test.exs b/test/pleroma/web/o_auth/app_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.OAuth.AppTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.OAuth.App import Pleroma.Factory diff --git a/test/pleroma/web/o_auth/authorization_test.exs b/test/pleroma/web/o_auth/authorization_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.OAuth.AuthorizationTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.OAuth.App alias Pleroma.Web.OAuth.Authorization import Pleroma.Factory diff --git a/test/pleroma/web/o_auth/mfa_controller_test.exs b/test/pleroma/web/o_auth/mfa_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.OAuth.MFAControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true import Pleroma.Factory alias Pleroma.MFA diff --git a/test/pleroma/web/o_auth/token/utils_test.exs b/test/pleroma/web/o_auth/token/utils_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.OAuth.Token.UtilsTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.OAuth.Token.Utils import Pleroma.Factory diff --git a/test/pleroma/web/o_auth/token_test.exs b/test/pleroma/web/o_auth/token_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.OAuth.TokenTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Repo alias Pleroma.Web.OAuth.App alias Pleroma.Web.OAuth.Authorization diff --git a/test/pleroma/web/pleroma_api/controllers/conversation_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/conversation_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.ConversationControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.Conversation.Participation alias Pleroma.Repo diff --git a/test/pleroma/web/pleroma_api/controllers/mascot_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/mascot_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.MascotControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.User diff --git a/test/pleroma/web/pleroma_api/controllers/notification_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/notification_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.NotificationControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.Notification alias Pleroma.Repo diff --git a/test/pleroma/web/pleroma_api/controllers/scrobble_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/scrobble_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.ScrobbleControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.Web.CommonAPI diff --git a/test/pleroma/web/pleroma_api/controllers/two_factor_authentication_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/two_factor_authentication_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.TwoFactorAuthenticationControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true import Pleroma.Factory alias Pleroma.MFA.Settings diff --git a/test/pleroma/web/pleroma_api/views/chat_view_test.exs b/test/pleroma/web/pleroma_api/views/chat_view_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.ChatViewTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Chat alias Pleroma.Chat.MessageReference diff --git a/test/pleroma/web/pleroma_api/views/scrobble_view_test.exs b/test/pleroma/web/pleroma_api/views/scrobble_view_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.ScrobbleViewTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.PleromaAPI.ScrobbleView diff --git a/test/pleroma/web/plugs/cache_control_test.exs b/test/pleroma/web/plugs/cache_control_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.CacheControlTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Plug.Conn test "Verify Cache-Control header on static assets", %{conn: conn} do diff --git a/test/pleroma/web/plugs/cache_test.exs b/test/pleroma/web/plugs/cache_test.exs @@ -3,6 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.CacheTest do + # Relies on Cachex, has to stay synchronous use Pleroma.DataCase use Plug.Test diff --git a/test/pleroma/web/plugs/idempotency_plug_test.exs b/test/pleroma/web/plugs/idempotency_plug_test.exs @@ -3,6 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.IdempotencyPlugTest do + # Relies on Cachex, has to stay synchronous use Pleroma.DataCase use Plug.Test diff --git a/test/pleroma/web/plugs/uploaded_media_plug_test.exs b/test/pleroma/web/plugs/uploaded_media_plug_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.UploadedMediaPlugTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.Upload defp upload_file(context) do diff --git a/test/pleroma/web/preload/providers/user_test.exs b/test/pleroma/web/preload/providers/user_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Preload.Providers.UserTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.Web.Preload.Providers.User diff --git a/test/pleroma/web/push/impl_test.exs b/test/pleroma/web/push/impl_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Push.ImplTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory diff --git a/test/pleroma/web/rel_me_test.exs b/test/pleroma/web/rel_me_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.RelMeTest do - use ExUnit.Case + use Pleroma.DataCase, async: true setup_all do Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end) diff --git a/test/pleroma/web/rich_media/parser/ttl/aws_signed_url_test.exs b/test/pleroma/web/rich_media/parser/ttl/aws_signed_url_test.exs @@ -3,6 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrlTest do + # Relies on Cachex, needs to be synchronous use Pleroma.DataCase test "s3 signed url is parsed correct for expiration time" do diff --git a/test/pleroma/web/twitter_api/controller_test.exs b/test/pleroma/web/twitter_api/controller_test.exs @@ -3,11 +3,11 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.TwitterAPI.ControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true - alias Pleroma.Builders.ActivityBuilder alias Pleroma.Repo alias Pleroma.User + alias Pleroma.Web.CommonAPI alias Pleroma.Web.OAuth.Token import Pleroma.Factory @@ -36,22 +36,20 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do other_user = insert(:user) {:ok, _activity} = - ActivityBuilder.insert(%{"to" => [current_user.ap_id]}, %{user: other_user}) + CommonAPI.post(other_user, %{ + status: "Hey @#{current_user.nickname}" + }) response_conn = conn - |> assign(:user, current_user) |> get("/api/v1/notifications") - [notification] = response = json_response(response_conn, 200) - - assert length(response) == 1 + [notification] = json_response(response_conn, 200) assert notification["pleroma"]["is_seen"] == false response_conn = conn - |> assign(:user, current_user) |> post("/api/qvitter/statuses/notifications/read", %{"latest_id" => notification["id"]}) [notification] = response = json_response(response_conn, 200) diff --git a/test/pleroma/web/uploader_controller_test.exs b/test/pleroma/web/uploader_controller_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.UploaderControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true alias Pleroma.Uploaders.Uploader describe "callback/2" do diff --git a/test/pleroma/web/web_finger_test.exs b/test/pleroma/web/web_finger_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.WebFingerTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true alias Pleroma.Web.WebFinger import Pleroma.Factory import Tesla.Mock diff --git a/test/pleroma/workers/cron/new_users_digest_worker_test.exs b/test/pleroma/workers/cron/new_users_digest_worker_test.exs @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Workers.Cron.NewUsersDigestWorkerTest do - use Pleroma.DataCase + use Pleroma.DataCase, async: true import Pleroma.Factory alias Pleroma.Tests.ObanHelpers