Skip to content

Commit

Permalink
ci: add clearer status in summary
Browse files Browse the repository at this point in the history
Signed-off-by: Loic Devulder <ldevulder@suse.com>
  • Loading branch information
ldevulder committed Sep 2, 2024
1 parent 3dc8301 commit cf51ae2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
14 changes: 13 additions & 1 deletion .github/actions/logs-and-summary/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ inputs:
snap_type:
default: "btrfs"
type: string
steps_status:
# NOTE: 'steps_status' var cannot be configured with a default value!
type: string
test_type:
default: "Unknown"
type: string
Expand Down Expand Up @@ -118,6 +121,15 @@ runs:
# Define some variable(s)
${{ inputs.sequential == true }} && BOOTSTRAP_METHOD="Sequential" || BOOTSTRAP_METHOD="Parallel"
# Define test status
if ${{ contains(inputs.steps_status, 'cancelled') }}; then
TEST_STATUS="CANCELLED"
elif ${{ contains(inputs.steps_status, 'failure') }}; then
TEST_STATUS="FAILED"
else
TEST_STATUS="OK"
fi
# Get nodes configuration (use the first one, they are all identical)
NODE=$(sudo virsh list --name | head -1)
if [[ -n "${NODE}" ]]; then
Expand All @@ -127,7 +139,7 @@ runs:
fi
# Add summary: General informations
echo "## General informations" >> ${GITHUB_STEP_SUMMARY}
echo "## General informations - TEST ${TEST_STATUS}" >> ${GITHUB_STEP_SUMMARY}
echo "Bootstrap method: ${BOOTSTRAP_METHOD}" >> ${GITHUB_STEP_SUMMARY}
if ${{ inputs.test_type == 'cli' }}; then
echo "Number of nodes in the cluster: ${{ inputs.node_number }}" >> ${GITHUB_STEP_SUMMARY}
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/master_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,3 @@ jobs:
- name: Delete Qase Run if job has been cancelled
if: ${{ contains(needs.e2e.outputs.steps_status, 'cancelled') }}
run: cd tests && make delete-qase-run

# Just to signify that something has been cancelled and it's not useful to check the test
declare-cancelled:
needs: e2e
if: ${{ always() && contains(needs.e2e.outputs.steps_status, 'cancelled') }}
runs-on: ubuntu-latest
steps:
- name: Specify in summary if something has been cancelled
run: echo "# TEST CANCELLED!" >> ${GITHUB_STEP_SUMMARY}
2 changes: 1 addition & 1 deletion .github/workflows/sub_airgap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ on:

# Job outputs to export for caller workflow
outputs:
step_status:
steps_status:
description: Status of the executed test jobs
value: ${{ jobs.airgap.outputs.steps_status }}

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sub_cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ jobs:
rancher_version: ${{ inputs.rancher_version }}
sequential: ${{ inputs.sequential }}
snap_type: ${{ inputs.snap_type }}
steps_status: ${{ join(steps.*.conclusion, ' ') }}
test_type: ${{ inputs.test_type }}
upgrade_image: ${{ inputs.upgrade_image }}
upgrade_os_channel: ${{ inputs.upgrade_os_channel }}

0 comments on commit cf51ae2

Please sign in to comment.