Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executing utplsql cli from Azure results in exit code 1 #188

Closed
TobiasDo1 opened this issue Nov 11, 2020 · 5 comments
Closed

Executing utplsql cli from Azure results in exit code 1 #188

TobiasDo1 opened this issue Nov 11, 2020 · 5 comments

Comments

@TobiasDo1
Copy link

Is there any way to figure out, why this run failed?

image

It is being executed on Azure server via pipeline.

The command is:
utplsql run <connection_detials> --tags=portal -d=true -f=ut_tfs_junit_reporter -o=ut_tests.xml -f=ut_coverage_cobertura_reporter -o=x_cobertura.xml

Observations I made:

  • Running the same locally on server does not raise any error, while the Azure Pipelines Agent does use the same account I tested it with locally. So should behave identically.
  • If I change tags to some other value (with other packages inlcuded), it does work.
  • 'Portal' tag does include 118 packages.
  • parameter -d is already being set to true

How to get more debug info? Any help is appreciated.

@pesse
Copy link
Member

pesse commented Nov 11, 2020

I have an idea that your Azure pipeline will fail if you have failing tests. By default, cli will exit with code 1 in that case.
You can change that behavior by adding -fcode=0 so it will only exit with 1 if a real error (of the client software itself) occurs.

If that's not the problem, the following things would be interesting:

The content of ut_tests.xml and x_covertura.xml.
Also, please try to run the following command:

utplsql run <connection_detials> --tags=portal -d -f=ut_documentation_reporter -f=ut_tfs_junit_reporter -o=ut_tests.xml -f=ut_coverage_cobertura_reporter -o=x_cobertura.xml -fcode=2

The additional documentation-reporter will output to screen so we can see what's happening.
The -fcode will set failure code to 2 if it's due to failed tests, so we can distinguish.

@jgebal
Copy link
Member

jgebal commented Nov 11, 2020

@TobiasDo1
It looks like the tests completed but some tests are failng.

What we tend to do in our own utPLSQL self-testing on Travis is run utplsql-cli with several reporters and output the ut_documentation_reporter to the screen.
https://travis-ci.org/github/utPLSQL/utPLSQL/jobs/716290552#L5814-L5825
image

In our case, we do fail the build if any f the tests fail, but at least we see the failing tests in the output.

If you prefer to use Azure reporting on test results, change proposed by @pesse should do the trick.

@TobiasDo1
Copy link
Author

Thanks @pesse and @jgebal for your suggestions.

If I run
utplsql run <connection_detials> --tags=portal -d -f=ut_documentation_reporter -f=ut_tfs_junit_reporter -o=ut_tests.xml -f=ut_coverage_cobertura_reporter -o=x_cobertura.xml -fcode=2
it ends up in some ORA exception. Not sure, if I am missing anything from my end.

image

image

@TobiasDo1
Copy link
Author

TobiasDo1 commented Nov 12, 2020

I have replaced -fcode=2 parameter with --failure-exit-code=2 and this works.

@pesse, you were rigth with your idea that azure task breaks because of failed unit test.

Thanks @pesse and @jgebal so much for your support.

@pesse
Copy link
Member

pesse commented Nov 12, 2020

Thanks for the catch - seems we have a regression here and I should change -fcode to -E for example (new command-line library only allows a single letter after a single - - double-dash notation works, though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants