From 0319d1ad3c68e5942ef934a10d44151cc34290a8 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Tue, 6 Aug 2024 11:17:34 -0400 Subject: [PATCH] Remove test, logic was flawed Before splitting the publish_one/1 function into two parts for testing purposes we had logic that checked the keys of params for :unreachable_since and if it was absent it did not set the instance as reachable. There is also a test to validate that when unreachable_since is nil, we set it as reachable. However the default value of :unreachable_since when an instance is reachable is nil. The test appears to be testing a scenario that does not exist in the real world, and with this refactor we will always have an :unreachable_since key. We were attempting to update the reachability upon every successful federation because we always include it when we generate the publish_one jobs. --- test/pleroma/web/activity_pub/publisher_test.exs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/test/pleroma/web/activity_pub/publisher_test.exs b/test/pleroma/web/activity_pub/publisher_test.exs index 370b4b4d2..c0c20b4fd 100644 --- a/test/pleroma/web/activity_pub/publisher_test.exs +++ b/test/pleroma/web/activity_pub/publisher_test.exs @@ -167,21 +167,6 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do |> Publisher.publish_one() end - test_with_mock "calls `Instances.set_reachable` on successful federation if `unreachable_since` is not specified", - Instances, - [:passthrough], - [] do - _actor = insert(:user) - inbox = "http://200.site/users/nick1/inbox" - activity = insert(:note_activity) - - assert {:ok, _} = - Publisher.prepare_one(%{inbox: inbox, activity_id: activity.id}) - |> Publisher.publish_one() - - assert called(Instances.set_reachable(inbox)) - end - test_with_mock "calls `Instances.set_reachable` on successful federation if `unreachable_since` is set", Instances, [:passthrough],