zooba / vsts-python-tasks

Azure Pipelines tasks for Python
https://marketplace.visualstudio.com/items?itemName=stevedower.python
MIT License
8 stars 5 forks source link

Run Python Command - Exit codes #15

Open Burnsy2023 opened 5 years ago

Burnsy2023 commented 5 years ago

When I run a python script that fails with an exit code 1, it still returns an exit code 0 to Azure Devops and so doesn't fail the task.

For example: 2019-01-25T14:17:10.9672658Z Traceback (most recent call last): 2019-01-25T14:17:10.9673115Z File "C:\gsppgen1wg81\_work\r2\a\gaudiCI\Infrastructure\Scripts\python\SDEGenerator\sde_generator.py", line 14, in <module> 2019-01-25T14:17:10.9673405Z from arcpy import CreateDatabaseConnection_management, ExecuteError, RuntimeError 2019-01-25T14:17:10.9673615Z ImportError: cannot import name 'RuntimeError' 2019-01-25T14:17:11.9083386Z ##[debug]Exit code: 0

I have run test scripts that explicitly return just an exit code 1 and I still get Azure Devops thinking that it's code 0. The option to fail the step on a non-zero value is irrelevant due to this.

zooba commented 5 years ago

How are you running this script? Can you show me either the YAML or the configuration panel in the UI?