"warning no tests to run"

roger peppe roger.peppe at canonical.com
Thu Aug 29 08:25:50 UTC 2013


Hmm, I'm not sure. It's perhaps ok in some circumstances to
have no tests defined in a package even if there are _test.go
files (if the tests are platform-dependent, for example, or there
are examples).

It seems to me that gwacl should have made sure (as usual)
that a test fails before making it pass.

There are other ways that tests might not be hooked in
(failing to call Suite for example), and changing go test
won't catch those, so I'm inclined to leave it alone.


On 29 August 2013 07:24, John Arbash Meinel <john at arbash-meinel.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I'm curious about the expected use of "go test".
>
> Specifically, I was setting up gwacl to run under go-bot, and I only
> happened to discover that one of their subdirectories isn't actually
> running any tests.
>
> They *have* a foo_test.go file, but they forgot to add the "func
> Test(...)" magic to connect gocheck into the testing framework.
>
> If you "cd subdir; go test" you do at least get a warning:
> testing: warning: no tests to run
> PASS
> ok      launchpad.net/gwacl/logging     0.011s
>
> However, if you run it using ./... you don't even see that:
>
> ?       launchpad.net/gwacl/fork/tls    [no test files]
> ok      launchpad.net/gwacl/logging     0.010s
>
> So it looks like it successfully ran all the tests in that
> subdirectory, and doesn't even warn you that there weren't any tests
> run (it only warns you when a directory doesn't have a test file).
>
> Is this something that should be fixed? (I would submit an issue, but
> the last one I submitted got 0 feedback after a few months now.)
>
> John
> =:->
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.13 (Cygwin)
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iEYEARECAAYFAlIe6QQACgkQJdeBCYSNAAPBKwCfTWLBSee+KpcllZ4vQWMzeGsC
> 7HgAn2To2YNK7YRVPD0QNs6sYiOxnSVY
> =MUFS
> -----END PGP SIGNATURE-----



More information about the Juju-dev mailing list