SYMBIONT_PORT=8111 is set in the live service shell, causing runtime.exs to override test.exs's port: 0 even under MIX_ENV=test. Wrap all env-based overrides in a config_env() != :test guard so tests can run against the live host without port collision. 40 tests, 0 failures. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
18 lines
520 B
Elixir
18 lines
520 B
Elixir
import Config
|
|
|
|
# Skip env-based overrides in test mode so that test.exs values (port: 0,
|
|
# telepathy: disabled) are not stomped by shell env vars from the live service.
|
|
if config_env() != :test do
|
|
if port = System.get_env("SYMBIONT_PORT") do
|
|
config :symbiont, port: String.to_integer(port)
|
|
end
|
|
|
|
if data_dir = System.get_env("SYMBIONT_DATA_DIR") do
|
|
config :symbiont, data_dir: data_dir
|
|
end
|
|
|
|
if System.get_env("TELEPATHY_ENABLED") == "false" do
|
|
config :symbiont, :telepathy, enabled: false
|
|
end
|
|
end
|