From 7286e724dce83854848e33842bccc4c41606f993 Mon Sep 17 00:00:00 2001 From: Chris Eager Date: Thu, 23 May 2024 10:44:09 -0500 Subject: [PATCH] Add SIGNAL_SERVER_CONFIG override to LocalWhisperServerService --- .../textsecuregcm/LocalWhisperServerService.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/LocalWhisperServerService.java b/service/src/test/java/org/whispersystems/textsecuregcm/LocalWhisperServerService.java index ebf83d868..5d06c5b7b 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/LocalWhisperServerService.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/LocalWhisperServerService.java @@ -6,6 +6,7 @@ package org.whispersystems.textsecuregcm; import io.dropwizard.util.Resources; +import java.util.Optional; /** * This class may be run directly from a correctly configured IDE, or using the command line: @@ -13,9 +14,14 @@ import io.dropwizard.util.Resources; * ./mvnw clean integration-test -DskipTests=true -Ptest-server *

* NOTE: many features are non-functional, especially those that depend on external services + *

+ * By default, it will use {@code config/test.yml}, but this may be overridden by setting an environment variable, + * {@value SIGNAL_SERVER_CONFIG_ENV_VAR}, with a custom path. */ public class LocalWhisperServerService { + private static final String SIGNAL_SERVER_CONFIG_ENV_VAR = "SIGNAL_SERVER_CONFIG"; + public static void main(String[] args) throws Exception { System.setProperty("secrets.bundle.filename", @@ -23,6 +29,9 @@ public class LocalWhisperServerService { System.setProperty("sqlite.dir", "service/target/lib"); System.setProperty("aws.region", "local-test-region"); - new WhisperServerService().run("server", Resources.getResource("config/test.yml").getPath()); + final String config = Optional.ofNullable(System.getenv(SIGNAL_SERVER_CONFIG_ENV_VAR)) + .orElse(Resources.getResource("config/test.yml").getPath()); + + new WhisperServerService().run("server", config); } }