diff --git a/.github/workflows/pl.yaml b/.github/workflows/pl.yaml index 0e095df3d9..5f0d082a90 100644 --- a/.github/workflows/pl.yaml +++ b/.github/workflows/pl.yaml @@ -1,4 +1,6 @@ -name: PL CI +# Adapter from https://fly.io/phoenix-files/github-actions-for-elixir-ci/ + +name: pl CI on: push: @@ -9,21 +11,13 @@ on: env: ELIXIR_VER: 1.15.8 POSTGRES_DB: pleroma_test - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - # DB_HOST: postgres - DB_PORT: "5432" MIX_ENV: test permissions: contents: read - jobs: test: - # Set up a Postgres DB service. By default, Phoenix applications - # use Postgres. This creates a database for running tests. - # Additional services can be defined here if required. services: db: image: postgres:12 @@ -41,28 +35,22 @@ jobs: runs-on: ubuntu-latest name: Test on OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} strategy: - # Specify the OTP and Elixir versions to use when building - # and running the workflow steps. matrix: - otp: ['25.0.4'] # Define the OTP version [required] - elixir: ['1.15.8'] # Define the elixir version [required] + otp: ['26.2.5'] + elixir: ['1.15.8'] steps: - # Step: Install system dependencies - name: Install system dependencies run: sudo apt install -y imagemagick ffmpeg libimage-exiftool-perl - # Step: Setup Elixir + Erlang image as the base. - name: Set up Elixir uses: erlef/setup-beam@v1 with: otp-version: ${{matrix.otp}} elixir-version: ${{matrix.elixir}} - # Step: Check out the code. - name: Checkout code uses: actions/checkout@v3 - # Step: Define how to cache deps. Restores existing cache if present. - name: Cache deps id: cache-deps uses: actions/cache@v3 @@ -74,9 +62,6 @@ jobs: restore-keys: | ${{ runner.os }}-mix-${{ env.cache-name }}- - # Step: Define how to cache the `_build` directory. After the first run, - # this speeds up tests runs a lot. This includes not re-compiling our - # project's downloaded deps every run. - name: Cache compiled build id: cache-build uses: actions/cache@v3 @@ -89,23 +74,15 @@ jobs: ${{ runner.os }}-mix-${{ env.cache-name }}- ${{ runner.os }}-mix- - # Step: Download project dependencies. If unchanged, uses - # the cached version. - name: Install dependencies run: mix deps.get - # Step: Compile the project treating any warnings as errors. - # Customize this step if a different behavior is desired. - name: Compiles without warnings run: mix compile --warnings-as-errors - # Step: Check that the checked in code has already been formatted. - # This step fails if something was found unformatted. - # Customize this step as desired. - name: Check Formatting run: mix format --check-formatted - # Step: Execute the tests. - name: Run tests run: | mix ecto.create diff --git a/priv/repo/migrations/20200806175913_rename_instance_chat.exs b/priv/repo/migrations/20200806175913_rename_instance_chat.exs index 44d3530996..a89c15057e 100644 --- a/priv/repo/migrations/20200806175913_rename_instance_chat.exs +++ b/priv/repo/migrations/20200806175913_rename_instance_chat.exs @@ -5,8 +5,6 @@ defmodule Pleroma.Repo.Migrations.RenameInstanceChat do use Ecto.Migration - alias Pleroma.ConfigDB - def up, do: :noop def down, do: :noop end diff --git a/test/pleroma/web/activity_pub/transmogrifier/question_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/question_handling_test.exs index 100210826a..ca921d77c3 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/question_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/question_handling_test.exs @@ -182,7 +182,7 @@ test "it strips voters list and displays voters count instead" do }) object = Object.normalize(activity, fetch: false) - {:ok, _, _} = CommonAPI.vote(other_user, object, [1]) + {:ok, _, _} = CommonAPI.vote(object, other_user, [1]) {:ok, modified} = Transmogrifier.prepare_outgoing(activity.data) diff --git a/test/pleroma/webhook_test.ex b/test/pleroma/webhook_test.ex deleted file mode 100644 index 21763f1e00..0000000000 --- a/test/pleroma/webhook_test.ex +++ /dev/null @@ -1,57 +0,0 @@ -# Pleroma: A lightweight social networking server -# Copyright © 2017-2022 Pleroma Authors -# SPDX-License-Identifier: AGPL-3.0-only - -defmodule Pleroma.WebhookTest do - use Pleroma.DataCase, async: true - - alias Pleroma.Repo - alias Pleroma.Webhook - - test "creating a webhook" do - %{id: id} = Webhook.create(%{url: "https://example.com/webhook", events: [:"report.created"]}) - - assert %{url: "https://example.com/webhook"} = Webhook.get(id) - end - - test "editing a webhook" do - %{id: id} = - webhook = Webhook.create(%{url: "https://example.com/webhook", events: [:"report.created"]}) - - Webhook.update(webhook, %{events: [:"account.created"]}) - - assert %{events: [:"account.created"]} = Webhook.get(id) - end - - test "filter webhooks by type" do - %{id: id1} = - Webhook.create(%{url: "https://example.com/webhook1", events: [:"report.created"]}) - - %{id: id2} = - Webhook.create(%{ - url: "https://example.com/webhook2", - events: [:"account.created", :"report.created"] - }) - - Webhook.create(%{url: "https://example.com/webhook3", events: [:"account.created"]}) - - assert [%{id: ^id1}, %{id: ^id2}] = Webhook.get_by_type(:"report.created") - end - - test "change webhook state" do - %{id: id, enabled: true} = - webhook = Webhook.create(%{url: "https://example.com/webhook", events: [:"report.created"]}) - - Webhook.set_enabled(webhook, false) - assert %{enabled: false} = Webhook.get(id) - end - - test "rotate webhook secrets" do - %{id: id, secret: secret} = - webhook = Webhook.create(%{url: "https://example.com/webhook", events: [:"report.created"]}) - - Webhook.rotate_secret(webhook) - %{secret: new_secret} = Webhook.get(id) - assert secret != new_secret - end -end