Merge lp:~jonas-drange/ubuntu-push/disable-logger-test-on-gccgo into lp:ubuntu-push

Proposed by Jonas G. Drange
Status: Merged
Approved by: Ken VanDine
Approved revision: 165
Merged at revision: 166
Proposed branch: lp:~jonas-drange/ubuntu-push/disable-logger-test-on-gccgo
Merge into: lp:ubuntu-push
Diff against target: 49 lines (+23/-2)
1 file modified
logger/logger_test.go (+23/-2)
To merge this branch: bzr merge lp:~jonas-drange/ubuntu-push/disable-logger-test-on-gccgo
Reviewer Review Type Date Requested Status
Ken VanDine Approve
system-apps-ci-bot continuous-integration Needs Fixing
Review via email: mp+300307@code.launchpad.net

Commit message

disable logger tests that expect log.Lshortfile on ppc/arm 64

Description of the change

Seems gccgo produces the wrong output for log.lshortfile. Since this issue [1] is wontfix and we're asked to upgrade, let's skip the test if it produces this erroneous (?) output.

Regexp test case:
https://play.golang.org/p/C3tgD9hI9I

[1] https://github.com/golang/go/issues/16406

To post a comment you must log in.
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
165. By Jonas G. Drange

be less greedy

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'logger/logger_test.go'
2--- logger/logger_test.go 2015-02-06 13:55:33 +0000
3+++ logger/logger_test.go 2016-07-18 11:12:34 +0000
4@@ -21,6 +21,7 @@
5 "fmt"
6 "log"
7 "os"
8+ "regexp"
9 "runtime"
10 "testing"
11
12@@ -138,7 +139,18 @@
13 logger := NewSimpleLoggerFromMinimalLogger(baselog, "error")
14 baselog.Output(1, "foobar")
15 logger.Output(1, "foobaz")
16- c.Check(buf.String(), Matches, "logger_test.go:[0-9]+: foobar\nlogger_test.go:[0-9]+: foobaz\n")
17+
18+
19+ out := buf.String()
20+
21+ /* Workaround for https://github.com/golang/go/issues/16406 which is
22+ wontfix with a comment about a need to upgrade. */
23+ re := regexp.MustCompile(".*linux64\\.S.*|.*sysv\\.S.*")
24+ if re.MatchString(out) {
25+ c.Skip("log.Lshortfile failed to provide the expected output")
26+ }
27+
28+ c.Check(out, Matches, "logger_test.go:[0-9]+: foobar\nlogger_test.go:[0-9]+: foobaz\n")
29 }
30
31 type testLogLevelConfig struct {
32@@ -168,7 +180,16 @@
33 buf := &bytes.Buffer{}
34 logger := NewSimpleLogger(buf, "debug")
35 logger.Output(1, "foobaz")
36- c.Check(buf.String(), Matches, ".* .* logger_test.go:[0-9]+: foobaz\n")
37+
38+ out := buf.String()
39+
40+ /* Workaround for https://github.com/golang/go/issues/16406 which is
41+ wontfix with a comment about a need to upgrade. */
42+ re := regexp.MustCompile(".*linux64\\.S.*|.*sysv\\.S.*")
43+ if re.MatchString(out) {
44+ c.Skip("log.Lshortfile failed to provide the expected output")
45+ }
46+ c.Check(out, Matches, ".* .* logger_test.go:[0-9]+: foobaz\n")
47
48 buf.Reset()
49 logger = NewSimpleLogger(buf, "error")

Subscribers

People subscribed via source and target branches