Merge lp:~allenap/gwacl/tests-not-testing into lp:gwacl

Proposed by Gavin Panella on 2013-08-29
Status: Merged
Approved by: Gavin Panella on 2013-08-29
Approved revision: 223
Merged at revision: 222
Proposed branch: lp:~allenap/gwacl/tests-not-testing
Merge into: lp:gwacl
Diff against target: 34 lines (+9/-2)
2 files modified
Makefile (+3/-2)
logging/logging_test.go (+6/-0)
To merge this branch: bzr merge lp:~allenap/gwacl/tests-not-testing
Reviewer Review Type Date Requested Status
Jeroen T. Vermeulen (community) 2013-08-29 Approve on 2013-08-29
Review via email: mp+182865@code.launchpad.net

Commit message

Get all tests running.

The logging tests were not running, but there was no obvious
indication that there was a problem; the module was developed in the
top-level gwacl package, moved to a sub-package when it was complete,
but it was missing the hook function from testing into gocheck.

In any case, `make check` would not have run tests in any sub-package.
When -gocheck.v is passed into `go test` the package specification
appears to be ignored, and only tests in the current package are
exercised.

Description of the change

Get all tests running.

The logging tests were not running, but there was no obvious
indication that there was a problem; the module was developed in the
top-level gwacl package, moved to a sub-package when it was complete,
but it was missing the hook function from testing into gocheck.

In any case, `make check` would not have run tests in any sub-package.
When -gocheck.v is passed into `go test` the package specification
appears to be ignored, and only tests in the current package are
exercised.

To post a comment you must log in.
Gavin Panella (allenap) wrote :

Please take a look.

Jeroen T. Vermeulen (jtv) wrote :

Thanks for dealing with this. It sounds like a pretty nasty bug if a verbosity option suppresses tests...

review: Approve
John A Meinel (jameinel) wrote :

With the new bot you have to set the Commit Message before it will land the request. Was that not true with the bot that Julian was running? Do you know how he had it configured in that case?

Gavin Panella (allenap) wrote :

It was the same, and I am too: I keep forgetting :)

Gavin Panella (allenap) wrote :

Thanks for sorting it out John.

Julian Edwards (julian-edwards) wrote :

On Thursday 29 Aug 2013 11:03:37 Jeroen T. Vermeulen wrote:
> Review: Approve
>
> Thanks for dealing with this. It sounds like a pretty nasty bug if a
> verbosity option suppresses tests...

A bug should be filed on gocheck. It was probably not checking an error
return value or something.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2013-07-02 02:29:44 +0000
3+++ Makefile 2013-08-29 10:57:38 +0000
4@@ -1,6 +1,7 @@
5-# Build, and run tests.
6+# Build, and run tests. Do *not* pass -gocheck.v because it prevents
7+# tests in subdirectories from being run (a really _special_ bug).
8 check: examples
9- go test -gocheck.v=true ./...
10+ go test ./...
11
12 debug-test:
13 go test -c -gcflags "-N -l"
14
15=== modified file 'logging/logging_test.go'
16--- logging/logging_test.go 2013-04-22 16:17:23 +0000
17+++ logging/logging_test.go 2013-08-29 10:57:38 +0000
18@@ -5,6 +5,7 @@
19
20 import (
21 . "launchpad.net/gocheck"
22+ "testing"
23 )
24
25 var originalLevel = level
26@@ -37,3 +38,8 @@
27 setLevel("123")
28 c.Check(level, Equals, -1)
29 }
30+
31+// Master loader for all tests.
32+func Test(t *testing.T) {
33+ TestingT(t)
34+}

Subscribers

People subscribed via source and target branches

to all changes: