Skip to content

Commit

Permalink
adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbdias committed Sep 15, 2023
1 parent 1333e1b commit ba35d90
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/config/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ func TestServerConfig(t *testing.T) {
"--experimentalFeatures", "b",
"--internalTelemetry.enabled", "true",
"--internalTelemetry.otelCollectorEndpoint", "otel-collector.tracetest",
"--testPipelines.triggerExecute.enabled", "false",
"--testPipelines.traceFetch.enabled", "false",
}

cfg := configWithFlags(t, flags)
Expand All @@ -49,6 +51,9 @@ func TestServerConfig(t *testing.T) {

assert.Equal(t, true, cfg.InternalTelemetryEnabled())
assert.Equal(t, "otel-collector.tracetest", cfg.InternalTelemetryOtelCollectorAddress())

assert.Equal(t, false, cfg.TestPipelineTriggerExecutionEnabled())
assert.Equal(t, false, cfg.TestPipelineTraceFetchingEnabled())
})

t.Run("EnvVars", func(t *testing.T) {
Expand All @@ -64,6 +69,8 @@ func TestServerConfig(t *testing.T) {
"TRACETEST_EXPERIMENTALFEATURES": "a b",
"TRACETEST_INTERNALTELEMETRY_ENABLED": "true",
"TRACETEST_INTERNALTELEMETRY_OTELCOLLECTORENDPOINT": "otel-collector.tracetest",
"TRACETEST_TESTPIPELINES_TRIGGEREXECUTE_ENABLED": "false",
"TRACETEST_TESTPIPELINES_TRACEFETCH_ENABLED": "false",
}

cfg := configWithEnv(t, env)
Expand All @@ -77,5 +84,8 @@ func TestServerConfig(t *testing.T) {

assert.Equal(t, true, cfg.InternalTelemetryEnabled())
assert.Equal(t, "otel-collector.tracetest", cfg.InternalTelemetryOtelCollectorAddress())

assert.Equal(t, false, cfg.TestPipelineTriggerExecutionEnabled())
assert.Equal(t, false, cfg.TestPipelineTraceFetchingEnabled())
})
}

0 comments on commit ba35d90

Please sign in to comment.