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
code depending on "testing" package must be in _test.go files #268
Conversation
Hi, @gmarik I like the concept, but as you can tell https://travis-ci.org/hybridgroup/gobot/jobs/110869133 that are many tests that depend on the current setup. If you want to run all the tests on your machine, use the command Perhaps a Many tests would need to be rewritten from this change, however, sounds like that is the case no matter what, at this point. What do you think? |
@deadprogram yeah, i've noticed. Took me a bit to get tests failing. Hacked together a quick-fix, but if you think we should do it the right way with |
A separate test package would be so much nicer, if you please, and thank you! |
- this package is for testing purposes only
@deadprogram done! (unless test suite fails) Also please double check your latest merge is successfully fixed (as it introduced conflict on my side) |
Any ideas why Is this failing? (looks like
And this:
|
Not sure about the first fail, but the second is due to the mqtt package requires versions of Go >= 1.3, which is why 1.2 is in the Travis allows failure section: https://github.com/hybridgroup/gobot/blob/dev/.travis.yml#L13 |
@deadprogram please review! |
This looks like the right idea to me. Any feedback @trevrosen or @mattetti or anyone else? |
👍 Really happy to see some of this test stuff getting love. This will help me with some long-time goals that I'm woefully behind on. 😺 |
🔍 |
code depending on "testing" package must be in _test.go files
Thanks guys! |
Thanks to you, @gmarik |
Otherwise any code importing
gobot
package will havetesting flags as well:
Problem
Unexpected flags in my app:
Reproduction
Here's a minimum code to reproduce the problem:
Output
Fix
Extract test helpers to
gobot/gobottest
package.