-
Notifications
You must be signed in to change notification settings - Fork 145
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
WIP: testify version of fluent_conf_test.go for review #355
WIP: testify version of fluent_conf_test.go for review #355
Conversation
For comparison with Ginkgo tests, review & discussion only. Do not commit. Signed-off-by: Alan Conway <aconway@redhat.com>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alanconway 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 |
I realize this is possible given what you expressed in the email thread but I would propose you have reverted the all the advantages of what I see to Ginko: intent and expressiveness. This version of the test requires a developer to mentally understand the test from top to bottom and interpret the intent of the test from the terse name. 👎 |
This version follows the original more closely: sub-tests in a single test function, same scope for common setup and variables, same (almost) test names. t.Run() prints "TestXXX/does whatever" vs. Ginkgo's "XXX it does whatever"" When you have the same test run on multiple inputs it's common to write a "table driven test" where you write the logic once and have a list of input and expected output for each case - it's more concise when you have a lot of cases. See https://dave.cheney.net/2019/05/07/prefer-table-driven-tests - skip to the last example as he builds it up from more basic Go features before he finally shows using testing.T.Run(). Signed-off-by: Alan Conway <aconway@redhat.com>
Pushed an update that has the same detailed test names and variable/function scopes as your example. |
@alanconway: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
Closing as I expect this is simply to prove out alternate test options |
For comparison with Ginkgo tests, review & discussion only. Do not commit.
Signed-off-by: Alan Conway aconway@redhat.com