Skip to content

Commit c407449

Browse files
committed
Refactor LogAndFormatError to LoggedErrorf
Signed-off-by: perdasilva <[email protected]>
1 parent e4bac31 commit c407449

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Diff for: test/e2e/util/e2e_catalog_helper.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ type CatalogSourceHelper struct {
1616
func (c *CatalogSourceHelper) EventuallyHasGrpcConnectionWithLastConnectionState(expectedState connectivity.State) {
1717
c.waitForCatalogToBeLike(func(catalogSource *v1alpha1.CatalogSource) error {
1818
if catalogSource.Status.GRPCConnectionState == nil {
19-
return LogAndFormatError("expected catalog source grpc connection state to be '%s' but there is no connection state", expectedState)
19+
return LoggedErrorf("expected catalog source grpc connection state to be '%s' but there is no connection state", expectedState)
2020
}
2121
if catalogSource.Status.GRPCConnectionState.LastObservedState != expectedState.String() {
22-
return LogAndFormatError("expected catalog source gprc connection state '%s' to be '%s'", catalogSource.Status.GRPCConnectionState.LastObservedState, expectedState)
22+
return LoggedErrorf("expected catalog source gprc connection state '%s' to be '%s'", catalogSource.Status.GRPCConnectionState.LastObservedState, expectedState)
2323
}
2424
return nil
2525
})

Diff for: test/e2e/util/e2e_subscription_helper.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type SubscriptionHelper struct {
1515
func (s *SubscriptionHelper) EventuallyHasState(expectedState v1alpha1.SubscriptionState) {
1616
s.waitForSubscriptionToBeLike(func(subscription *v1alpha1.Subscription) error {
1717
if subscription.Status.State != expectedState {
18-
return LogAndFormatError("expected subscription state '%s' to be '%s'", subscription.Status.State, expectedState)
18+
return LoggedErrorf("expected subscription state '%s' to be '%s'", subscription.Status.State, expectedState)
1919
}
2020
return nil
2121
})
@@ -28,7 +28,7 @@ func (s *SubscriptionHelper) EventuallyContainsCondition(expectedCondition v1alp
2828
return nil
2929
}
3030
}
31-
return LogAndFormatError("expected subscription condition %s to be in %s", expectedCondition, ObjectToJsonString(subscription.Status.Conditions))
31+
return LoggedErrorf("expected subscription condition %s to be in %s", expectedCondition, ObjectToJsonString(subscription.Status.Conditions))
3232
})
3333
}
3434

@@ -41,7 +41,7 @@ func (s *SubscriptionHelper) EventuallyContainsConditionWithConditionType(expect
4141
}
4242
foundConditionTypes = append(foundConditionTypes, condition.Type)
4343
}
44-
return LogAndFormatError("expected subscription condition type '%s' to be in %s", expectedConditionType, foundConditionTypes)
44+
return LoggedErrorf("expected subscription condition type '%s' to be in %s", expectedConditionType, foundConditionTypes)
4545
})
4646
}
4747

Diff for: test/e2e/util/test_logging.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func Logf(f string, v ...interface{}) {
1515
_, _ = fmt.Fprintf(g.GinkgoWriter, f, v...)
1616
}
1717

18-
func LogAndFormatError(format string, args ...interface{}) error {
18+
func LoggedErrorf(format string, args ...interface{}) error {
1919
Logf(format, args...)
2020
return fmt.Errorf(format, args...)
2121
}

0 commit comments

Comments
 (0)