summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2023-12-13 10:05:18 +0000
committerlain <lain@soykaf.club>2023-12-13 10:05:18 +0000
commit02acf7c0b3e6711262f9f57cfc0554ce8e4ed50d (patch)
tree316110a818dfeb9630acbb83b2f721a180199bad
parent29d202e1df0cfbe110059815ca654ed1d3d93e41 (diff)
parent1458de92f0eb2e743c359a86a27db83b117595e9 (diff)
downloadpleroma-02acf7c0b3e6711262f9f57cfc0554ce8e4ed50d.tar.gz
pleroma-02acf7c0b3e6711262f9f57cfc0554ce8e4ed50d.zip
Merge branch 'fix-develop-tests' into 'develop'
StatusViewTest: Fix tests. See merge request pleroma/pleroma!3998
-rw-r--r--.gitlab-ci.yml18
-rw-r--r--changelog.d/fix-tests.skip0
-rw-r--r--ci/postgres_rum/Dockerfile3
-rwxr-xr-xci/postgres_rum/build_and_push.sh1
-rw-r--r--test/pleroma/web/mastodon_api/views/status_view_test.exs8
5 files changed, 12 insertions, 18 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b848d3c98..eb31a8086 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -154,22 +154,6 @@ unit-testing-erratic:
- mix ecto.migrate
- mix test --only=erratic
-# Removed to fix CI issue. In this early state it wasn't adding much value anyway.
-# TODO Fix and reinstate federated testing
-# federated-testing:
-# stage: test
-# cache: *testing_cache_policy
-# services:
-# - name: minibikini/postgres-with-rum:12
-# alias: postgres
-# command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
-# script:
-# - mix deps.get
-# - mix ecto.create
-# - mix ecto.migrate
-# - epmd -daemon
-# - mix test --trace --only federated
-
unit-testing-rum:
extends:
- .build_changes_policy
@@ -177,7 +161,7 @@ unit-testing-rum:
stage: test
cache: *testing_cache_policy
services:
- - name: minibikini/postgres-with-rum:12
+ - name: git.pleroma.social:5050/pleroma/pleroma/postgres-with-rum-13
alias: postgres
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
variables:
diff --git a/changelog.d/fix-tests.skip b/changelog.d/fix-tests.skip
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/changelog.d/fix-tests.skip
diff --git a/ci/postgres_rum/Dockerfile b/ci/postgres_rum/Dockerfile
new file mode 100644
index 000000000..dc727df1d
--- /dev/null
+++ b/ci/postgres_rum/Dockerfile
@@ -0,0 +1,3 @@
+FROM postgres:13-bullseye
+
+RUN apt-get update && apt-get install -y postgresql-13-rum/bullseye-pgdg
diff --git a/ci/postgres_rum/build_and_push.sh b/ci/postgres_rum/build_and_push.sh
new file mode 100755
index 000000000..c437b64a7
--- /dev/null
+++ b/ci/postgres_rum/build_and_push.sh
@@ -0,0 +1 @@
+docker buildx build --platform linux/amd64,linux/arm64 -t git.pleroma.social:5050/pleroma/pleroma/postgres-with-rum-13:latest --push .
diff --git a/test/pleroma/web/mastodon_api/views/status_view_test.exs b/test/pleroma/web/mastodon_api/views/status_view_test.exs
index b31955891..d82eeb7af 100644
--- a/test/pleroma/web/mastodon_api/views/status_view_test.exs
+++ b/test/pleroma/web/mastodon_api/views/status_view_test.exs
@@ -11,6 +11,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
alias Pleroma.HTML
alias Pleroma.Object
alias Pleroma.Repo
+ alias Pleroma.UnstubbedConfigMock, as: ConfigMock
alias Pleroma.User
alias Pleroma.UserRelationship
alias Pleroma.Web.CommonAPI
@@ -19,9 +20,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
require Bitwise
+ import Mox
+ import OpenApiSpex.TestAssertions
import Pleroma.Factory
import Tesla.Mock
- import OpenApiSpex.TestAssertions
setup do
mock(fn env -> apply(HttpRequestMock, :request, [env]) end)
@@ -198,6 +200,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
assert_schema(status, "Status", Pleroma.Web.ApiSpec.spec())
end
+ @tag capture_log: true
test "returns a temporary ap_id based user for activities missing db users" do
user = insert(:user)
@@ -784,6 +787,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
clear_config([:media_proxy, :enabled], true)
clear_config([:media_preview_proxy, :enabled])
+ ConfigMock
+ |> stub_with(Pleroma.Test.StaticConfig)
+
page_url = "http://example.com"
card = %{