diff options
author | lain <lain@soykaf.club> | 2020-12-26 10:26:35 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-12-26 10:26:35 +0000 |
commit | e4f1d8f48c85b8a388d6c3945db157de5ce588c5 (patch) | |
tree | 3a3da119eb71a0536bd5f23226834dfea634d74a /test/support/conn_case.ex | |
parent | 88530c02d60900d1e0920d50c6c081a59010ea09 (diff) | |
parent | fecefe68f88014ad2f8b5f290f3b0c7692fa3fef (diff) | |
download | pleroma-e4f1d8f48c85b8a388d6c3945db157de5ce588c5.tar.gz pleroma-e4f1d8f48c85b8a388d6c3945db157de5ce588c5.zip |
Merge branch 'cachex-test' into 'develop'
Test framework overhaul (speed, reliability)
See merge request pleroma/pleroma!3209
Diffstat (limited to 'test/support/conn_case.ex')
-rw-r--r-- | test/support/conn_case.ex | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/support/conn_case.ex b/test/support/conn_case.ex index 47cb65a80..02f49c590 100644 --- a/test/support/conn_case.ex +++ b/test/support/conn_case.ex @@ -116,12 +116,16 @@ defmodule Pleroma.Web.ConnCase do end setup tags do - Cachex.clear(:user_cache) - Cachex.clear(:object_cache) :ok = Ecto.Adapters.SQL.Sandbox.checkout(Pleroma.Repo) - unless tags[:async] do + if tags[:async] do + Mox.stub_with(Pleroma.CachexMock, Pleroma.NullCache) + Mox.set_mox_private() + else Ecto.Adapters.SQL.Sandbox.mode(Pleroma.Repo, {:shared, self()}) + Mox.stub_with(Pleroma.CachexMock, Pleroma.CachexProxy) + Mox.set_mox_global() + Pleroma.DataCase.clear_cachex() end if tags[:needs_streamer] do @@ -132,6 +136,8 @@ defmodule Pleroma.Web.ConnCase do }) end + Pleroma.DataCase.stub_pipeline() + {:ok, conn: Phoenix.ConnTest.build_conn()} end end |