End-to-End tests + CEPH #158
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2024 Flant JSC | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: End-to-End tests + CEPH | |
| env: | |
| CSI: rbd.csi.ceph.com | |
| STORAGE_CLASS_NAME: ceph-pool-r2-csi-rbd-immediate | |
| CI_COMMIT_REF_NAME: ${{ github.ref_name }} | |
| GO_VERSION: "1.24.6" | |
| TIMEOUT: "3h" | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| show_dev_manifest: | |
| runs-on: ubuntu-latest | |
| name: Run e2e | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go ${{ env.GO_VERSION }} | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "${{ env.GO_VERSION }}" | |
| - name: Install Task | |
| uses: arduino/setup-task@v2 | |
| with: | |
| version: 3.x | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install ginkgo | |
| working-directory: ./test/e2e/ | |
| run: | | |
| echo "Install ginkgo" | |
| go install tool | |
| - name: Setup d8 | |
| uses: ./.github/actions/install-d8 | |
| - uses: azure/k8s-set-context@v4 | |
| with: | |
| method: kubeconfig | |
| context: e2e-virt-e2e-tests | |
| kubeconfig: ${{ secrets.NIGHTLY_E2E_TESTS_SECRET }} | |
| - name: Download dependencies | |
| working-directory: ./test/e2e/ | |
| run: | | |
| echo "Download dependencies" | |
| go mod download | |
| - name: Set URL | |
| working-directory: ./test/e2e/ | |
| run: | | |
| echo "Set URL" | |
| task set-url:ci | |
| - name: Run E2E | |
| id: e2e-tests | |
| working-directory: ./test/e2e/ | |
| run: | | |
| task run:ci -v LABELS="Slow" | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: resources_from_failed_tests | |
| path: ${{ runner.temp }}/e2e_failed__* | |
| if-no-files-found: ignore | |
| - name: Save results | |
| working-directory: ./test/e2e/ | |
| if: always() | |
| run: | | |
| if [ -z "$SUMMARY" ]; then | |
| SUMMARY=$(jq -n \ | |
| --arg csi "$CSI" \ | |
| --arg date "$DATE" \ | |
| --arg startTime "$START_TIME" \ | |
| --arg branch "$GITHUB_REF_NAME" \ | |
| --arg status ":question: UNKNOWN" \ | |
| --arg link "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ | |
| '{ | |
| CSI: $csi, | |
| Date: $date, | |
| StartTime: $startTime, | |
| Branch: $branch, | |
| Status: $status, | |
| Link: $link | |
| }' | |
| ) | |
| fi | |
| echo $SUMMARY | |
| hash=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32 | md5sum | awk '{print $1}') | |
| kubectl apply --filename - <<EOF | |
| apiVersion: v1 | |
| kind: Secret | |
| metadata: | |
| name: "end-to-end-tests-report-$STORAGE_CLASS_NAME-$DATE-${hash:0:8}" | |
| namespace: default | |
| labels: | |
| storageClass: "$STORAGE_CLASS_NAME" | |
| type: Opaque | |
| stringData: | |
| summary: | | |
| $(echo "$SUMMARY" | sed 's/^/ /') | |
| EOF |