Skip to content

Reset http security settings to fix plug test

h3poteto requested to merge h3poteto/pleroma:fix/test into develop

Now, sometimes a test is failed; like https://git.pleroma.social/normandy/pleroma/-/jobs/9602

  1) test referrer-policy header reflects configured value (Pleroma.Web.Plugs.HTTPSecurityPlugTest)
     test/plugs/http_security_plug_test.exs:62
     Assertion with == failed
     code:  assert Conn.get_resp_header(conn, "referrer-policy") == ["same-origin"]
     left:  []
     right: ["same-origin"]
     stacktrace:
       test/plugs/http_security_plug_test.exs:67: (test)

So I fixed http_security_plug_test.

Now the order of tests is random, so sometimes Config.put([:http_security, :enabled], false) runs before referrer-policy header reflects configured value. So I reset this setting before test referrer.

Merge request reports

Loading