summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlja <ilja@ilja.space>2022-02-22 18:56:26 +0100
committerIlja <ilja@ilja.space>2022-02-22 18:56:26 +0100
commit6ba93c2cb354eaf5d05fd0d997ee8116dbec5470 (patch)
tree1e019f9a74f1ba51c1dc1160fdb46d3a8f10fff5
parentd91e9cee04f2e4cb809037e4fcfebc295994b563 (diff)
Fix test get_user_apps/1
For some reason I had a test who suddenly failed, mix test test/pleroma/web/o_auth/app_test.exs:54. A user has a list of applications and this test adds them and then sees if the list it gets back is the same as the apps it added. When I ran mix test a day before I didn't have this problem and when I pushed code today in a different MR, the pipeline succeeded (see https://git.pleroma.social/ilja/pleroma/-/jobs/205827), yet locally it failed. So it seems the test can sometimes succeed and sometimes fail, which makes it untrustworthy. The failure I see is because the returned list is in reverse order. I assume that's not per sé wrong. You just want to know if the apps you added are actually there. I fixed the test by first ordering the lists before comparing. AFAICT (and as far as that's relevant) the test got introduced in commit cb2a072e6252b7c3f6473f7cfd1af5c0ec732d7b
-rw-r--r--test/pleroma/web/o_auth/app_test.exs2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/pleroma/web/o_auth/app_test.exs b/test/pleroma/web/o_auth/app_test.exs
index a5223b0a5..3c5ca07ae 100644
--- a/test/pleroma/web/o_auth/app_test.exs
+++ b/test/pleroma/web/o_auth/app_test.exs
@@ -51,6 +51,6 @@ defmodule Pleroma.Web.OAuth.AppTest do
insert(:oauth_app, user_id: user.id)
]
- assert App.get_user_apps(user) == apps
+ assert Enum.sort(App.get_user_apps(user)) == Enum.sort(apps)
end
end