Use Fatalf for non-recoverable errors in test

This commit is contained in:
Joe Betz 2024-08-19 11:18:04 -04:00
parent 5f1c7ae634
commit 5784e58446

View File

@ -294,7 +294,7 @@ func TestApplyCreate(t *testing.T) {
handled, configMap, err := reaction(action)
assert.True(t, handled)
if err != nil {
t.Errorf("Failed to create a resource with apply: %v", err)
t.Fatalf("Failed to create a resource with apply: %v", err)
}
cm := configMap.(*v1.ConfigMap)
assert.Equal(t, cm.Data, map[string]string{"k": "v"})
@ -314,7 +314,7 @@ func TestApplyNoMeta(t *testing.T) {
handled, configMap, err := reaction(action)
assert.True(t, handled)
if err != nil {
t.Errorf("Failed to create a resource with apply: %v", err)
t.Fatalf("Failed to create a resource with apply: %v", err)
}
cm := configMap.(*v1.ConfigMap)
assert.Equal(t, "cm-1", cm.Name)