Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional e2e fixes #958

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/e2e-image-clean.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on:
workflow_call:

permissions:
contents: read
packages: write

env:
TAG: v0.0.1

jobs:
clean_e2e_image:
runs-on: ubuntu-latest
steps:
- name: Cleanup e2e test image
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
IMAGE_URL="$(gh api /orgs/rancher/packages/container/turtles-e2e/versions | jq ".[] | select( .metadata.container.tags | contains([\"$TAG\"])) | .url" | sed 's/\"//g')"
gh api --method DELETE -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" "$IMAGE_URL"
anmazzotti marked this conversation as resolved.
Show resolved Hide resolved
30 changes: 30 additions & 0 deletions .github/workflows/e2e-image-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
workflow_call:

permissions:
contents: read
packages: write

env:
TAG: v0.0.1

jobs:
publish_e2e_image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setupGo
uses: actions/[email protected]
with:
go-version: "=1.22.10"
- name: Docker login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push e2e image
run: make e2e-image-build-and-push
14 changes: 14 additions & 0 deletions .github/workflows/e2e-long.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ on:
concurrency: ci_e2e_tests

jobs:
publish_e2e_image:
uses: ./.github/workflows/e2e-image-publish.yaml
secrets: inherit
e2e_import_gitops:
needs: publish_e2e_image
uses: ./.github/workflows/run-e2e-suite.yaml
with:
test_suite: test/e2e/suites/import-gitops
Expand All @@ -18,6 +22,7 @@ jobs:
MANAGEMENT_CLUSTER_ENVIRONMENT: eks
secrets: inherit
e2e_import_gitops_v3:
needs: publish_e2e_image
uses: ./.github/workflows/run-e2e-suite.yaml
with:
test_suite: test/e2e/suites/import-gitops-v3
Expand All @@ -27,6 +32,7 @@ jobs:
MANAGEMENT_CLUSTER_ENVIRONMENT: eks
secrets: inherit
e2e_v2prov:
needs: publish_e2e_image
uses: ./.github/workflows/run-e2e-suite.yaml
with:
test_suite: test/e2e/suites/v2prov
Expand All @@ -36,6 +42,7 @@ jobs:
MANAGEMENT_CLUSTER_ENVIRONMENT: eks
secrets: inherit
e2e_update_labels:
needs: publish_e2e_image
uses: ./.github/workflows/run-e2e-suite.yaml
with:
test_suite: test/e2e/suites/update-labels
Expand All @@ -45,6 +52,7 @@ jobs:
MANAGEMENT_CLUSTER_ENVIRONMENT: eks
secrets: inherit
e2e_embedded_capi_disabled:
needs: publish_e2e_image
uses: ./.github/workflows/run-e2e-suite.yaml
with:
test_suite: test/e2e/suites/embedded-capi-disabled
Expand All @@ -54,6 +62,7 @@ jobs:
MANAGEMENT_CLUSTER_ENVIRONMENT: eks
secrets: inherit
e2e_embedded_capi_disabled_v3:
needs: publish_e2e_image
uses: ./.github/workflows/run-e2e-suite.yaml
with:
test_suite: test/e2e/suites/embedded-capi-disabled-v3
Expand All @@ -62,3 +71,8 @@ jobs:
artifact_name: artifacts_embedded_capi_v3
MANAGEMENT_CLUSTER_ENVIRONMENT: eks
secrets: inherit
clean_e2e_image:
if: always()
needs: [e2e_import_gitops, e2e_import_gitops_v3, e2e_v2prov, e2e_update_labels, e2e_embedded_capi_disabled, e2e_embedded_capi_disabled_v3]
uses: ./.github/workflows/e2e-image-clean.yaml
secrets: inherit
12 changes: 2 additions & 10 deletions .github/workflows/run-e2e-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:

permissions:
contents: read
packages: write
packages: read

env:
NGROK_AUTHTOKEN: ${{ secrets.NGROK_AUTHTOKEN }}
Expand All @@ -54,7 +54,7 @@ env:
GINKGO_LABEL_FILTER: full
GINKGO_TESTS: ${{ github.workspace }}/${{ inputs.test_suite }}
GINKGO_NODES: 5
TAG: v${{ github.run_number }}.${{ github.run_attempt }}
TAG: v0.0.1
Danil-Grigorev marked this conversation as resolved.
Show resolved Hide resolved

jobs:
run_e2e_tests:
Expand Down Expand Up @@ -92,9 +92,6 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push e2e image
if: ${{ inputs.MANAGEMENT_CLUSTER_ENVIRONMENT == 'eks' }}
run: make e2e-image-build-and-push
- name: Run e2e tests
run: make test-e2e
- name: Collect run artifacts
Expand Down Expand Up @@ -123,11 +120,6 @@ jobs:
age-in-hours: 6
resource-label-key: ${{ secrets.GCP_LABEL_KEY }}
resource-label-value: ${{ secrets.GCP_LABEL_VALUE }}
- name: Cleanup e2e test image
if: always()
run: |
IMAGE_URL="$(gh api /orgs/rancher/packages/container/turtles-e2e/versions | jq ".[] | select( .metadata.container.tags | contains([\"$TAG\"])) | .url" | sed 's/\"//g')"
gh api -X DELETE "$IMAGE_URL"
- name: Send failed status to slack
if: failure()
uses: slackapi/[email protected]
Expand Down
Loading