Skip to content

Commit

Permalink
Merge bf69a82 into backport/telemetry/host-stats/mistakenly-champion-…
Browse files Browse the repository at this point in the history
…piranha
  • Loading branch information
hc-github-team-consul-core authored May 31, 2023
2 parents 5385903 + bf69a82 commit 5f5ae46
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions agent/config/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type testCase struct {
desc string
args []string
setup func() // TODO: accept a testing.T instead of panic
cleanup func()
expected func(rt *RuntimeConfig)
expectedErr string
expectedWarnings []string
Expand Down Expand Up @@ -2305,9 +2306,9 @@ func TestLoad_IntegrationWithFlags(t *testing.T) {
},
setup: func() {
os.Setenv("HCP_RESOURCE_ID", "env-id")
t.Cleanup(func() {
os.Unsetenv("HCP_RESOURCE_ID")
})
},
cleanup: func() {
os.Unsetenv("HCP_RESOURCE_ID")
},
expected: func(rt *RuntimeConfig) {
rt.DataDir = dataDir
Expand All @@ -2318,6 +2319,7 @@ func TestLoad_IntegrationWithFlags(t *testing.T) {

// server things
rt.ServerMode = true
rt.Telemetry.EnableHostMetrics = true
rt.TLS.ServerMode = true
rt.LeaveOnTerm = false
rt.SkipLeaveOnInt = true
Expand All @@ -2334,9 +2336,9 @@ func TestLoad_IntegrationWithFlags(t *testing.T) {
},
setup: func() {
os.Setenv("HCP_RESOURCE_ID", "env-id")
t.Cleanup(func() {
os.Unsetenv("HCP_RESOURCE_ID")
})
},
cleanup: func() {
os.Unsetenv("HCP_RESOURCE_ID")
},
json: []string{`{
"cloud": {
Expand All @@ -2357,6 +2359,7 @@ func TestLoad_IntegrationWithFlags(t *testing.T) {

// server things
rt.ServerMode = true
rt.Telemetry.EnableHostMetrics = true
rt.TLS.ServerMode = true
rt.LeaveOnTerm = false
rt.SkipLeaveOnInt = true
Expand Down Expand Up @@ -6029,6 +6032,9 @@ func (tc testCase) run(format string, dataDir string) func(t *testing.T) {
expected.ACLResolverSettings.EnterpriseMeta = *structs.NodeEnterpriseMetaInPartition(expected.PartitionOrDefault())

prototest.AssertDeepEqual(t, expected, actual, cmpopts.EquateEmpty())
if tc.cleanup != nil {
tc.cleanup()
}
}
}

Expand Down

0 comments on commit 5f5ae46

Please sign in to comment.