|
Péter Szilágyi |
at Feb 11, 2014 at 6:10 pm
|
⇧ |
| |
Hello,
How about introducing a command line flag which would define whether to
run only small tests or the full suite requiring authentication (actually
you could even do it without the flag by auto detecting the environment)?
Travis would run only the local tests, and you could manually run the live
tests whenever you feel like so (or if in the appropriate environment).
You could mock out most of the remote API and simulate it, being able to
test almost everything. For live authenticated tests however, imho the only
solution is a local run, if you want to keep your tokens safe :P
Cheers,
Peter
On Tue, Feb 11, 2014 at 7:48 PM, Michael Banzon wrote:Hi,
I am writing a few API implementations in Go that target various web
services. Most of these require some sort of API key or username + password
authentication.
Is there any easy/preferred way to write tests for these implementations
in Go?
I would like to provide tests that makes the packages testable when proper
authentication is supplied but so far I seem to be stuck at either
hard-coding credentials in the test or prompting for credentials when the
test is run. Hard-coding prevents me from distributing the tests and
prompting ruins the automated (Travis) "push, compile, test"-cycle.
--
Michael Banzon
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit
https://groups.google.com/groups/opt_out. --
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit
https://groups.google.com/groups/opt_out.