I've been assigned to get a Bamboo build plan running. Last time this ran successfully was back in 2018. Here in 2021, it is aborting with the following message.
build 06-Aug-2021 11:17:48 PHPUnit 4.8.36 by Sebastian Bergmann and contributors.
build 06-Aug-2021 11:17:48
build 06-Aug-2021 11:17:48 Runtime: PHP 7.4.21 with Xdebug 3.0.4
build 06-Aug-2021 11:17:48 Configuration: /home/cmbuild/bamboo-agent-home/xml-data/build-dir/DER-QDB-JOB1/xr/AutomatedTesting/xr/phpunit.xml
build 06-Aug-2021 11:17:48
build 06-Aug-2021 11:17:48 Code coverage needs to be enabled in php.ini by setting 'xdebug.mode' to 'coverage'
simple 06-Aug-2021 11:17:48 Failing task since return code of [/bin/sh /home/cmbuild/bamboo-agent-home/temp/DER-QDB-JOB1-232-ScriptBuildTask-727917307105596510.sh] was 2 while expected 0
simple 06-Aug-2021 11:17:48 Finished task 'Run PHP UnitTests' with result: Failed
I'm no wizard with Bamboo, and I know there's a lot to focus on with what I included above, but I want to focus on this statement:
simple 06-Aug-2021 11:17:48 Failing task since return code of [/bin/sh /home/cmbuild/bamboo-agent-home/temp/DER-QDB-JOB1-232-ScriptBuildTask-727917307105596510.sh] was 2 while expected 0
In addition to resolving the error, I'm learning. I'm investigating these error codes. So, I asked our Bamboo admins for assistance on these error codes, I received the following:
Failing task since return code of [/bin/sh /home/cmbuild/bamboo-agent-home/temp/DER-QDB-JOB1-232-ScriptBuildTask-727917307105596510.sh] was 2 while expected 0
If we split the URL
- /bin/sh
- is an executable the represents the system Shell (Bash)
- home/cmbuild/bamboo-agent-home/temp/DER-QDB-JOB1-232-ScriptBuildTask-727917307105596510.sh
- The above path represents the location where exactly your build is working in the Server/Agent i.e, your code is downloaded into this path and is getting build.
- Only admins have access to view.
- was 2 while expected 0
- 2, 0 are codes, there are referred to as Bamboo Exit codes. Bamboo publicly provides a list of exit codes to describe the error precisely in the form of codes.
- Please find the exit codes over the internet.
As suggested, I searched for these 'exit codes' and I cannot find them. I can find posts on how to call them, bypass them, change them, not a list of the codes and their descriptions. Perhaps I'm not understanding the admin's response, or using the correct search key words.
Bottom line, here's my question;
Is there a list of Bamboo exit codes? If so, where can I find them? Maybe, these exit codes are unique to the object or routine being executed, and not to Bamboo?
I apologize for the length of my question. I thought it helpful to provide as much context as possible.
Thanks in advance for help anyone can provide.
Here's my script from the Bamboo plan:
cd ${bamboo_build_working_directory}/xr/AutomatedTesting/xr/
../../vendor/bin/phpunit -c phpunit.xml --verbose --log-junit results/xr_results.xml --coverage-clover=results/xr_coverage.xml phpunit