Skip to content

Commit

Permalink
Display junit results
Browse files Browse the repository at this point in the history
Issue: ZENKO-4876
  • Loading branch information
francoisferrand committed Oct 14, 2024
1 parent d704826 commit 0b92743
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 118 deletions.
74 changes: 69 additions & 5 deletions .github/actions/archive-artifacts/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,52 @@
name: Archive artifact logs and data
description: Archive logs, pods and events

inputs:
user:
description: Artifacts user
required: true
password:
description: Artifacts password
required: true
junit-paths:
description: Path to junit reports
default: /artifacts/data/reports/*.xml
required: true
stage:
description: Stage name
default: ${{ github.job }}.${{ github.run_attempt }}
required: true
trunk_token:
description: Trunk token
required: false
zenko-name:
description: Zenko name
default: end2end
required: false
zenko-namespace:
description: Namespace
default: default
required: false

runs:
using: composite
steps:
- name: Publish test report
uses: mikepenz/action-junit-report@v4
with:
check_name: ${{ inputs.stage}}
report_paths: ${{ inputs.junit-paths }}
continue-on-error: true

- name: Upload results
if: inputs.trunk_token && job.status != 'cancelled'
uses: trunk-io/analytics-uploader@v1.4.0
with:
junit-paths: ${{ inputs.junit-paths }}
org-slug: ${{ github.repository_owner }}
token: ${{ inputs.trunk_token }}
continue-on-error: true

- name: Archive artifact logs and data
shell: bash
run: |-
Expand All @@ -17,14 +60,16 @@ runs:
kubectl get zenkodrsink -A -o yaml > /tmp/artifacts/data/${STAGE}/kind-logs/all-zenkodrsinks.log;
kind export logs /tmp/artifacts/data/${STAGE}/kind-logs/kind-export;
tar zcvf /tmp/artifacts/${{ github.sha }}-${STAGE}-logs-volumes.tgz /tmp/artifacts/data/${STAGE}/kind-logs;
env:
STAGE: ${{ inputs.stage }}
continue-on-error: true

- name: Dump kafka
shell: bash
continue-on-error: true
run: |-
set -exu
NAMESPACE=${NAMESPACE:-default}
KAFKA=$(kubectl get pods -n ${NAMESPACE} -lkafka_cr=${ZENKO_NAME:-end2end}-base-queue -o jsonpath='{.items[0].metadata.name}')
KAFKA=$(kubectl get pods -n ${NAMESPACE} -lkafka_cr=${ZENKO_NAME}-base-queue -o jsonpath='{.items[0].metadata.name}')
kubectl exec -in ${NAMESPACE} ${KAFKA} -c kafka -- \
env KAFKA_OPTS= kafka-topics.sh --bootstrap-server :9092 --list \
Expand All @@ -38,16 +83,21 @@ runs:
env KAFKA_OPTS= kafka-consumer-groups.sh --bootstrap-server :9092 --describe --all-groups \
> /tmp/artifacts/data/${STAGE}/kafka-offsets.log
KAFKA_SERVICE=$(kubectl get services -n ${NAMESPACE} -lkafka_cr=${ZENKO_NAME:-end2end}-base-queue -o jsonpath='{.items[0].metadata.name}')
KAFKA_SERVICE=$(kubectl get services -n ${NAMESPACE} -lkafka_cr=${ZENKO_NAME}-base-queue -o jsonpath='{.items[0].metadata.name}')
kubectl run -n ${NAMESPACE} kcat --image=edenhill/kcat:1.7.1 --restart=Never --command -- sleep 300
kubectl wait -n ${NAMESPACE} pod kcat --for=condition=ready
cat /tmp/artifacts/data/${STAGE}/kafka-topics.log | grep -v '^__' | xargs -P 15 -I {} \
sh -c "kubectl exec -i -n ${NAMESPACE} kcat -- \
kcat -L -b ${KAFKA_SERVICE} -t {} -C -o beginning -e -q -J \
> /tmp/artifacts/data/${STAGE}/kafka-messages-{}.log"
env:
STAGE: ${{ inputs.stage }}
NAMESPACE: ${{ inputs.zenko-namespace }}
ZENKO_NAME: ${{ inputs.zenko-name }}
continue-on-error: true

- name: Dump MongoDB
shell: bash
continue-on-error: true
run: |-
set -exu
Expand All @@ -63,3 +113,17 @@ runs:
mkdir -p /tmp/artifacts/data/${STAGE}/mongodb-dump
kubectl cp ${NAMESPACE}/data-db-mongodb-sharded-mongos-0:${DUMP_DIR} /tmp/artifacts/data/${STAGE}/mongodb-dump
env:
STAGE: ${{ inputs.stage }}.${{ github.run_attempt }}
NAMESPACE: ${{ inputs.zenko-namespace }}
ZENKO_NAME: ${{ inputs.zenko-name }}
continue-on-error: true

- name: Upload artifacts # move into `archive-artifacts` action
uses: scality/action-artifacts@v4
with:
method: upload
url: https://artifacts.scality.net
user: ${{ inputs.user }}
password: ${{ inputs.password }}
source: /tmp/artifacts
1 change: 1 addition & 0 deletions .github/actions/debug-wait/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ runs:
tmate-server-port: ${{ env.TMATE_SERVER_PORT }}
tmate-server-rsa-fingerprint: ${{ env.TMATE_SERVER_RSA_FINGERPRINT }}
tmate-server-ed25519-fingerprint: ${{ env.TMATE_SERVER_ED25519_FINGERPRINT }}
if: job.status == 'failure' && runner.debug == '1'
136 changes: 23 additions & 113 deletions .github/workflows/end2end.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -416,33 +416,15 @@ jobs:
- name: Debug wait
uses: ./.github/actions/debug-wait
timeout-minutes: 60
if: failure() && runner.debug == '1'
- name: Upload results
if: "!cancelled() && env.TRUNK_TOKEN"
uses: trunk-io/analytics-uploader@main
with:
junit-paths: /artifacts/data/reports/*.xml
org-slug: ${{ github.repository_owner }}
token: ${{ env.TRUNK_TOKEN }}
env:
TRUNK_TOKEN: ${{ secrets.TRUNK_TOKEN }}
continue-on-error: true
- name: Archive artifact logs and data
- name: Archive and publish artifacts
uses: ./.github/actions/archive-artifacts
env:
STAGE: ${{ github.job }}.${{ github.run_attempt }}
if: always()
- name: Clean Up
run: kind delete cluster
- name: Upload artifacts
uses: scality/action-artifacts@v4
with:
method: upload
url: https://artifacts.scality.net
user: ${{ secrets.ARTIFACTS_USER }}
password: ${{ secrets.ARTIFACTS_PASSWORD }}
source: /tmp/artifacts
trunk_token: ${{ secrets.TRUNK_TOKEN }}
if: always()
- name: Clean Up
run: kind delete cluster

end2end-pra:
needs: [build-kafka, check-dashboard-versions, lint-and-build-ctst]
Expand Down Expand Up @@ -493,33 +475,15 @@ jobs:
- name: Debug wait
uses: ./.github/actions/debug-wait
timeout-minutes: 60
if: failure() && runner.debug == '1'
- name: Upload results
if: env.TRUNK_TOKEN && !cancelled()
uses: trunk-io/analytics-uploader@main
with:
junit-paths: /artifacts/data/reports/*.xml
org-slug: ${{ github.repository_owner }}
token: ${{ env.TRUNK_TOKEN }}
env:
TRUNK_TOKEN: ${{ secrets.TRUNK_TOKEN }}
continue-on-error: true
- name: Archive artifact logs and data
- name: Archive and publish artifacts
uses: ./.github/actions/archive-artifacts
env:
STAGE: ${{ github.job }}.${{ github.run_attempt }}
if: always()
- name: Clean Up
run: kind delete cluster
- name: Upload artifacts
uses: scality/action-artifacts@v4
with:
method: upload
url: https://artifacts.scality.net
user: ${{ secrets.ARTIFACTS_USER }}
password: ${{ secrets.ARTIFACTS_PASSWORD }}
source: /tmp/artifacts
trunk_token: ${{ secrets.TRUNK_TOKEN }}
if: always()
- name: Clean Up
run: kind delete cluster

end2end-https:
needs: [build-kafka, build-test-image, check-dashboard-versions]
Expand Down Expand Up @@ -554,41 +518,23 @@ jobs:
- name: Run smoke tests
run: bash run-e2e-test.sh "end2end" ${E2E_IMAGE_NAME}:${E2E_IMAGE_TAG} "smoke" "default"
working-directory: ./.github/scripts/end2end
- name: Debug wait
uses: ./.github/actions/debug-wait
timeout-minutes: 60
if: failure() && runner.debug == '1'
- name: Upload results
if: env.TRUNK_TOKEN && !cancelled()
uses: trunk-io/analytics-uploader@main
with:
junit-paths: /artifacts/data/reports/*.xml
org-slug: ${{ github.repository_owner }}
token: ${{ env.TRUNK_TOKEN }}
env:
TRUNK_TOKEN: ${{ secrets.TRUNK_TOKEN }}
continue-on-error: true
# Temporarily disabled as CTST will test the same APIs more
# extensively.
# - name: Run vault e2e tests
# run: bash vault-e2e-test.sh
# working-directory: ./.github/scripts/end2end
- name: Archive artifact logs and data
- name: Debug wait
uses: ./.github/actions/debug-wait
timeout-minutes: 60
- name: Archive and publish artifacts
uses: ./.github/actions/archive-artifacts
env:
STAGE: ${{ github.job }}.${{ github.run_attempt }}
if: always()
- name: Clean Up
run: kind delete cluster
- name: Upload artifacts
uses: scality/action-artifacts@v4
with:
method: upload
url: https://artifacts.scality.net
user: ${{ secrets.ARTIFACTS_USER }}
password: ${{ secrets.ARTIFACTS_PASSWORD }}
source: /tmp/artifacts
trunk_token: ${{ secrets.TRUNK_TOKEN }}
if: always()
- name: Clean Up
run: kind delete cluster

end2end-sharded:
needs: [build-kafka, build-test-image, check-dashboard-versions]
Expand Down Expand Up @@ -616,36 +562,18 @@ jobs:
- name: Run backbeat end to end tests
run: bash run-e2e-test.sh "end2end" ${E2E_IMAGE_NAME}:${E2E_IMAGE_TAG} "backbeat" "default"
working-directory: ./.github/scripts/end2end
- name: Upload results
if: env.TRUNK_TOKEN && !cancelled()
uses: trunk-io/analytics-uploader@main
with:
junit-paths: /artifacts/data/reports/*.xml
org-slug: ${{ github.repository_owner }}
token: ${{ env.TRUNK_TOKEN }}
env:
TRUNK_TOKEN: ${{ secrets.TRUNK_TOKEN }}
continue-on-error: true
- name: Debug wait
uses: ./.github/actions/debug-wait
timeout-minutes: 60
if: failure() && runner.debug == '1'
- name: Archive artifact logs and data
- name: Archive and publish artifacts
uses: ./.github/actions/archive-artifacts
env:
STAGE: ${{ github.job }}.${{ github.run_attempt }}
if: always()
- name: Clean Up
run: kind delete cluster
- name: Upload artifacts
uses: scality/action-artifacts@v4
with:
method: upload
url: https://artifacts.scality.net
user: ${{ secrets.ARTIFACTS_USER }}
password: ${{ secrets.ARTIFACTS_PASSWORD }}
source: /tmp/artifacts
trunk_token: ${{ secrets.TRUNK_TOKEN }}
if: always()
- name: Clean Up
run: kind delete cluster

ctst-end2end-sharded:
needs: [build-kafka, lint-and-build-ctst, check-dashboard-versions]
Expand Down Expand Up @@ -680,36 +608,18 @@ jobs:
- name: Run CTST end to end tests
run: bash run-e2e-ctst.sh "" "" "" "" --tags 'not @PRA'
working-directory: ./.github/scripts/end2end
- name: Upload results
if: env.TRUNK_TOKEN && !cancelled()
uses: trunk-io/analytics-uploader@main
with:
junit-paths: /artifacts/data/reports/*.xml
org-slug: ${{ github.repository_owner }}
token: ${{ env.TRUNK_TOKEN }}
env:
TRUNK_TOKEN: ${{ secrets.TRUNK_TOKEN }}
continue-on-error: true
- name: Debug wait
uses: ./.github/actions/debug-wait
timeout-minutes: 60
if: failure() && runner.debug == '1'
- name: Archive artifact logs and data
- name: Archive and publish artifacts
uses: ./.github/actions/archive-artifacts
env:
STAGE: ${{ github.job }}.${{ github.run_attempt }}
if: always()
- name: Clean Up
run: kind delete cluster
- name: Upload artifacts
uses: scality/action-artifacts@v4
with:
method: upload
url: https://artifacts.scality.net
user: ${{ secrets.ARTIFACTS_USER }}
password: ${{ secrets.ARTIFACTS_PASSWORD }}
source: /tmp/artifacts
trunk_token: ${{ secrets.TRUNK_TOKEN }}
if: always()
- name: Clean Up
run: kind delete cluster

write-final-status:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 0b92743

Please sign in to comment.