Skip to content

E2E tests ondemand #405

E2E tests ondemand

E2E tests ondemand #405

name: E2E tests ondemand
on:
workflow_dispatch:
schedule:
# At 03:00 UTC on Monday, Wednesday, and Friday.
- cron: 0 3 * * 1,3,5
env:
branch: release-1.8
permissions:
checks: write
# based on:
# https://docs.dynatrace.com/docs/setup-and-configuration/technology-support/support-model-for-kubernetes
# https://kubernetes.io/releases/
jobs:
run-matrix:
name: Run using version/platform
strategy:
# we don't want to cancel all in-progress jobs if any matrix job fails.
fail-fast: false
max-parallel: 4
matrix:
include:
- version: 1-28
platform: k8s
- version: 1-29
platform: k8s
- version: 1-30
platform: k8s
- version: 1-31
platform: k8s
- version: 1-32
platform: k8s
- version: 1-33
platform: k8s
- version: 1-34
platform: k8s
- version: 4-12
platform: ocp
- version: 4-13
platform: ocp
- version: 4-14
platform: ocp
- version: 4-15
platform: ocp
- version: 4-16
platform: ocp
- version: 4-17
platform: ocp
- version: 4-18
platform: ocp
- version: 4-19
platform: ocp
- version: 4-20
platform: ocp
environment: E2E
runs-on:
- self-hosted
- operator-e2e
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Run e2e test
id: run_e2e_test
uses: ./.github/actions/run-e2e
with:
flc-namespace: ${{ format('dto-{0}-ondemand', matrix.platform ) }}
flc-environment: ${{ format('dto-{0}-{1}', matrix.platform, matrix.version ) }}
target-branch: ${{ env.branch }}
tenant1-name: ${{ secrets.TENANT1_NAME }}
tenant1-apitoken: ${{ secrets.TENANT1_APITOKEN }}
tenant1-apitoken-nosettings: ${{ secrets.TENANT1_APITOKEN_NOSETTINGS }}
tenant1-dataingesttoken: ${{ secrets.TENANT1_DATAINGESTTOKEN }}
tenant1-oauth-client-id: ${{ secrets.TENANT1_OAUTH_CLIENT_ID }}
tenant1-oauth-secret: ${{ secrets.TENANT1_OAUTH_SECRET }}
tenant1-oauth-urn: ${{ secrets.TENANT1_OAUTH_URN }}
tenant2-name: ${{ secrets.TENANT2_NAME }}
tenant2-apitoken: ${{ secrets.TENANT2_APITOKEN }}
tenant2-dataingesttoken: ${{ secrets.TENANT2_DATAINGESTTOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare outputs
id: prepare_outputs
if: always()
run: |
PLATFORM_VERSION="${{ matrix.platform }}_${{ matrix.version }}"
PLATFORM_VERSION_CLEAN=${PLATFORM_VERSION//-/_}
get_emoji() {
if [ "$1" = "skipped" ]; then
echo "large_yellow_circle"
elif [ "$2" = "success" ]; then
echo "white_check_mark"
else
echo "red_circle"
fi
}
run_id="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ job.check_run_id }}"
emoji=$(get_emoji "${{ steps.run_e2e_test.outputs.cluster_status}}" "${{ steps.run_e2e_test.outcome }}")
echo "matrix={\"${PLATFORM_VERSION_CLEAN^^}_EMOJI\": \"${emoji}\", \"${PLATFORM_VERSION_CLEAN^^}_RUN_ID_URL\": \"${run_id}\"}" >> $GITHUB_OUTPUT
if [[ "${{ steps.run_e2e_test.outputs.cluster_status }}" == "skipped" ]]; then
exit 1
fi
- uses: hoverkraft-tech/ci-github-common/actions/set-matrix-output@666b7b6eb000db3e8614647871fa60c9f1eb7179 # 0.31.4
if: always()
with:
value: ${{ steps.prepare_outputs.outputs.matrix }}
artifact-name: run-matrix-artifact
notify-slack:
name: Notify test results in Slack
environment: E2E
needs: [run-matrix]
runs-on: ubuntu-24.04
if: ${{ always() }}
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: hoverkraft-tech/ci-github-common/actions/get-matrix-outputs@666b7b6eb000db3e8614647871fa60c9f1eb7179 # 0.31.4
id: get-matrix-outputs
with:
artifact-name: run-matrix-artifact
remove-artifact: false
- name: Set Slack message
id: set_slack_message
run: |
echo '${{ steps.get-matrix-outputs.outputs.result }}' | jq -r "add|to_entries|map(\"\(.key)=\(.value)\")|.[]" >> $GITHUB_ENV
- name: Notify failure in Slack
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
errors: true
payload-templated: true
# Note:
# to update the payload when we add new matrix entries run:
# python3 hack/slack/update_e2e_ondemand.py
payload-file-path: ./hack/slack/slack-e2e-ondemand-payload.json