mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-23 20:28:27 +00:00
test: added tests for the PVC analyzer (#1000)
This commit introduces comprehensive tests for the `PersistentVolumeClaim` analyzer defined in the `pkg/analyzer` package. Adding these tests increases the code coverage of the `pvc.go` file to >95%. I also made minor modifications to the ReplicaSet test to ensure all expectations were met. Partially addresses: https://github.com/k8sgpt-ai/k8sgpt/issues/889 Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
This commit is contained in:
@@ -142,10 +142,10 @@ func TestReplicaSetAnalyzer(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
for i, result := range results {
|
||||
require.Equal(t, expectations[i].name, result.Name)
|
||||
for j, failure := range result.Error {
|
||||
require.Equal(t, expectations[i].failuresText[j], failure.Text)
|
||||
for i, expectation := range expectations {
|
||||
require.Equal(t, expectation.name, results[i].Name)
|
||||
for j, failure := range results[i].Error {
|
||||
require.Equal(t, expectation.failuresText[j], failure.Text)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user