Skip to content

Commit

Permalink
chore: Collect JUnit reports as part of gingko executions (#1365)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-thaler authored Aug 22, 2024
1 parent 1ef70d2 commit d1f37ff
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .github/template/finalize-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@ inputs:
failure:
description: Are we in failure mode?
required: true
job-name:
description: The name of the job
required: false

runs:
using: "composite"

steps:
- name: Upload Report
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.job-name }}-report
path: junit-report*.xml

- name: Describe manager pod
shell: bash
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/branch-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ jobs:
GARDENER_PROJECT: ${{ secrets.GARDENER_PROJECT }}
GARDENER_SA_PATH: /tmp/gardener-sa.yaml
GARDENER_K8S_VERSION: ${{ matrix.k8s_version }}

- name: Upload Report
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: ${{ github.job }}-report
path: junit-report*.xml

- name: Send slack message on failure
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/pr-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
run: bin/ginkgo run --tags e2e --label-filter="${{ matrix.ginkgo-labels }} && !experimental" test/e2e
run: bin/ginkgo run --junit-report=junit-report.xml --tags e2e --label-filter="${{ matrix.ginkgo-labels }} && !experimental" test/e2e

- name: Finalize test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()
job-name: ${{ github.job }}-${{ matrix.ginkgo-labels }}

e2e-dev:
strategy:
Expand All @@ -64,13 +65,14 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
run: bin/ginkgo run --tags e2e --label-filter="${{ matrix.ginkgo-labels }} && experimental" test/e2e
run: bin/ginkgo run --junit-report=junit-report.xml --tags e2e --label-filter="${{ matrix.ginkgo-labels }} && experimental" test/e2e

- name: Finalize test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()
job-name: ${{ github.job }}-${{ matrix.ginkgo-labels }}

e2e-istio:
runs-on: ubuntu-latest
Expand All @@ -89,13 +91,14 @@ jobs:

- name: Run tests
run: |
bin/ginkgo run --tags istio --label-filter="integration" test/integration/istio
bin/ginkgo run --junit-report=junit-report.xml --tags istio --label-filter="integration" test/integration/istio
- name: Finalize Test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()
job-name: ${{ github.job }}

e2e-self-mon:
strategy:
Expand Down Expand Up @@ -123,7 +126,7 @@ jobs:
- name: Run tests without Istio
if: ${{ matrix.scenario == 'healthy' }}
run: |
bin/ginkgo run --tags e2e --label-filter="self-mon-${{ matrix.signal-type }}-${{ matrix.scenario }}" test/e2e
bin/ginkgo run --junit-report=junit-report-healthy.xml --tags e2e --label-filter="self-mon-${{ matrix.signal-type }}-${{ matrix.scenario }}" test/e2e
# we need Istio for fault injection to simulate backpressure and outages
- name: Deploy Istio Module
Expand All @@ -133,13 +136,14 @@ jobs:
- name: Run tests with Istio
if: ${{ matrix.scenario != 'healthy' }}
run: |
bin/ginkgo run --tags istio --label-filter="self-mon-${{ matrix.signal-type }}-${{ matrix.scenario }}" test/integration/istio
bin/ginkgo run --junit-report=junit-report-unhealthy.xml --tags istio --label-filter="self-mon-${{ matrix.signal-type }}-${{ matrix.scenario }}" test/integration/istio
- name: Finalize Test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()
job-name: ${{ github.job }}-${{ matrix.signal-type }}-${{ matrix.scenario }}

PR-Integration-Success:
needs: [e2e, e2e-dev, e2e-istio, e2e-self-mon]
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/pr-lifecycle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Run test on latest tag
shell: bash
run: |
bin/ginkgo run --tags e2e --flake-attempts=5 --label-filter="operational" -v test/e2e
bin/ginkgo run --junit-report=junit-report-latest-version.xml --tags e2e --flake-attempts=5 --label-filter="operational" -v test/e2e
- name: Wait for cleanup of test run
shell: bash
Expand Down Expand Up @@ -72,13 +72,14 @@ jobs:
shell: bash
run: |
make install-tools # delete after the tools via go modules are released
bin/ginkgo run --tags e2e --flake-attempts=5 --label-filter="operational" -v test/e2e
bin/ginkgo run --junit-report=junit-report-current-version.xml --tags e2e --flake-attempts=5 --label-filter="operational" -v test/e2e
- name: Finalize test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()
job-name: ${{ github.job }}

PR-Lifecycle-Success:
needs: manager-upgrade
Expand Down
2 changes: 1 addition & 1 deletion hack/gardener-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function run-tests-with-git-image () {
make ginkgo
make deploy
hack/deploy-istio.sh
${GINKGO} run --tags istio --label-filter="integration" test/integration/istio
${GINKGO} run --junit-report=junit-report.xml --tags istio --label-filter="integration" test/integration/istio
}

function main() {
Expand Down

0 comments on commit d1f37ff

Please sign in to comment.