Merge branch 'cachex-test' into 'develop'
Test framework overhaul (speed, reliability) See merge request pleroma/pleroma!3209
This commit is contained in:
commit
e4f1d8f48c
203 changed files with 659 additions and 430 deletions
|
|
@ -3,6 +3,7 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.CountStatusesTest do
|
||||
# Uses log capture, has to stay synchronous
|
||||
use Pleroma.DataCase
|
||||
|
||||
alias Pleroma.User
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.DatabaseTest do
|
||||
use Pleroma.DataCase
|
||||
use Pleroma.DataCase, async: true
|
||||
use Oban.Testing, repo: Pleroma.Repo
|
||||
|
||||
alias Pleroma.Activity
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-onl
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Ecto.MigrateTest do
|
||||
use Pleroma.DataCase, async: true
|
||||
use Pleroma.DataCase
|
||||
import ExUnit.CaptureLog
|
||||
require Logger
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Ecto.RollbackTest do
|
||||
use Pleroma.DataCase
|
||||
use Pleroma.DataCase, async: true
|
||||
import ExUnit.CaptureLog
|
||||
require Logger
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.InstanceTest do
|
||||
use ExUnit.Case
|
||||
# Modifies the Application Environment, has to stay synchronous.
|
||||
use Pleroma.DataCase
|
||||
|
||||
setup do
|
||||
File.mkdir_p!(tmp_path())
|
||||
|
|
@ -15,15 +16,17 @@ defmodule Mix.Tasks.Pleroma.InstanceTest do
|
|||
if File.exists?(static_dir) do
|
||||
File.rm_rf(Path.join(static_dir, "robots.txt"))
|
||||
end
|
||||
|
||||
Pleroma.Config.put([:instance, :static_dir], static_dir)
|
||||
end)
|
||||
|
||||
# Is being modified by the mix task.
|
||||
clear_config([:instance, :static_dir])
|
||||
|
||||
:ok
|
||||
end
|
||||
|
||||
@uuid Ecto.UUID.generate()
|
||||
defp tmp_path do
|
||||
"/tmp/generated_files/"
|
||||
"/tmp/generated_files/#{@uuid}/"
|
||||
end
|
||||
|
||||
test "running gen" do
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.RefreshCounterCacheTest do
|
||||
# Uses log capture, has to stay synchronous
|
||||
use Pleroma.DataCase
|
||||
alias Pleroma.Web.CommonAPI
|
||||
import ExUnit.CaptureIO, only: [capture_io: 1]
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ defmodule Mix.Tasks.Pleroma.RelayTest do
|
|||
end)
|
||||
|
||||
Pleroma.Repo.delete(user)
|
||||
Cachex.clear(:user_cache)
|
||||
User.invalidate_cache(user)
|
||||
|
||||
Mix.Tasks.Pleroma.Relay.run(["unfollow", target_instance])
|
||||
|
||||
|
|
@ -137,7 +137,7 @@ defmodule Mix.Tasks.Pleroma.RelayTest do
|
|||
end)
|
||||
|
||||
Pleroma.Repo.delete(user)
|
||||
Cachex.clear(:user_cache)
|
||||
User.invalidate_cache(user)
|
||||
|
||||
Mix.Tasks.Pleroma.Relay.run(["unfollow", target_instance, "--force"])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue