go-bamboo-plugin icon indicating copy to clipboard operation
go-bamboo-plugin copied to clipboard

go test exits with non zero exit code, so test parser never runs when tests fail

Open jeks313 opened this issue 8 years ago • 6 comments

I must be missing something - the go test task exits with non-zero when a test fails, this means the next task which is meant to be the test parser never runs, which means my tests don't get parsed and shown in the interface.

Is this by design, or have I done something horribly wrong in my setup somewhere?

Failing test - skips to running post build steps ...

build 12-Oct-2016 14:29:34 FAIL build 12-Oct-2016 14:29:34 exit status 1 build 12-Oct-2016 14:29:34 FAIL bitbucket.org/fusemail/fm-utility-golang-trackerdb 0.007s simple 12-Oct-2016 14:29:34 Failing task since return code of [/usr/local/go/bin/go test -v .] was 1 while expected 0 simple 12-Oct-2016 14:29:34 Finished task 'Test' with result: Failed simple 12-Oct-2016 14:29:34 Running post build plugin 'NCover Results Collector'

Successful test - runs the test parser ...

build 12-Oct-2016 14:26:36 --- PASS: TestBase62 (0.00s) build 12-Oct-2016 14:26:36 PASS build 12-Oct-2016 14:26:36 ok bitbucket.org/fusemail/fm-utility-golang-trackerdb 0.004s simple 12-Oct-2016 14:26:36 Finished task 'Test' with result: Success simple 12-Oct-2016 14:26:36 Starting task 'Parse Tests' of type 'com.handcraftedbits.bamboo.plugin.go:task.go.test.parser' simple 12-Oct-2016 14:26:36 Parsing test results under /var/lib/bamboo/xml-data/build-dir/GO-TRAC-JOB1... simple 12-Oct-2016 14:26:36 Finished task 'Parse Tests' with result: Success

jeks313 avatar Oct 12 '16 22:10 jeks313

I am running into this as well. Any updates?

peternoyes avatar Mar 08 '17 21:03 peternoyes

Same here. Updates @handcraftedbits ?

ghost avatar Mar 30 '17 12:03 ghost

I was able to workaround this by having the test results parser be a "Final Task." This will cause the parser to run even if the tests fail. I think this is how it was designed to work.

peternoyes avatar Mar 30 '17 17:03 peternoyes

Thanks @peternoyes

ghost avatar Apr 25 '17 13:04 ghost

@peternoyes I did this but the test task still fails even if my tests pass.

ghost avatar Apr 27 '17 15:04 ghost

Happens to me as well, using Bamboo 6.3.0. My tests pass but go test returns a non zero code and the task fails because of that.

diegomarcov avatar Jan 25 '18 13:01 diegomarcov