Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Pipeline fails even if all tests pass

vtvz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 14, 2018

I have two equivalent bitbucket  configs. First:

- set +e
# skipped preparation code
- ./vendor/bin/codecept run unit,integration,functional --skip-group images --xml test-reports/report.xml

- CODE=$?
- echo $CODE
- set -e
- exit $CODE

 And second:

# skipped preparation code
- ./vendor/bin/codecept run unit,integration,functional --skip-group images --xml test-reports/report.xml

Looks similar, but in first case I have this output:

+ set +e

+ ./vendor/bin/codecept run unit,integration,functional --skip-group images --xml test-reports/report.xml
Codeception PHP Testing Framework v2.4.2
Powered by PHPUnit 7.1.5 by Sebastian Bergmann and contributors.

# skipped useless data

Time: 4.59 minutes, Memory: 70.00MB

OK (154 tests, 580 assertions)
- XML report generated in file:///opt/atlassian/pipelines/agent/build/tests/_output/test-reports/report.xml

+ CODE=$?

+ echo $CODE
0

+ set -e

+ exit $CODE

And Successful result:

Screenshot_522.png

And second case output:

+ ./vendor/bin/codecept run unit,integration,functional --skip-group images --xml test-reports/report.xml
Codeception PHP Testing Framework v2.4.2
Powered by PHPUnit 7.1.5 by Sebastian Bergmann and contributors.

# skipped useless data

Time: 4.03 minutes, Memory: 70.00MB

OK (154 tests, 580 assertions)
- XML report generated in file:///opt/atlassian/pipelines/agent/build/tests/_output/test-reports/report.xml[39

And for unexplained reasons it FAILS!

Screenshot_521.png

I don't understand what's going on and why this happens. Is someone can explain me what I do wrong, why pipeline fails even if status code is 0 and all tests pass and how can I fix it? I'll be very grateful for help..

1 answer

0 votes
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 23, 2018

I suspect the exit code inconsistency is going to be related to this issue: https://community.atlassian.com/t5/Bitbucket-questions/In-Bitbucket-Pipelines-why-doesn-t-get-the-expected-exit-code/qaq-p/612957?utm_source=atlcomm&utm_medium=email&utm_campaign=immediate_general_answer&utm_content=topic

See if that helps with the exit code issue, then you should be able to debug further. :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events