constellation/.github/actions/e2e_sonobuoy/action.yml

71 lines
2.3 KiB
YAML
Raw Normal View History

name: sonobuoy
description: "Execute the e2e test framework sonobuoy."
inputs:
artifactNameSuffix:
description: "Suffix for artifact naming."
required: true
sonobuoyTestSuiteCmd:
description: "Which tests should be run?"
required: true
kubeconfig:
description: "The kubeconfig of the cluster to test."
required: true
encryptionSecret:
2023-12-20 09:17:49 -05:00
description: 'The secret to use for encrypting the artifact.'
required: true
runs:
using: "composite"
steps:
- name: Install sonobuoy
shell: bash
env:
2024-01-16 07:19:46 -05:00
SONOBUOY_VER: "0.57.1"
run: |
HOSTOS="$(go env GOOS)"
HOSTARCH="$(go env GOARCH)"
curl -fsSLO https://github.com/vmware-tanzu/sonobuoy/releases/download/v${SONOBUOY_VER}/sonobuoy_${SONOBUOY_VER}_${HOSTOS}_${HOSTARCH}.tar.gz
tar -xzf sonobuoy_${SONOBUOY_VER}_${HOSTOS}_${HOSTARCH}.tar.gz
install sonobuoy /usr/local/bin
- name: Sonobuoy version
shell: bash
run: sonobuoy version
- name: Run e2e test
shell: bash
env:
KUBECONFIG: ${{ inputs.kubeconfig }}
run: sonobuoy run --wait=300 ${{ inputs.sonobuoyTestSuiteCmd }} --kubeconfig constellation-admin.conf
- name: Download results
shell: bash
env:
KUBECONFIG: ${{ inputs.kubeconfig }}
2024-01-16 07:19:46 -05:00
run: |
sonobuoy retrieve --kubeconfig constellation-admin.conf
sonobuoy results *_sonobuoy_*.tar.gz
sonobuoy results *_sonobuoy_*.tar.gz --mode detailed | jq 'select(.status!="passed")' | jq 'select(.status!="skipped")' || true
- name: Upload test results
if: always() && !env.ACT
2023-12-20 09:17:49 -05:00
uses: ./.github/actions/artifact_upload
with:
name: "sonobuoy-logs-${{ inputs.artifactNameSuffix }}.tar.gz"
path: "*_sonobuoy_*.tar.gz"
encryptionSecret: ${{ inputs.encryptionSecret }}
2023-03-17 11:28:11 -04:00
# Only works on "sonobuoy full" tests (e2e plugin)
- name: Extract test results
if: (!env.ACT) && contains(inputs.sonobuoyTestSuiteCmd, '--plugin e2e')
shell: bash
run: tar -xf *_sonobuoy_*.tar.gz
- name: Publish test results
2023-03-17 11:28:11 -04:00
if: (!env.ACT) && contains(inputs.sonobuoyTestSuiteCmd, '--plugin e2e')
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4.3.1
with:
report_paths: "**/junit_01.xml"
fail_on_failure: true