TestProject Forum

How To Fail Docker Agent When Test Fails [SOLVED]

Currently I have set up a docker agent to run in my CI/CD pipeline. It runs great and pushes the test results back up to TestProject. The issue I’m running into is that even when the UI tests fail (and I view the report at TestProject), the error code returned by the agent is 0 (success). Is there a way to force the container to return a failing error code when the UI testing fails?

Hi @g.arch

Looks like you are using the ephemeral docker instance with a predefined JOB_ID for execution that executes the Job and then exits.

Currently, the exit code indicates a successful process start and operation of the Agent and not the status of the Job that it executed. So at this point, the exit code can not be changed.

What you can do in your CI using our API (TestProject API v2) to query for the Job results and infer the result from the Job execution report.

Thanks! Yes, that was going to be my fallback if the exit code couldn’t be changed, just was hoping for less effort on my side :slight_smile: