Skip to content

Commit

Permalink
metric/test: re-remove errors from test after rebasing #148
Browse files Browse the repository at this point in the history
These errors are no longer returned and they were rebased-in by mistake.
  • Loading branch information
roobre committed Jul 20, 2021
1 parent decccb0 commit eedbdb6
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/metric/populate_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package metric

import (
"errors"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/newrelic/infra-integrations-sdk/data/event"
Expand Down Expand Up @@ -165,22 +164,6 @@ func TestPopulateK8s(t *testing.T) {
require.IsType(t, err, data.PopulateResult{})
assert.Empty(t, err.(data.PopulateResult).Errors)

// Expected errs (missing data)
// TODO not good to compare error strings...
expectedErrs := []error{
errors.New("error populating metric for entity ID kube-system_newrelic-infra-rz225: cannot fetch value for metric deploymentName, metric not found"),
errors.New("error populating metric for entity ID kube-system_newrelic-infra-rz225: cannot fetch value for metric reason, metric not found"),
errors.New("error populating metric for entity ID kube-system_newrelic-infra-rz225: cannot fetch value for metric message, metric not found"),
errors.New("error populating metric for entity ID kube-system_newrelic-infra-rz225_newrelic-infra: cannot fetch value for metric deploymentName, metric not found"),
errors.New("error populating metric for entity ID kube-system_newrelic-infra-rz225_newrelic-infra: cannot fetch value for metric cpuLimitCores, metric not found"),
errors.New("error populating metric for entity ID kube-system_newrelic-infra-rz225_newrelic-infra: cannot fetch value for metric reason, metric not found"),
errors.New("error populating metric for entity ID kube-system_newrelic-infra-rz225_newrelic-infra: cannot fetch value for metric cpuCoresUtilization, 'cpuUsedCores' is nil"),
errors.New("error populating metric for entity ID kube-system_newrelic-infra-rz225_newrelic-infra: cannot fetch value for metric requestedCpuCoresUtilization, 'cpuUsedCores' is nil"),
errors.New("error populating metric for entity ID kube-system_newrelic-infra-rz225_newrelic-infra: cannot fetch value for metric memoryUtilization, 'memoryUsedBytes' is nil"),
errors.New("error populating metric for entity ID kube-system_newrelic-infra-rz225_newrelic-infra: cannot fetch value for metric requestedMemoryUtilization, 'memoryUsedBytes' is nil"),
}

assert.ElementsMatch(t, expectedErrs, err.(data.PopulateResult).Errors)
expectedInventory := inventory.New()
if err := expectedInventory.SetItem("cluster", "name", expectedEntities[0].Metadata.Name); err != nil {
t.Fatal(err)
Expand Down

0 comments on commit eedbdb6

Please sign in to comment.