projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c3ed86c
)
fix all tests
author
FloatingGhost
<hannah@coffee-and-dreams.uk>
Sat, 11 Jun 2022 15:14:22 +0000
(16:14 +0100)
committer
FloatingGhost
<hannah@coffee-and-dreams.uk>
Sat, 11 Jun 2022 15:14:22 +0000
(16:14 +0100)
12 files changed:
config/config.exs
patch
|
blob
|
history
lib/pleroma/search/builtin.ex
patch
|
blob
|
history
lib/pleroma/web/activity_pub/activity_pub.ex
patch
|
blob
|
history
lib/pleroma/web/activity_pub/utils.ex
patch
|
blob
|
history
lib/pleroma/web/pleroma_api/controllers/emoji_reaction_controller.ex
patch
|
blob
|
history
test/pleroma/reverse_proxy_test.exs
patch
|
blob
|
history
test/pleroma/web/activity_pub/side_effects_test.exs
patch
|
blob
|
history
test/pleroma/web/admin_api/controllers/report_controller_test.exs
patch
|
blob
|
history
test/pleroma/web/common_api/utils_test.exs
patch
|
blob
|
history
test/pleroma/web/mastodon_api/controllers/search_controller_test.exs
patch
|
blob
|
history
test/pleroma/web/mastodon_api/views/status_view_test.exs
patch
|
blob
|
history
test/pleroma/web/metadata/providers/open_graph_test.exs
patch
|
blob
|
history
diff --git
a/config/config.exs
b/config/config.exs
index 5fced7029c336180e7811f3724dd16e7d659c1ce..417f298d702836cb959bb0af84c408feb7b482f5 100644
(file)
--- a/
config/config.exs
+++ b/
config/config.exs
@@
-152,12
+152,12
@@
config :pleroma, Pleroma.Web.Endpoint,
config :logger, truncate: 65536
config :logger, :console,
config :logger, truncate: 65536
config :logger, :console,
- level: :
debug
,
+ level: :
info
,
format: "\n$time $metadata[$level] $message\n",
metadata: [:request_id]
config :logger, :ex_syslogger,
format: "\n$time $metadata[$level] $message\n",
metadata: [:request_id]
config :logger, :ex_syslogger,
- level: :
debug
,
+ level: :
info
,
ident: "pleroma",
format: "$metadata[$level] $message",
metadata: [:request_id]
ident: "pleroma",
format: "$metadata[$level] $message",
metadata: [:request_id]
diff --git
a/lib/pleroma/search/builtin.ex
b/lib/pleroma/search/builtin.ex
index 019713f5274991fbcf1bed4d42f8e62da4e3ba51..3cbe2207ac5c6bdd2949a8af672f919a532649f8 100644
(file)
--- a/
lib/pleroma/search/builtin.ex
+++ b/
lib/pleroma/search/builtin.ex
@@
-14,6
+14,7
@@
defmodule Pleroma.Search.Builtin do
def search(_conn, %{q: query} = params, options) do
version = Keyword.get(options, :version)
timeout = Keyword.get(Repo.config(), :timeout, 15_000)
def search(_conn, %{q: query} = params, options) do
version = Keyword.get(options, :version)
timeout = Keyword.get(Repo.config(), :timeout, 15_000)
+ query = String.trim(query)
default_values = %{"statuses" => [], "accounts" => [], "hashtags" => []}
default_values
default_values = %{"statuses" => [], "accounts" => [], "hashtags" => []}
default_values
diff --git
a/lib/pleroma/web/activity_pub/activity_pub.ex
b/lib/pleroma/web/activity_pub/activity_pub.ex
index b43929891fb95fa1b92a24faffd6c98543794bba..7560969525f041506c629c488a700aa92cee0d92 100644
(file)
--- a/
lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/
lib/pleroma/web/activity_pub/activity_pub.ex
@@
-1321,7
+1321,7
@@
defmodule Pleroma.Web.ActivityPub.ActivityPub do
fetch_activities_query_ap_ids_ops(opts)
config = %{
fetch_activities_query_ap_ids_ops(opts)
config = %{
- skip_thread_containment:
true
+ skip_thread_containment:
Config.get([:instance, :skip_thread_containment])
}
query =
}
query =
diff --git
a/lib/pleroma/web/activity_pub/utils.ex
b/lib/pleroma/web/activity_pub/utils.ex
index 637db384042347fdfcb10e8319636a4611c7e896..6a8360def7003269319f2938fb3b2479962458c9 100644
(file)
--- a/
lib/pleroma/web/activity_pub/utils.ex
+++ b/
lib/pleroma/web/activity_pub/utils.ex
@@
-543,7
+543,6
@@
defmodule Pleroma.Web.ActivityPub.Utils do
end
def get_latest_reaction(internal_activity_id, %{ap_id: ap_id}, emoji) do
end
def get_latest_reaction(internal_activity_id, %{ap_id: ap_id}, emoji) do
- IO.inspect(emoji)
%{data: %{"object" => object_ap_id}} = Activity.get_by_id(internal_activity_id)
emoji = Pleroma.Emoji.maybe_quote(emoji)
%{data: %{"object" => object_ap_id}} = Activity.get_by_id(internal_activity_id)
emoji = Pleroma.Emoji.maybe_quote(emoji)
diff --git
a/lib/pleroma/web/pleroma_api/controllers/emoji_reaction_controller.ex
b/lib/pleroma/web/pleroma_api/controllers/emoji_reaction_controller.ex
index d1d9363a739937f476af7f3d9b4eb6786f261b43..1de02faf8fa4f2bca7f6804edaa013b68fe4d7e6 100644
(file)
--- a/
lib/pleroma/web/pleroma_api/controllers/emoji_reaction_controller.ex
+++ b/
lib/pleroma/web/pleroma_api/controllers/emoji_reaction_controller.ex
@@
-61,6
+61,7
@@
defmodule Pleroma.Web.PleromaAPI.EmojiReactionController do
|> Stream.map(fn
[emoji, users, url] when is_list(users) -> filter_emoji.(emoji, users, url)
{emoji, users, url} when is_list(users) -> filter_emoji.(emoji, users, url)
|> Stream.map(fn
[emoji, users, url] when is_list(users) -> filter_emoji.(emoji, users, url)
{emoji, users, url} when is_list(users) -> filter_emoji.(emoji, users, url)
+ {emoji, users} when is_list(users) -> filter_emoji.(emoji, users, nil)
_ -> nil
end)
|> Stream.reject(&is_nil/1)
_ -> nil
end)
|> Stream.reject(&is_nil/1)
diff --git
a/test/pleroma/reverse_proxy_test.exs
b/test/pleroma/reverse_proxy_test.exs
index a4dd8e99a5d6eb1d9a1629669a0a1440f06a6099..49ddf251d72a5d6f78ce5787582d5ab1f05562cf 100644
(file)
--- a/
test/pleroma/reverse_proxy_test.exs
+++ b/
test/pleroma/reverse_proxy_test.exs
@@
-130,7
+130,7
@@
defmodule Pleroma.ReverseProxyTest do
assert capture_log(fn ->
ReverseProxy.call(conn, "/stream-bytes/50", max_body_length: 30)
end) =~
assert capture_log(fn ->
ReverseProxy.call(conn, "/stream-bytes/50", max_body_length: 30)
end) =~
- "
[warn]
Elixir.Pleroma.ReverseProxy request to /stream-bytes/50 failed while reading/chunking: :body_too_large"
+ "Elixir.Pleroma.ReverseProxy request to /stream-bytes/50 failed while reading/chunking: :body_too_large"
end
end
end
end
diff --git
a/test/pleroma/web/activity_pub/side_effects_test.exs
b/test/pleroma/web/activity_pub/side_effects_test.exs
index c6155ed18d1191f854abc29ebb54c5da27299236..82d43555fec710911b3c37c47c80dbb5e5bff27f 100644
(file)
--- a/
test/pleroma/web/activity_pub/side_effects_test.exs
+++ b/
test/pleroma/web/activity_pub/side_effects_test.exs
@@
-158,7
+158,7
@@
defmodule Pleroma.Web.ActivityPub.SideEffectsTest do
object = Object.get_by_ap_id(emoji_react.data["object"])
assert object.data["reaction_count"] == 1
object = Object.get_by_ap_id(emoji_react.data["object"])
assert object.data["reaction_count"] == 1
- assert ["👌", [user.ap_id]] in object.data["reactions"]
+ assert ["👌", [user.ap_id]
, nil
] in object.data["reactions"]
end
test "creates a notification", %{emoji_react: emoji_react, poster: poster} do
end
test "creates a notification", %{emoji_react: emoji_react, poster: poster} do
diff --git
a/test/pleroma/web/admin_api/controllers/report_controller_test.exs
b/test/pleroma/web/admin_api/controllers/report_controller_test.exs
index 99cc7bbd0505cbfbaef312826e88e841e12db427..642b05f3f7623e3f0fe651b636801a771bd8b7cc 100644
(file)
--- a/
test/pleroma/web/admin_api/controllers/report_controller_test.exs
+++ b/
test/pleroma/web/admin_api/controllers/report_controller_test.exs
@@
-360,7
+360,13
@@
defmodule Pleroma.Web.AdminAPI.ReportControllerTest do
response = json_response_and_validate_schema(conn, 200)
notes = hd(response["reports"])["notes"]
response = json_response_and_validate_schema(conn, 200)
notes = hd(response["reports"])["notes"]
- [note, _] = notes
+ assert 2 == Enum.count(notes)
+
+ note =
+ notes
+ |> Enum.find(fn note -> note["content"] == "this is disgusting!" end)
+
+ refute is_nil(note)
assert note["user"]["nickname"] == admin.nickname
assert note["content"] == "this is disgusting!"
assert note["user"]["nickname"] == admin.nickname
assert note["content"] == "this is disgusting!"
diff --git
a/test/pleroma/web/common_api/utils_test.exs
b/test/pleroma/web/common_api/utils_test.exs
index fc01f820acd50fc1a3ae32cb379830b20a3a7585..c4f506fe35ea9f176321579464b239820f9a796e 100644
(file)
--- a/
test/pleroma/web/common_api/utils_test.exs
+++ b/
test/pleroma/web/common_api/utils_test.exs
@@
-309,7
+309,7
@@
defmodule Pleroma.Web.CommonAPI.UtilsTest do
assert capture_log(fn ->
assert Utils.date_to_asctime(date) == expected
assert capture_log(fn ->
assert Utils.date_to_asctime(date) == expected
- end) =~ "[warn] Date #{date} in wrong format, must be ISO 8601"
+ end) =~ "[warn
ing
] Date #{date} in wrong format, must be ISO 8601"
end
test "when date is a Unix timestamp" do
end
test "when date is a Unix timestamp" do
@@
-319,7
+319,7
@@
defmodule Pleroma.Web.CommonAPI.UtilsTest do
assert capture_log(fn ->
assert Utils.date_to_asctime(date) == expected
assert capture_log(fn ->
assert Utils.date_to_asctime(date) == expected
- end) =~ "[warn] Date #{date} in wrong format, must be ISO 8601"
+ end) =~ "[warn
ing
] Date #{date} in wrong format, must be ISO 8601"
end
test "when date is nil" do
end
test "when date is nil" do
@@
-327,13
+327,13
@@
defmodule Pleroma.Web.CommonAPI.UtilsTest do
assert capture_log(fn ->
assert Utils.date_to_asctime(nil) == expected
assert capture_log(fn ->
assert Utils.date_to_asctime(nil) == expected
- end) =~ "[warn] Date in wrong format, must be ISO 8601"
+ end) =~ "[warn
ing
] Date in wrong format, must be ISO 8601"
end
test "when date is a random string" do
assert capture_log(fn ->
assert Utils.date_to_asctime("foo") == ""
end
test "when date is a random string" do
assert capture_log(fn ->
assert Utils.date_to_asctime("foo") == ""
- end) =~ "[warn] Date foo in wrong format, must be ISO 8601"
+ end) =~ "[warn
ing
] Date foo in wrong format, must be ISO 8601"
end
end
end
end
diff --git
a/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs
b/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs
index e31cd0291fd0e264a8338ded17f77fc0b8dc60bd..d0387412c94201fecd6eff828102ff09f4ca7830 100644
(file)
--- a/
test/pleroma/web/mastodon_api/controllers/search_controller_test.exs
+++ b/
test/pleroma/web/mastodon_api/controllers/search_controller_test.exs
@@
-323,7
+323,6
@@
defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
|> assign(:token, insert(:oauth_token, user: user, scopes: ["read"]))
|> get("/api/v1/search?#{query}")
|> json_response_and_validate_schema(200)
|> assign(:token, insert(:oauth_token, user: user, scopes: ["read"]))
|> get("/api/v1/search?#{query}")
|> json_response_and_validate_schema(200)
-
[account] = results["accounts"]
assert account["acct"] == "mike@osada.macgirvin.com"
end
[account] = results["accounts"]
assert account["acct"] == "mike@osada.macgirvin.com"
end
diff --git
a/test/pleroma/web/mastodon_api/views/status_view_test.exs
b/test/pleroma/web/mastodon_api/views/status_view_test.exs
index 9dfdf8bf064da99035d867dc7f2a022cb84fc0f9..3ee53d95c0389cb9a42a7450ec9f0ce259e1bad7 100644
(file)
--- a/
test/pleroma/web/mastodon_api/views/status_view_test.exs
+++ b/
test/pleroma/web/mastodon_api/views/status_view_test.exs
@@
-34,16
+34,25
@@
defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
{:ok, activity} = CommonAPI.post(user, %{status: "dae cofe??"})
{:ok, _} = CommonAPI.react_with_emoji(activity.id, user, "☕")
{:ok, activity} = CommonAPI.post(user, %{status: "dae cofe??"})
{:ok, _} = CommonAPI.react_with_emoji(activity.id, user, "☕")
+ {:ok, _} = CommonAPI.react_with_emoji(activity.id, user, ":dinosaur:")
{:ok, _} = CommonAPI.react_with_emoji(activity.id, third_user, "🍵")
{:ok, _} = CommonAPI.react_with_emoji(activity.id, other_user, "☕")
{:ok, _} = CommonAPI.react_with_emoji(activity.id, third_user, "🍵")
{:ok, _} = CommonAPI.react_with_emoji(activity.id, other_user, "☕")
+ {:ok, _} = CommonAPI.react_with_emoji(activity.id, other_user, ":dinosaur:")
+
activity = Repo.get(Activity, activity.id)
status = StatusView.render("show.json", activity: activity)
assert_schema(status, "Status", Pleroma.Web.ApiSpec.spec())
assert status[:pleroma][:emoji_reactions] == [
activity = Repo.get(Activity, activity.id)
status = StatusView.render("show.json", activity: activity)
assert_schema(status, "Status", Pleroma.Web.ApiSpec.spec())
assert status[:pleroma][:emoji_reactions] == [
- %{name: "☕", count: 2, me: false},
- %{name: "🍵", count: 1, me: false}
+ %{name: "☕", count: 2, me: false, url: nil},
+ %{
+ count: 2,
+ me: false,
+ name: "dinosaur",
+ url: "http://localhost:4001/emoji/dino walking.gif"
+ },
+ %{name: "🍵", count: 1, me: false, url: nil}
]
status = StatusView.render("show.json", activity: activity, for: user)
]
status = StatusView.render("show.json", activity: activity, for: user)
@@
-51,8
+60,14
@@
defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
assert_schema(status, "Status", Pleroma.Web.ApiSpec.spec())
assert status[:pleroma][:emoji_reactions] == [
assert_schema(status, "Status", Pleroma.Web.ApiSpec.spec())
assert status[:pleroma][:emoji_reactions] == [
- %{name: "☕", count: 2, me: true},
- %{name: "🍵", count: 1, me: false}
+ %{name: "☕", count: 2, me: true, url: nil},
+ %{
+ count: 2,
+ me: true,
+ name: "dinosaur",
+ url: "http://localhost:4001/emoji/dino walking.gif"
+ },
+ %{name: "🍵", count: 1, me: false, url: nil}
]
end
]
end
@@
-65,11
+80,10
@@
defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|> Object.update_data(%{"reactions" => %{"☕" => [user.ap_id], "x" => 1}})
activity = Activity.get_by_id(activity.id)
|> Object.update_data(%{"reactions" => %{"☕" => [user.ap_id], "x" => 1}})
activity = Activity.get_by_id(activity.id)
-
status = StatusView.render("show.json", activity: activity, for: user)
assert status[:pleroma][:emoji_reactions] == [
status = StatusView.render("show.json", activity: activity, for: user)
assert status[:pleroma][:emoji_reactions] == [
- %{name: "☕", count: 1, me: true}
+ %{name: "☕", count: 1, me: true
, url: nil
}
]
end
]
end
@@
-89,7
+103,7
@@
defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
status = StatusView.render("show.json", activity: activity)
assert status[:pleroma][:emoji_reactions] == [
status = StatusView.render("show.json", activity: activity)
assert status[:pleroma][:emoji_reactions] == [
- %{name: "☕", count: 1, me: false}
+ %{name: "☕", count: 1, me: false
, url: nil
}
]
status = StatusView.render("show.json", activity: activity, for: user)
]
status = StatusView.render("show.json", activity: activity, for: user)
@@
-101,19
+115,19
@@
defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
status = StatusView.render("show.json", activity: activity)
assert status[:pleroma][:emoji_reactions] == [
status = StatusView.render("show.json", activity: activity)
assert status[:pleroma][:emoji_reactions] == [
- %{name: "☕", count: 2, me: false}
+ %{name: "☕", count: 2, me: false
, url: nil
}
]
status = StatusView.render("show.json", activity: activity, for: user)
assert status[:pleroma][:emoji_reactions] == [
]
status = StatusView.render("show.json", activity: activity, for: user)
assert status[:pleroma][:emoji_reactions] == [
- %{name: "☕", count: 1, me: false}
+ %{name: "☕", count: 1, me: false
, url: nil
}
]
status = StatusView.render("show.json", activity: activity, for: other_user)
assert status[:pleroma][:emoji_reactions] == [
]
status = StatusView.render("show.json", activity: activity, for: other_user)
assert status[:pleroma][:emoji_reactions] == [
- %{name: "☕", count: 1, me: true}
+ %{name: "☕", count: 1, me: true
, url: nil
}
]
end
]
end
diff --git
a/test/pleroma/web/metadata/providers/open_graph_test.exs
b/test/pleroma/web/metadata/providers/open_graph_test.exs
index 28ca8839c4eceef276127c44d658a10fb1066053..d15db20e29dd93ac11b3423a3379244c67df24cb 100644
(file)
--- a/
test/pleroma/web/metadata/providers/open_graph_test.exs
+++ b/
test/pleroma/web/metadata/providers/open_graph_test.exs
@@
-144,7
+144,7
@@
defmodule Pleroma.Web.Metadata.Providers.OpenGraphTest do
[
property: "og:image",
content:
[
property: "og:image",
content:
- "http://localhost:4001/proxy/preview/
LzAnlke-l5oZbNzWsrHfprX1rGw
/aHR0cHM6Ly9wbGVyb21hLmdvdi9hYm91dC9qdWNoZS53ZWJt/juche.webm"
+ "http://localhost:4001/proxy/preview/
FElXD3PfapZSKq-u62Dc3BiaIM8
/aHR0cHM6Ly9wbGVyb21hLmdvdi9hYm91dC9qdWNoZS53ZWJt/juche.webm"
], []} in result
end
], []} in result
end