1 defmodule Pleroma.Config.ReleaseRuntimeProviderTest do
2 use ExUnit.Case, async: true
4 alias Pleroma.Config.ReleaseRuntimeProvider
7 test "loads release defaults config and warns about non-existent runtime config" do
8 ExUnit.CaptureIO.capture_io(fn ->
9 merged = ReleaseRuntimeProvider.load([], [])
10 assert merged == Pleroma.Config.Holder.release_defaults()
12 "!!! Config path is not declared! Please ensure it exists and that PLEROMA_CONFIG_PATH is unset or points to an existing file"
15 test "merged runtime config" do
17 ReleaseRuntimeProvider.load([], config_path: "test/fixtures/config/temp.secret.exs")
19 assert merged[:pleroma][:first_setting] == [key: "value", key2: [Pleroma.Repo]]
20 assert merged[:pleroma][:second_setting] == [key: "value2", key2: ["Activity"]]
23 test "merged exported config" do
24 ExUnit.CaptureIO.capture_io(fn ->
26 ReleaseRuntimeProvider.load([],
27 exported_config_path: "test/fixtures/config/temp.exported_from_db.secret.exs"
30 assert merged[:pleroma][:exported_config_merged]
32 "!!! Config path is not declared! Please ensure it exists and that PLEROMA_CONFIG_PATH is unset or points to an existing file"
35 test "runtime config is merged with exported config" do
37 ReleaseRuntimeProvider.load([],
38 config_path: "test/fixtures/config/temp.secret.exs",
39 exported_config_path: "test/fixtures/config/temp.exported_from_db.secret.exs"
42 assert merged[:pleroma][:first_setting] == [key2: [Pleroma.Repo], key: "new value"]