Skip to content

Commit

Permalink
fix: make some k8s tests pass (#10224)
Browse files Browse the repository at this point in the history
Co-authored-by: Bradley Laney <[email protected]>
  • Loading branch information
maxrussell and stoksc authored Nov 21, 2024
1 parent d644094 commit b66ea84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions master/internal/rm/kubernetesrm/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ func TestListPodsInAllNamespaces(t *testing.T) {
},
}

var expectedPods []k8sV1.Pod
copy(expectedPods, append(detPods, outsidePod))
//nolint:gocritic
expectedPods := append(detPods, outsidePod)
expectedPodList := k8sV1.PodList{Items: expectedPods}
emptyNS.On("List", mock.Anything, mock.Anything).Once().
Return(&k8sV1.PodList{Items: expectedPods}, nil)
Expand All @@ -133,7 +133,7 @@ func TestListPodsInAllNamespaces(t *testing.T) {
opts := metaV1.ListOptions{}
actualPodList, err := js.listPodsInAllNamespaces(ctx, opts)
require.NoError(t, err)
require.NotNil(t, actualPodList)
require.NotEmpty(t, actualPodList)
require.ElementsMatch(t, expectedPodList.Items, actualPodList)

forbiddenErr := k8error.NewForbidden(schema.GroupResource{}, "forbidden",
Expand Down Expand Up @@ -204,8 +204,8 @@ func TestHealthStatus(t *testing.T) {
},
}

var expectedPods []k8sV1.Pod
copy(expectedPods, append(detPods, outsidePod))
//nolint:gocritic
expectedPods := append(detPods, outsidePod)
emptyNS.On("List", mock.Anything, mock.Anything).Once().
Return(&k8sV1.PodList{Items: expectedPods}, nil)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ func TestHealthCheck(t *testing.T) {
jobsService: &jobsService{
podInterfaces: map[string]typedV1.PodInterface{
"namespace": mockPodInterface,
"": mockPodInterface,
},
syslog: logrus.WithField("namespace", "test"),
},
Expand Down

0 comments on commit b66ea84

Please sign in to comment.