-
Notifications
You must be signed in to change notification settings - Fork 261
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
Clean up e2e test assertion #264
Conversation
Heavily rely on assert package as well as unit tests
Hi @toVersus. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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 ! Looks good with one comment below.
The other thing which might be super useful is (now that you removed many error messages when an error is returned, which makes the code easier to read):
In the single main test method, can we wrap the calls to the subtests into t.Run("description of subtest", func(t *testing.T) { .... })
kind of subtest calls. This would make it much easier to spot the error location in case of an error.
Check e.g. client_test.go for how such subtest can be structured.
/okt-to-test |
@rhuss Can I make sure your intention here? Just wrap the subtests in the single main test method (e.g. func TestBasicWorkflow(t *testing.T) {
teardown := Setup(t)
defer teardown(t)
t.Run("returns no service before running tests", func(t *testing.T) {
testServiceListEmpty(t, k)
})
t.Run("create hello service and returns no error", func(t *testing.T) {
testServiceCreate(t, k, "hello")
}
t.Run("returns rough and detailed information about hello service")
testServiceList(t, k, "hello")
testServiceDescribe(t, k, "hello")
})
...
} |
@rhuss Thanks for reviewing! I tried to add subtests in main test methods. Let me know if you have any opinions about the level of granularity. BTW, Prow doesn't trigger the test due to a typo 😼 |
/ok-to-test |
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 !
/lgtm
/test pull-knative-client-integration-tests |
/test pull-knative-client-integration-tests-latest-release |
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!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: navidshaikh, rhuss, toVersus 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 |
This is a follow-up PR of #256 . We should use assert package (and utils) for testing the output string to keep consistency between unit and e2e tests.