-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
contribution guide: Add guidelines for testing #1696
contribution guide: Add guidelines for testing #1696
Conversation
* types: Switch table driven test error messages to new format Make table driven tests in /types follow the format described in #1664 * typos / lower case errors * lower case, not sentences * lower case, not sentences
Codecov Report
@@ Coverage Diff @@
## develop #1696 +/- ##
===========================================
+ Coverage 62.35% 62.37% +0.01%
===========================================
Files 120 120
Lines 7119 7117 -2
===========================================
Hits 4439 4439
+ Misses 2429 2427 -2
Partials 251 251 |
Retargeted to |
This should still be pointed at master I think. (Since we need the update on github default branch) |
CONTRIBUTING.md
Outdated
We expect tests to use `require` or `assert` rather than `t.Skip` or `t.Fail`, | ||
unless there is a reason to do otherwise. | ||
We prefer to use [table driven tests](https://github.com/golang/go/wiki/TableDrivenTests) | ||
where applicable. |
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.
I'd specify where this is applicable.. I'd hate for somebody to take some nice simple non-table driven tests and attempt to fit them into a table because of this comment. Maybe something along the lines of:
If a test describes a reasonably complex situation it should be isolated in it's own test function (aka.
TestXxx. Where testing is fairly simple we prefer the tests to grouped through the use of [table driven tests](https://github.com/golang/go/wiki/TableDrivenTests)
+where applicable
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.
I'm not sure thats the right boundary for table driven / not table driven. I think the better boundary is whether you're testing a function under multiple scenarios or just a single scenario.
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.
makes sense
Default branch is back to develop now. Will avoid squashing commits. |
ugh- yeah I guess we shouldn't of merged to master in #1691 - let's just merge this to develop as per the old ways |
merged without squash |
Indicates to use require's and asserts, and to use table driven
tests, with error messages as described in #1664.
Closes #1664
I don't think any of the below are relevant.
docs/
)CHANGELOG.md
cmd/gaia
andexamples/
For Admin Use: