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
=== modified file 'logger/logger_test.go'
--- logger/logger_test.go 2015-02-06 13:55:33 +0000
+++ logger/logger_test.go 2016-07-18 11:12:34 +0000
@@ -21,6 +21,7 @@
21 "fmt"21 "fmt"
22 "log"22 "log"
23 "os"23 "os"
24 "regexp"
24 "runtime"25 "runtime"
25 "testing"26 "testing"
2627
@@ -138,7 +139,18 @@
138 logger := NewSimpleLoggerFromMinimalLogger(baselog, "error")139 logger := NewSimpleLoggerFromMinimalLogger(baselog, "error")
139 baselog.Output(1, "foobar")140 baselog.Output(1, "foobar")
140 logger.Output(1, "foobaz")141 logger.Output(1, "foobaz")
141 c.Check(buf.String(), Matches, "logger_test.go:[0-9]+: foobar\nlogger_test.go:[0-9]+: foobaz\n")142
143
144 out := buf.String()
145
146 /* Workaround for https://github.com/golang/go/issues/16406 which is
147 wontfix with a comment about a need to upgrade. */
148 re := regexp.MustCompile(".*linux64\\.S.*|.*sysv\\.S.*")
149 if re.MatchString(out) {
150 c.Skip("log.Lshortfile failed to provide the expected output")
151 }
152
153 c.Check(out, Matches, "logger_test.go:[0-9]+: foobar\nlogger_test.go:[0-9]+: foobaz\n")
142}154}
143155
144type testLogLevelConfig struct {156type testLogLevelConfig struct {
@@ -168,7 +180,16 @@
168 buf := &bytes.Buffer{}180 buf := &bytes.Buffer{}
169 logger := NewSimpleLogger(buf, "debug")181 logger := NewSimpleLogger(buf, "debug")
170 logger.Output(1, "foobaz")182 logger.Output(1, "foobaz")
171 c.Check(buf.String(), Matches, ".* .* logger_test.go:[0-9]+: foobaz\n")183
184 out := buf.String()
185
186 /* Workaround for https://github.com/golang/go/issues/16406 which is
187 wontfix with a comment about a need to upgrade. */
188 re := regexp.MustCompile(".*linux64\\.S.*|.*sysv\\.S.*")
189 if re.MatchString(out) {
190 c.Skip("log.Lshortfile failed to provide the expected output")
191 }
192 c.Check(out, Matches, ".* .* logger_test.go:[0-9]+: foobaz\n")
172193
173 buf.Reset()194 buf.Reset()
174 logger = NewSimpleLogger(buf, "error")195 logger = NewSimpleLogger(buf, "error")

Subscribers

People subscribed via source and target branches