-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update unit tests to check error messages #107
Conversation
Signed-off-by: Stephanie <yangcao@redhat.com>
83c2938
to
5526b14
Compare
Signed-off-by: Stephanie <yangcao@redhat.com>
dbd098f
to
61b2b7f
Compare
Signed-off-by: Stephanie <yangcao@redhat.com>
671a20f
to
2542790
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, thats a lot of chore changes
@@ -47,6 +48,8 @@ func TestGetContainers(t *testing.T) { | |||
}, | |||
} | |||
|
|||
errMatches := "an expetced error" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo, update others too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
@@ -436,8 +446,8 @@ func TestGetVolumesAndVolumeMounts(t *testing.T) { | |||
} | |||
|
|||
pvcVols, err := GetVolumesAndVolumeMounts(devObj, volumeParams, common.DevfileOptions{}) | |||
if tt.wantErr == (err == nil) { | |||
t.Errorf("TestGetVolumesAndVolumeMounts() error = %v, wantErr %v", err, tt.wantErr) | |||
if (tt.wantErr == nil) != (err == nil) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we keep one or the other, in the above test it was
if (err != nil) != (tt.wantErr != nil)
. Otherwise I am always thrown back and have to recalc it in my head 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
Signed-off-by: Stephanie <yangcao@redhat.com>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maysunfaisal, yangcao77 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Stephanie yangcao@redhat.com
What does this PR do?
This PR updates unit tests to check if error message matches the expected regexp
What issues does this PR fix or reference?
Fixes devfile/api#523
Is your PR tested? Consider putting some instruction how to test your changes
Updated unit tests