Преглед изворни кода

Adjust Pipeline Hibernation test to check for error instead of panic

Signed-off-by: Robert Lin <robertlin1@gmail.com>
Robert Lin пре 6 година
родитељ
комит
ce3c1ac239
1 измењених фајлова са 5 додато и 3 уклоњено
  1. 5 3
      internal/core/pipeline_test.go

+ 5 - 3
internal/core/pipeline_test.go

@@ -876,13 +876,15 @@ func TestPipelineRunHibernation(t *testing.T) {
 	}
 	pipeline.PrintActions = true
 	_, err := pipeline.Run(commits)
-	assert.Nil(t, err)
+	assert.NoError(t, err)
 	assert.True(t, item.Hibernated)
 	assert.True(t, item.Booted)
 	item.RaiseHibernateError = true
-	assert.Panics(t, func() { pipeline.Run(commits) })
+	_, err = pipeline.Run(commits)
+	assert.Error(t, err)
 	item.RaiseHibernateError = false
 	pipeline.Run(commits)
 	item.RaiseBootError = true
-	assert.Panics(t, func() { pipeline.Run(commits) })
+	_, err = pipeline.Run(commits)
+	assert.Error(t, err)
 }