Skip to content

Commit

Permalink
Merge branch 'fix-random-test-errors' into 'develop'
Browse files Browse the repository at this point in the history
Fix random test failures, revert auto-retry failed tests

See merge request pleroma/pleroma!4221
  • Loading branch information
feld committed Aug 13, 2024
2 parents ccf476a + b281ad0 commit 5174c29
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ unit-testing-1.13.4-otp-25:
script: &testing_script
- mix ecto.create
- mix ecto.migrate
- mix pleroma.test_runner --cover --preload-modules
- mix test --cover --preload-modules
coverage: '/^Line total: ([^ ]*%)$/'
artifacts:
reports:
Expand Down
Empty file.
25 changes: 0 additions & 25 deletions lib/mix/tasks/pleroma/test_runner.ex

This file was deleted.

17 changes: 16 additions & 1 deletion test/mix/tasks/pleroma/uploads_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
# SPDX-License-Identifier: AGPL-3.0-only

defmodule Mix.Tasks.Pleroma.UploadsTest do
alias Pleroma.Config
alias Pleroma.Upload
use Pleroma.DataCase
use Pleroma.DataCase, async: false

import Mock

setup_all do
prep_uploads()
Mix.shell(Mix.Shell.Process)

on_exit(fn ->
Expand All @@ -18,6 +20,8 @@ defmodule Mix.Tasks.Pleroma.UploadsTest do
:ok
end

setup do: clear_config([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)

describe "running migrate_local" do
test "uploads migrated" do
with_mock Upload,
Expand Down Expand Up @@ -53,4 +57,15 @@ defmodule Mix.Tasks.Pleroma.UploadsTest do
end
end
end

defp prep_uploads do
upload_dir = Config.get([Pleroma.Uploaders.Local, :uploads])

if not File.exists?(upload_dir) || File.ls!(upload_dir) == [] do
File.mkdir_p(upload_dir)

Path.join([upload_dir, "file.txt"])
|> File.touch()
end
end
end

0 comments on commit 5174c29

Please sign in to comment.