canonical / testflinger

https://testflinger.readthedocs.io/en/latest/
GNU General Public License v3.0
12 stars 20 forks source link

[CERTTF-414] Generalise how the exit status of the `submit` action is determined #363

Closed boukeas closed 1 month ago

boukeas commented 2 months ago

Description

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.

Resolved issues

Resolves CERTTF-414.

Tests

The updated version of the submit action from this branch has been tested with three workflows: