Skip to content

Commit 2f4ac30

Browse files
committed
Add test for wrong-env breakage
1 parent 69326d1 commit 2f4ac30

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cli/deployment/config_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,16 @@ func TestConfig(t *testing.T) {
199199
Regex: "gitlab.com",
200200
}}, config.GitAuth.Value)
201201
},
202+
}, {
203+
Name: "Wrong env must not break default values",
204+
Env: map[string]string{
205+
"CODER_PROMETHEUS_ENABLE": "true",
206+
"CODER_PROMETHEUS": "true", // Wrong env name, must not break prom addr.
207+
},
208+
Valid: func(config *codersdk.DeploymentConfig) {
209+
require.Equal(t, config.Prometheus.Enable.Value, true)
210+
require.Equal(t, config.Prometheus.Address.Value, config.Prometheus.Address.Default)
211+
},
202212
}} {
203213
tc := tc
204214
t.Run(tc.Name, func(t *testing.T) {

0 commit comments

Comments
 (0)