[#1878] Fixed ActivityPubTest, fixed CommonAPI.favorite/2 call from LoadTesting.Generator.
This commit is contained in:
parent
83e67b3bbe
commit
a369a3731c
|
@ -10,7 +10,7 @@ defmodule Pleroma.LoadTesting.Generator do
|
||||||
:timer.tc(fn ->
|
:timer.tc(fn ->
|
||||||
Task.async_stream(
|
Task.async_stream(
|
||||||
Enum.take_random(posts, count_likes),
|
Enum.take_random(posts, count_likes),
|
||||||
fn post -> {:ok, _, _} = CommonAPI.favorite(post.id, user) end,
|
fn post -> {:ok, _, _} = CommonAPI.favorite(user, post.id) end,
|
||||||
max_concurrency: 10,
|
max_concurrency: 10,
|
||||||
timeout: 30_000
|
timeout: 30_000
|
||||||
)
|
)
|
||||||
|
|
|
@ -1675,14 +1675,14 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
||||||
{:ok, a4} = CommonAPI.post(user2, %{"status" => "Agent Smith "})
|
{:ok, a4} = CommonAPI.post(user2, %{"status" => "Agent Smith "})
|
||||||
{:ok, a5} = CommonAPI.post(user1, %{"status" => "Red or Blue "})
|
{:ok, a5} = CommonAPI.post(user1, %{"status" => "Red or Blue "})
|
||||||
|
|
||||||
{:ok, _, _} = CommonAPI.favorite(a4.id, user)
|
{:ok, _} = CommonAPI.favorite(user, a4.id)
|
||||||
{:ok, _, _} = CommonAPI.favorite(a3.id, other_user)
|
{:ok, _} = CommonAPI.favorite(other_user, a3.id)
|
||||||
{:ok, _, _} = CommonAPI.favorite(a3.id, user)
|
{:ok, _} = CommonAPI.favorite(user, a3.id)
|
||||||
{:ok, _, _} = CommonAPI.favorite(a5.id, other_user)
|
{:ok, _} = CommonAPI.favorite(other_user, a5.id)
|
||||||
{:ok, _, _} = CommonAPI.favorite(a5.id, user)
|
{:ok, _} = CommonAPI.favorite(user, a5.id)
|
||||||
{:ok, _, _} = CommonAPI.favorite(a4.id, other_user)
|
{:ok, _} = CommonAPI.favorite(other_user, a4.id)
|
||||||
{:ok, _, _} = CommonAPI.favorite(a1.id, user)
|
{:ok, _} = CommonAPI.favorite(user, a1.id)
|
||||||
{:ok, _, _} = CommonAPI.favorite(a1.id, other_user)
|
{:ok, _} = CommonAPI.favorite(other_user, a1.id)
|
||||||
result = ActivityPub.fetch_favourites(user)
|
result = ActivityPub.fetch_favourites(user)
|
||||||
|
|
||||||
assert Enum.map(result, & &1.id) == [a1.id, a5.id, a3.id, a4.id]
|
assert Enum.map(result, & &1.id) == [a1.id, a5.id, a3.id, a4.id]
|
||||||
|
|
Loading…
Reference in New Issue