Skip to content

Commit

Permalink
Adapt integration test to wrapped error message
Browse files Browse the repository at this point in the history
  • Loading branch information
thardeck committed Jul 4, 2024
1 parent 3d5c9c3 commit 085c186
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions integrationtests/git/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ func TestLatestCommit_NoAuth(t *testing.T) {
t.Run(name, func(t *testing.T) {
secretGetter := &secretGetterMock{err: kerrors.NewNotFound(schema.GroupResource{}, "notfound")}
latestCommit, err := git.LatestCommit(test.gitjob, secretGetter)
if err != test.expectedErr {
t.Errorf("expecter error is: %v, but got %v", test.expectedErr, err)
if test.expectedErr == nil {
require.NoError(t, err)
} else {
require.Contains(t, err.Error(), test.expectedErr.Error())
}
if latestCommit != test.expectedCommit {
t.Errorf("latestCommit doesn't match. got %s, expected %s", latestCommit, test.expectedCommit)
Expand Down

0 comments on commit 085c186

Please sign in to comment.