Skip to content

test: Fix flaky telemetry test (Pt. 2) #3070

test: Fix flaky telemetry test (Pt. 2)

test: Fix flaky telemetry test (Pt. 2) #3070

Workflow file for this run

name: PR Lifecycle
on:
merge_group:
pull_request:
branches:
- "main"
- "release-*"
paths-ignore:
- 'docs/**'
- 'dependencies/**'
- '**/*.md'
- 'OWNERS'
- 'CODEOWNERS'
- 'external-images.yaml'
workflow_dispatch:
jobs:
manager-upgrade:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Golang
uses: "./.github/template/setup-golang"
- name: Provision K3D
shell: bash
run: make provision-k3d
- name: Deploy with latest tag
shell: bash
run: |
git fetch --tags
LATEST_TAG=$(git tag --sort=-creatordate | sed -n 1p)
echo "Using tag ${LATEST_TAG}"
git checkout ${LATEST_TAG}
GIT_COMMIT_SHA=$(git rev-parse --short=8 HEAD)
GIT_COMMIT_DATE=$(git show -s --format=%cd --date=format:'v%Y%m%d' ${GIT_COMMIT_SHA})
echo "Deploying Manager using image europe-docker.pkg.dev/kyma-project/prod/telemetry-manager:${GIT_COMMIT_DATE}-${GIT_COMMIT_SHA}"
IMG=europe-docker.pkg.dev/kyma-project/prod/telemetry-manager:${GIT_COMMIT_DATE}-${GIT_COMMIT_SHA} make deploy-experimental
- name: Wait for manager readiness
shell: bash
run: kubectl -n kyma-system rollout status deployment telemetry-manager --timeout=90s
- name: Run test on latest tag
shell: bash
run: |
bin/ginkgo run --junit-report=junit-report-latest-version.xml --tags e2e --flake-attempts=5 --label-filter="operational" -v test/e2e
- name: Switch back to current revision
uses: actions/checkout@v4
- name: Wait for cleanup of test run
shell: bash
run: hack/wait-for-namespaces.sh
# wait for the build to complete so that the manager image is available
- name: Wait for the Build Image workflow to complete
run: "./hack/await_image.sh"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
# sets trigger depending on event being either pull_request or merge_group
TRIGGER: "${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}"
QUERY_INTERVAL: 30
IMAGE_REPO: "europe-docker.pkg.dev/kyma-project/dev/telemetry-manager"
- name: Deploy with current version
shell: bash
run: |
# add the tag PR-<number> to the image if it is a PR, if the trigger is merge_group, then add the sha as the tag
TAG="${{ github.event_name == 'pull_request' && 'PR-' || '' }}${{ github.event.number || github.event.merge_group.head_sha }}"
IMG=europe-docker.pkg.dev/kyma-project/dev/telemetry-manager:${TAG} make deploy-experimental
- name: Wait for manager readiness
shell: bash
run: kubectl -n kyma-system rollout status deployment telemetry-manager --timeout=90s
- name: Run test on current version
shell: bash
run: |
make install-tools # delete after the tools via go modules are released
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 }}