Skip to content

Commit

Permalink
Fix bug in error assertions in batch controller tests
Browse files Browse the repository at this point in the history
  • Loading branch information
deadlycoconuts committed Mar 12, 2024
1 parent 9a038ce commit b4edf58
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/batch/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func TestSubmit(t *testing.T) {
ctl, err := NewController(mockStorage, mockMlpAPIClient, mockSparkClient, mockKubeClient,
mockManifestManager,
clusterMetadata, batchJobTemplater)
assert.Error(t, err)
assert.NoError(t, err)

mockKubeClient.PrependReactor("get", "namespaces", func(action ktesting.Action) (handled bool, ret runtime.Object, err error) {
return true, nil, kerrors.NewNotFound(schema.GroupResource{}, action.(ktesting.GetAction).GetName())
Expand Down Expand Up @@ -400,7 +400,7 @@ func TestCleanupAfterSubmitFailed(t *testing.T) {
batchJobTemplater := NewBatchJobTemplater(defaultBatchConfig)
ctl, err := NewController(mockStorage, mockMlpAPIClient, mockSparkClient, mockKubeClient, mockManifestManager,
clusterMetadata, batchJobTemplater)
assert.Error(t, err)
assert.NoError(t, err)

mockManifestManager.On("DeleteSecret", context.Background(), jobName, defaultNamespace).Return(nil)
mockManifestManager.On("DeleteJobSpec", context.Background(), jobName, defaultNamespace).Return(nil)
Expand Down Expand Up @@ -428,7 +428,7 @@ func TestOnUpdate(t *testing.T) {
newController, err := NewController(mockStorage, mockMlpAPIClient, mockSparkClient, mockKubeClient,
mockManifestManager,
clusterMetadata, batchJobTemplater)
assert.Error(t, err)
assert.NoError(t, err)

ctl := newController.(*controller)
stopCh := make(chan struct{})
Expand Down Expand Up @@ -509,7 +509,7 @@ func TestUpdateStatus(t *testing.T) {
newController, err := NewController(mockStorage, mockMlpAPIClient, mockSparkClient, mockKubeClient,
mockManifestManager,
clusterMetadata, batchJobTemplater)
assert.Error(t, err)
assert.NoError(t, err)

ctl := newController.(*controller)
stopCh := make(chan struct{})
Expand Down Expand Up @@ -611,7 +611,7 @@ func TestStop(t *testing.T) {
newController, err := NewController(mockStorage, mockMlpAPIClient, mockSparkClient, mockKubeClient,
mockManifestManager,
clusterMetadata, batchJobTemplater)
assert.Error(t, err)
assert.NoError(t, err)

ctl := newController.(*controller)
mockKubeClient.PrependReactor("get", "namespaces", func(action ktesting.Action) (handled bool, ret runtime.Object, err error) {
Expand Down

0 comments on commit b4edf58

Please sign in to comment.