Skip to content

Commit

Permalink
Added realtime metrics for fake-container4
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhunge committed Apr 11, 2023
1 parent 5168bef commit 174afc3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/metrics/real_time_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,22 @@ func TestFilterOutContainerNotInPod(t *testing.T) {
UsageCoreNanoSeconds: 9876543210,
},
},
{
Name: fake_container4,
CPU: cpuStats{
UsageCoreNanoSeconds: 1237894560,
},
},
},
}

testDescription := "Successfully filters out containerStats for containers not in pod.spec.containers"
t.Run(testDescription, func(t *testing.T) {
filterOutContainerNotInPod(podStats, pod)
assert.EqualValues(t, len(podStats.Containers), 2)
assert.EqualValues(t, len(podStats.Containers), 3)
assert.EqualValues(t, podStats.Containers[0].Name, fake_container1)
assert.EqualValues(t, podStats.Containers[1].Name, fake_container2)
assert.EqualValues(t, podStats.Containers[2].Name, fake_container4)
})

}

0 comments on commit 174afc3

Please sign in to comment.