config: guard runtime env overrides from clobbering test config
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>
This commit is contained in:
parent
e3c445bbeb
commit
cd3a136bee
@ -1,5 +1,8 @@
|
|||||||
import Config
|
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
|
if port = System.get_env("SYMBIONT_PORT") do
|
||||||
config :symbiont, port: String.to_integer(port)
|
config :symbiont, port: String.to_integer(port)
|
||||||
end
|
end
|
||||||
@ -11,3 +14,4 @@ end
|
|||||||
if System.get_env("TELEPATHY_ENABLED") == "false" do
|
if System.get_env("TELEPATHY_ENABLED") == "false" do
|
||||||
config :symbiont, :telepathy, enabled: false
|
config :symbiont, :telepathy, enabled: false
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user