Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

All the tests passed, but bamboo build fails with a statement "No failed tests found, a possible compilation error occurred."

I'm supposed to run some jbehave(automated) tests in bamboo. Once the tests run I'll generate some junit compatible xml files so that bamboo could understand the same. All the jbehave tests are ran as part of a script, because I need to run the jbehave tests in a separate display screen(remember these are automated browser tests). Example script is as follows.

Ex:

export DISPLAY=:0 && xvfb-run --server-args="-screen 0, 1024x768x24" 
mvn clean integration-test -DskipTests -P integration-test -Dtest=*

I have one more junit parser task which points to the generated junit compatible xml files. So, once the bamboo build runs and even if all the tests pass, I get red build with the message "No failed tests found, a possible compilation error occurred."

Can somone please help me on this regard.

like image 378
Kishore Yekkanti Avatar asked Jul 17 '12 10:07

Kishore Yekkanti


3 Answers

Your build script might be producing successful test reports, but one (or both, possibly) of your tasks is failing. That means that the failure is probably* occurring after your tests complete. Check your build logs for errors. You might also try logging in to your Bamboo server (as the bamboo user) and running the commands by hand.

I've seen this message in the past when our test task was crashing halfway through the test run, resulting in one malformed report that Bamboo ignored and a bunch of successful reports.

*Check the build log to make sure that your tests are indeed running. If mvn clean doesn't clean out the test report directory, Bamboo might just be parsing stale test reports.


EDIT: (in response to Kishore's links)

It looks like your task to kill Xvfb is what is causing the build to fail.

18-Jul-2012 09:50:18    Starting task 'Kill Xvfb' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'

18-Jul-2012 09:50:18    
Beginning to execute external process for build 'Functional Tests - Application Release Test - Default Job'
 ... running command line: 
/bin/sh
  /tmp/FUNC-APPTEST-JOB1-91-ScriptBuildTask-4153769009554485085.sh
 ... in: /opt/bamboo-home/xml-data/build-dir/FUNC-APPTEST-JOB1
 ... using extra environment variables: 

<..snip (no meaningful output)..>

18-Jul-2012 09:50:18    Failing task since return code was 1 while expected 0

18-Jul-2012 09:50:18    Finished task 'Kill Xvfb'

What does your "Kill Xvfb" script do? Are you trying something like pkill -f "[x]vfb"? pkill -f silently returns non-zero if it can't match the expression to any processes.

like image 140
choover Avatar answered Nov 19 '22 13:11

choover


My solution was to make a 'script' task:

#!/bin/bash
/usr/local/bin/phpcs --report=checkstyle --report-file=build/logs/checkstyle.xml --standard=PSR2 ./lib | exit 0

Which always exits with status 0.

This is because PHP code sniffer return exit status 1 when only 1 coding violation (warning / error) is found which causes the built to fail.

like image 4
Kees Schepers Avatar answered Nov 19 '22 12:11

Kees Schepers


Turns out to be a simple fix.

General bamboo behavior is to scan the entire log and see for any failure codes(1). For this specific configuration i had some 6 scripts out of which one of them was to kill the xvfb(frame buffer). For some reason server is not able to kill xvfb and that task was returning a failure code. Because of this, though all the tests passed, bamboo got one of this error codes from previous tasks and build was failing.

Current fix is to remove the task which kills xvfb and the build went green! \o/.

like image 2
Kishore Yekkanti Avatar answered Nov 19 '22 12:11

Kishore Yekkanti