Adapt to new Oban result

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-09-29 20:28:03 +02:00
parent 327dfbb4c2
commit 81c319bdf8
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
7 changed files with 12 additions and 12 deletions

View File

@ -105,7 +105,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier.DeleteTest do
end) end)
{:ok, _activity, _actor} = Transmogrifier.handle_incoming(data) {:ok, _activity, _actor} = Transmogrifier.handle_incoming(data)
assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :background) assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :background)
assert {:error, :actor_not_found} = Actors.get_actor_by_url(url) assert {:error, :actor_not_found} = Actors.get_actor_by_url(url)
assert {:error, :event_not_found} = Events.get_event(event1.id) assert {:error, :event_not_found} = Events.get_event(event1.id)

View File

@ -51,7 +51,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier.UpdateTest do
args: %{event_id: event_id, op: :insert_search_event} args: %{event_id: event_id, op: :insert_search_event}
) )
assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :search) assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :search)
update_data = File.read!("test/fixtures/mastodon-update.json") |> Jason.decode!() update_data = File.read!("test/fixtures/mastodon-update.json") |> Jason.decode!()
@ -77,7 +77,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier.UpdateTest do
args: %{event_id: event_id, op: :update_search_event} args: %{event_id: event_id, op: :update_search_event}
) )
assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :search) assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :search)
assert event.title == "My updated event" assert event.title == "My updated event"

View File

@ -181,7 +181,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ActivityTest do
event = insert(:event, attributed_to: group, organizer_actor: actor) event = insert(:event, attributed_to: group, organizer_actor: actor)
EventActivity.insert_activity(event, subject: "event_created") EventActivity.insert_activity(event, subject: "event_created")
assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :activity) assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :activity)
assert Activities.list_activities() |> length() == 1 assert Activities.list_activities() |> length() == 1
[%Activity{author_id: author_id, group_id: activity_group_id}] = [%Activity{author_id: author_id, group_id: activity_group_id}] =
@ -230,7 +230,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ActivityTest do
post = insert(:post, author: actor, attributed_to: group) post = insert(:post, author: actor, attributed_to: group)
EventActivity.insert_activity(event, subject: "event_created") EventActivity.insert_activity(event, subject: "event_created")
PostActivity.insert_activity(post, subject: "post_created") PostActivity.insert_activity(post, subject: "post_created")
assert %{success: 2, failure: 0} == Oban.drain_queue(queue: :activity) assert %{success: 2, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :activity)
assert Activities.list_activities() |> length() == 2 assert Activities.list_activities() |> length() == 2
res = res =
@ -274,7 +274,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ActivityTest do
post = insert(:post, attributed_to: group) post = insert(:post, attributed_to: group)
EventActivity.insert_activity(event, subject: "event_created") EventActivity.insert_activity(event, subject: "event_created")
PostActivity.insert_activity(post, subject: "post_created") PostActivity.insert_activity(post, subject: "post_created")
assert %{success: 2, failure: 0} == Oban.drain_queue(queue: :activity) assert %{success: 2, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :activity)
assert Activities.list_activities() |> length() == 2 assert Activities.list_activities() |> length() == 2
res = res =
@ -318,7 +318,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ActivityTest do
Process.sleep(1000) Process.sleep(1000)
Posts.delete_post(post) Posts.delete_post(post)
PostActivity.insert_activity(post, subject: "post_deleted") PostActivity.insert_activity(post, subject: "post_deleted")
assert %{success: 2, failure: 0} == Oban.drain_queue(queue: :activity) assert %{success: 2, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :activity)
assert Activities.list_activities() |> length() == 2 assert Activities.list_activities() |> length() == 2
res = res =

View File

@ -384,7 +384,7 @@ defmodule Mobilizon.Web.Resolvers.GroupTest do
# Can't be used right now, probably because we try to run a transaction in a Oban Job while using Ecto Sandbox # Can't be used right now, probably because we try to run a transaction in a Oban Job while using Ecto Sandbox
# assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :background) # assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :background)
# res = # res =
# conn # conn

View File

@ -519,7 +519,7 @@ defmodule Mobilizon.GraphQL.Resolvers.PersonTest do
} }
) )
assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :background) assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :background)
query = """ query = """
{ {
@ -719,7 +719,7 @@ defmodule Mobilizon.GraphQL.Resolvers.PersonTest do
assert is_nil(res["errors"]) assert is_nil(res["errors"])
assert res["data"]["suspendProfile"]["id"] == to_string(remote_profile_id) assert res["data"]["suspendProfile"]["id"] == to_string(remote_profile_id)
assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :background) assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :background)
res = res =
conn conn

View File

@ -1393,7 +1393,7 @@ defmodule Mobilizon.GraphQL.Resolvers.UserTest do
assert is_nil(Users.get_user(user.id)) assert is_nil(Users.get_user(user.id))
assert %{success: 2, failure: 0} == Oban.drain_queue(queue: :background) assert %{success: 2, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :background)
assert_raise Ecto.NoResultsError, fn -> assert_raise Ecto.NoResultsError, fn ->
Events.get_event!(event_id) Events.get_event!(event_id)

View File

@ -330,7 +330,7 @@ defmodule Mobilizon.ActorsTest do
} }
) )
assert %{success: 1, failure: 0} == Oban.drain_queue(queue: :background) assert %{success: 1, snoozed: 0, failure: 0} == Oban.drain_queue(queue: :background)
assert %Actor{ assert %Actor{
name: nil, name: nil,