summaryrefslogtreecommitdiff
path: root/config/test.exs
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2023-12-20 17:49:30 -0500
committerMark Felder <feld@feld.me>2023-12-20 23:13:33 +0000
commit928bda2e439285ef3e662290c0cc6b782909fb82 (patch)
treec0fdde75c8a64b239bd86bf8ac00f48182deaa9b /config/test.exs
parent56618873af1aa08f6c271b6cd0f0cbcdfd56bcf1 (diff)
downloadpleroma-928bda2e439285ef3e662290c0cc6b782909fb82.tar.gz
pleroma-928bda2e439285ef3e662290c0cc6b782909fb82.zip
Fix invalid string comparison for OTP versions and replace with config
Old way was wrong for multiple reasons. If we do this as a config value it fixes :slave.start/3 being picked up as a compile warning on OTP26. Also if we want to do any real clustering we'll need something like this to support OTP25 and older.
Diffstat (limited to 'config/test.exs')
-rw-r--r--config/test.exs9
1 files changed, 9 insertions, 0 deletions
diff --git a/config/test.exs b/config/test.exs
index 8a42b863a..60cdacb0e 100644
--- a/config/test.exs
+++ b/config/test.exs
@@ -153,6 +153,15 @@ config :pleroma, Pleroma.Upload, config_impl: Pleroma.UnstubbedConfigMock
config :pleroma, Pleroma.ScheduledActivity, config_impl: Pleroma.UnstubbedConfigMock
config :pleroma, Pleroma.Web.RichMedia.Helpers, config_impl: Pleroma.StaticStubbedConfigMock
+peer_module =
+ if String.to_integer(System.otp_release()) >= 25 do
+ :peer
+ else
+ :slave
+ end
+
+config :pleroma, Pleroma.Cluster, peer_module: peer_module
+
if File.exists?("./config/test.secret.exs") do
import_config "test.secret.exs"
else