A user of the Testflinger submit action reported that they ran a job that completed successfully, and yet the submit action failed. On examination, the user's workflow submitted a job that only had a provisioning phase, without a test phase. The submit action currently uses the result of the test phase as the exit status of the action, thus failing when there is no such phase.
This PR generalises the way that the exit status of the submit action is computed. In particular, instead of using only the result of the test phase (test_status) as previously, it takes the maximum of the results of all phases, excluding the setup and cleanup phases. Therefore, the action fails if any of these phases fail and succeeds if all phases are successful.
Description
A user of the Testflinger
submit
action reported that they ran a job that completed successfully, and yet thesubmit
action failed. On examination, the user's workflow submitted a job that only had a provisioning phase, without a test phase. Thesubmit
action currently uses the result of the test phase as the exit status of the action, thus failing when there is no such phase.This PR generalises the way that the exit status of the
submit
action is computed. In particular, instead of using only the result of the test phase (test_status
) as previously, it takes the maximum of the results of all phases, excluding the setup and cleanup phases. Therefore, the action fails if any of these phases fail and succeeds if all phases are successful.Resolved issues
Resolves CERTTF-414.
Tests
The updated version of the
submit
action from this branch has been tested with three workflows:provisioning_data
) [run]exit 1
in thetest_cmds
) [run]exit 0
in thetest_cmds
) [run]