-
Notifications
You must be signed in to change notification settings - Fork 27
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
test: Add error check during cleanup #256
Conversation
tests/e2e/kepler_test.go
Outdated
@@ -88,7 +93,8 @@ func TestNodeSelector(t *testing.T) { | |||
err = f.AddResourceLabels("node", node, labels) | |||
assert.NoError(t, err, "could not label node") | |||
t.Cleanup(func() { |
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.
@vprashar2929 thanks for the patch. Since you are at it, could you also please move t.Cleanup
to f.AddResourceLabels
itself. There are other functions in the framework that automatically cleans up after itself so that the caller need not worry about cleaning up.
fd1faf6
to
041b4ea
Compare
tests/e2e/kepler_test.go
Outdated
t.Cleanup(func() { | ||
// remove taint | ||
f.TaintNode(node, fmt.Sprintf("%s-", e2eTestTaint.Key)) | ||
err := f.TaintNode(node, fmt.Sprintf("%s-", e2eTestTaint.Key)) | ||
assert.NoError(t, err, "could not remove taint from node") | ||
}) |
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 a lot for the fix above.. can we do the same here 🙏 ?
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.
@vprashar2929 may be in a followup PR?
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.
Completely forgot this😅 I will fix this as well in the PR
tests/e2e/kepler_test.go
Outdated
t.Cleanup(func() { | ||
// remove taint | ||
f.TaintNode(node, fmt.Sprintf("%s-", e2eTestTaint.Key)) | ||
err := f.TaintNode(node, fmt.Sprintf("%s-", e2eTestTaint.Key)) | ||
assert.NoError(t, err, "could not remove taint from node") | ||
}) |
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.
@vprashar2929 may be in a followup PR?
Signed-off-by: Vibhu Prashar <[email protected]>
041b4ea
to
4d07048
Compare
This PR adds the check for any error in the case when cleanup happens.