All tests passed, but the bamboo assembly failed with the statement "No unsuccessful tests were found, a possible compilation error occurred."

I have to run some jbehave (automated) tests in bamboo. After running the tests, I will create junit compatible jml files so that bamboo can understand the same thing. All jbehave tests run as part of the script, because I need to run jbehave tests on a separate display screen (remember that these are automatic browser checks). An example script is as follows.

Example:

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

I have another junit parser task that points to the generated junit-compatible xml files. So, as soon as the bamboo assembly starts, and even if all the tests pass, I get a red line with the message "There are no unsuccessful tests, there was a possible compilation error."

Can anyone help me in this regard.

+6
source share
3 answers

Your build script may produce successful test reports, but one (or both) of your tasks does not work. This means that the crash probably occurs after the completion of your tests. Check your build logs for errors. You can also try logging into your Bamboo server (as a bamboo user) and running the commands manually.

I saw this message in the past when our test task crashed halfway through a test run, resulting in one incorrect report that Bamboo ignored and many successful reports.

* Check the build log to make sure your tests are actually running. If mvn clean does not clean up the test report directory, Bamboo can simply analyze obsolete test reports.


EDIT: (in response to the Kishore links)

It seems your task to kill Xvfb is what causes build failures.

 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 a nonzero value if it cannot match the expression for any processes.

+14
source

My solution was to execute 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 the PHP code sniffer returns exit status 1 when only 1 encoding violation (warning / error) is detected, due to which the build fails.

+4
source

Turns out this is a simple fix.

The general behavior of bamboo is to scan the entire log and view error codes (1). For this particular configuration, I had 6 scripts, of which one of them was supposed to kill xvfb (frame buffer). For some reason, the server cannot kill xvfb, and this task returns a failure code. Because of this, despite the fact that all the tests passed, the bamboo received one of these error codes from previous tasks, and the assembly was unsuccessful.

The current fix is ​​to remove the task that kills xvfb and the build has turned green! \ O /.

+2
source

Source: https://habr.com/ru/post/920671/


All Articles