Fix test get_user_apps/1
authorIlja <ilja@ilja.space>
Tue, 22 Feb 2022 17:56:26 +0000 (18:56 +0100)
committerFloatingGhost <hannah@coffee-and-dreams.uk>
Wed, 29 Jun 2022 19:43:41 +0000 (20:43 +0100)
commit8b843be03ef5c2c15e8f43850810ee4c4cfc8587
tree18af51d9ced2f80b62a3eb97340d972f984d9403
parent8de65de3b9ffe17b0ff2a507f5a747f4b8119010
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
test/pleroma/web/o_auth/app_test.exs