Merge branch 'fix/1742-random-failing-tests' into 'develop'
Fix sporadically failing tests See merge request pleroma/pleroma!2524
This commit is contained in:
commit
da550be066
10 changed files with 45 additions and 51 deletions
|
|
@ -2862,26 +2862,25 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
|
|||
group: ":pleroma",
|
||||
key: ":http",
|
||||
value: [
|
||||
%{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "localhost", 1234]}]},
|
||||
%{"tuple" => [":send_user_agent", false]}
|
||||
%{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "localhost", 1234]}]}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
assert json_response(conn, 200) == %{
|
||||
assert %{
|
||||
"configs" => [
|
||||
%{
|
||||
"group" => ":pleroma",
|
||||
"key" => ":http",
|
||||
"value" => [
|
||||
%{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "localhost", 1234]}]},
|
||||
%{"tuple" => [":send_user_agent", false]}
|
||||
],
|
||||
"db" => [":proxy_url", ":send_user_agent"]
|
||||
"value" => value,
|
||||
"db" => db
|
||||
}
|
||||
]
|
||||
}
|
||||
} = json_response(conn, 200)
|
||||
|
||||
assert %{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "localhost", 1234]}]} in value
|
||||
assert ":proxy_url" in db
|
||||
end
|
||||
|
||||
test "proxy tuple domain", %{conn: conn} do
|
||||
|
|
@ -2892,26 +2891,25 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
|
|||
group: ":pleroma",
|
||||
key: ":http",
|
||||
value: [
|
||||
%{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "domain.com", 1234]}]},
|
||||
%{"tuple" => [":send_user_agent", false]}
|
||||
%{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "domain.com", 1234]}]}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
assert json_response(conn, 200) == %{
|
||||
assert %{
|
||||
"configs" => [
|
||||
%{
|
||||
"group" => ":pleroma",
|
||||
"key" => ":http",
|
||||
"value" => [
|
||||
%{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "domain.com", 1234]}]},
|
||||
%{"tuple" => [":send_user_agent", false]}
|
||||
],
|
||||
"db" => [":proxy_url", ":send_user_agent"]
|
||||
"value" => value,
|
||||
"db" => db
|
||||
}
|
||||
]
|
||||
}
|
||||
} = json_response(conn, 200)
|
||||
|
||||
assert %{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "domain.com", 1234]}]} in value
|
||||
assert ":proxy_url" in db
|
||||
end
|
||||
|
||||
test "proxy tuple ip", %{conn: conn} do
|
||||
|
|
@ -2922,26 +2920,25 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
|
|||
group: ":pleroma",
|
||||
key: ":http",
|
||||
value: [
|
||||
%{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "127.0.0.1", 1234]}]},
|
||||
%{"tuple" => [":send_user_agent", false]}
|
||||
%{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "127.0.0.1", 1234]}]}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
assert json_response(conn, 200) == %{
|
||||
assert %{
|
||||
"configs" => [
|
||||
%{
|
||||
"group" => ":pleroma",
|
||||
"key" => ":http",
|
||||
"value" => [
|
||||
%{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "127.0.0.1", 1234]}]},
|
||||
%{"tuple" => [":send_user_agent", false]}
|
||||
],
|
||||
"db" => [":proxy_url", ":send_user_agent"]
|
||||
"value" => value,
|
||||
"db" => db
|
||||
}
|
||||
]
|
||||
}
|
||||
} = json_response(conn, 200)
|
||||
|
||||
assert %{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "127.0.0.1", 1234]}]} in value
|
||||
assert ":proxy_url" in db
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -138,8 +138,8 @@ defmodule Pleroma.Web.Feed.TagControllerTest do
|
|||
]
|
||||
|
||||
assert xpath(xml, ~x"//channel/item/pubDate/text()"sl) == [
|
||||
FeedView.pub_date(activity1.data["published"]),
|
||||
FeedView.pub_date(activity2.data["published"])
|
||||
FeedView.pub_date(activity2.data["published"]),
|
||||
FeedView.pub_date(activity1.data["published"])
|
||||
]
|
||||
|
||||
assert xpath(xml, ~x"//channel/item/enclosure/@url"sl) == [
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
|
|||
import Tesla.Mock
|
||||
import Mock
|
||||
|
||||
setup do
|
||||
setup_all do
|
||||
mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
|
||||
:ok
|
||||
end
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ defmodule Pleroma.Web.Push.ImplTest do
|
|||
|
||||
import Pleroma.Factory
|
||||
|
||||
setup_all do
|
||||
Tesla.Mock.mock_global(fn
|
||||
setup do
|
||||
Tesla.Mock.mock(fn
|
||||
%{method: :post, url: "https://example.com/example/1234"} ->
|
||||
%Tesla.Env{status: 200}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Web.RelMeTest do
|
||||
use ExUnit.Case, async: true
|
||||
use ExUnit.Case
|
||||
|
||||
setup_all do
|
||||
Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue