-
Notifications
You must be signed in to change notification settings - Fork 418
test(e2e): E2E test improvements #6804
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
Merged
+7,228
−734
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1875b85
WIP: add more test suites based off kargo-examples
hairyhum bd0f6a3
Retry on 400 error from promotion to handle stage not allowing promot…
hairyhum df3e408
Get all suites to runnable state
hairyhum 27a6072
test(e2e): Support running e2e tests in local kind cluster
hairyhum 254d20c
test(e2e): add http, vars, soak_time and yaml_parse examples to e2e t…
hairyhum 26622ed
argocd-wait test
hairyhum f37743a
formatting
hairyhum 4f277ea
test(e2e): Nightly test setup (#6872)
hairyhum 28c03b6
Code cleanup
hairyhum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| name: E2E (nightly) | ||
|
|
||
| on: | ||
| # schedule: | ||
| # Nightly at 03:00 UTC. | ||
| # - cron: "0 3 * * *" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| e2e: | ||
| runs-on: ubuntu-latest | ||
| # Test provisions kind cluster, cert-manager, Argo CD and Kargo, so the full run takes a while. | ||
| timeout-minutes: 180 | ||
| steps: | ||
| - name: Harden the runner (Audit all outbound calls) | ||
| uses: step-security/harden-runner@b09bb98e06d4d774595224525879c09bc6e98c40 # v2.20.1 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
|
|
||
| - name: Install Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| # Use the e2e module's toolchain version. | ||
| go-version-file: hack/test/e2e/go.mod | ||
| cache-dependency-path: | | ||
| go.sum | ||
| hack/test/e2e/go.sum | ||
|
|
||
| # The test shells out to helm, kind, kargo and argocd; install them all into | ||
| # hack/bin, which is added to PATH for the subsequent steps. | ||
| - name: Add hack/bin to PATH | ||
| run: echo "${GITHUB_WORKSPACE}/hack/bin" >> "${GITHUB_PATH}" | ||
|
|
||
| - name: Install helm | ||
| run: make install-helm | ||
|
|
||
| - name: Build kind | ||
| run: go build -o hack/bin/kind sigs.k8s.io/kind | ||
|
|
||
| - name: Build kargo CLI | ||
| run: go build -o hack/bin/kargo ./cmd/cli | ||
|
|
||
| - name: Install argocd CLI | ||
| run: | | ||
| curl -fsSL -o hack/bin/argocd \ | ||
| https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64 | ||
| chmod +x hack/bin/argocd | ||
|
|
||
| - name: Verify tools | ||
| run: | | ||
| go version | ||
| helm version | ||
| kind version | ||
| kargo version --client || true | ||
| argocd version --client | ||
|
|
||
| # nightly_config.yaml ships with an empty `context` section. Populate it from | ||
| # repository secrets so the git- and http-dependent suites can run. Each key | ||
| # is only written when its secret is set; suites whose context is missing | ||
| # skip or fail on their own. | ||
| - name: Configure e2e context | ||
| env: | ||
| E2E_KARGO_DEMO_GITOPS_REPO: ${{ secrets.E2E_KARGO_DEMO_GITOPS_REPO }} | ||
| E2E_GIT_PAT: ${{ secrets.E2E_GIT_PAT }} | ||
| ## TODO: We need to set up the endpoint to ebable that | ||
| # E2E_HTTP_ENDPOINT: ${{ secrets.E2E_HTTP_ENDPOINT }} | ||
| run: | | ||
| cfg=hack/test/e2e/envs/nightly_config.yaml | ||
| # Drop the existing (last) context section and re-add it from secrets. | ||
| sed -i '/^context:/,$d' "${cfg}" | ||
| { | ||
| echo "context:" | ||
| [ -n "${E2E_KARGO_DEMO_GITOPS_REPO}" ] && echo " kargo_demo_gitops_repo: ${E2E_KARGO_DEMO_GITOPS_REPO}" | ||
| [ -n "${E2E_GIT_PAT}" ] && echo " git_pat: ${E2E_GIT_PAT}" | ||
| [ -n "${E2E_HTTP_ENDPOINT}" ] && echo " http_endpoint: ${E2E_HTTP_ENDPOINT}" | ||
| } >> "${cfg}" | ||
|
|
||
| - name: Build kargo image | ||
| run: | | ||
| make hack-build | ||
|
|
||
| - name: Run e2e tests | ||
| working-directory: hack/test/e2e | ||
| run: | | ||
| go test -tags=e2e,shared ./suites/shared -timeout 120m -args -env-file=nightly_config.yaml |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| ## Example environment for running e2e tests against a self-managed kind cluster | ||
| ## with Kargo and Argo CD installed via Helm. | ||
| ## | ||
| ## The `cluster` section opts the run into managing its own cluster: the | ||
| ## envfuncs.ClusterSetupFuncs (CreateKindCluster -> InstallCertManager -> | ||
| ## InstallArgoCD -> InstallKargo) run only when it is present, and | ||
| ## envfuncs.ClusterTeardownFuncs (DestroyKindCluster) tears it down afterwards. | ||
| ## Wire these into a funcsloader (see framework/funcsloader) to use them. | ||
| ## | ||
| ## Every field below is optional; the values shown are the built-in defaults. | ||
| description: "Provision a kind cluster and install Kargo + Argo CD via Helm" | ||
|
|
||
| cluster: | ||
| name: kargo-e2e | ||
| ## Optional kind node image, e.g. kindest/node:v1.31.2 | ||
| image: "" | ||
| ## Optional path to a kind cluster config file (supports a leading ~). | ||
| config_file: "" | ||
|
|
||
| ## cert-manager is a prerequisite for Kargo's self-signed certificates. | ||
| cert_manager: | ||
| release_name: cert-manager | ||
| namespace: cert-manager | ||
| chart: jetstack/cert-manager | ||
| chart_repo_name: jetstack | ||
| chart_repo_url: https://charts.jetstack.io | ||
| version: "" | ||
| timeout: 10m | ||
| ## Defaults to ["crds.enabled=true"] when omitted. | ||
| set: [] | ||
| values_files: [] | ||
|
|
||
| ## argo-rollouts are required for AnalysisTemplate in kargo | ||
| argo-rollouts: | ||
| namespace: argo-rollouts | ||
| timeout: 10m | ||
|
|
||
| argocd: | ||
| release_name: argocd | ||
| namespace: argocd | ||
| chart: argo/argo-cd | ||
| chart_repo_name: argo | ||
| chart_repo_url: https://argoproj.github.io/argo-helm | ||
| version: "" | ||
| timeout: 10m | ||
| set: [] | ||
| values_files: [ | ||
| ../../values.argocd.test.yaml | ||
| ] | ||
|
|
||
| kargo: | ||
| release_name: kargo | ||
| namespace: kargo | ||
| ## Defaults to the published OCI chart. Point at a local path (e.g. | ||
| ## ../../../charts/kargo) to test this checkout's chart. | ||
| chart: oci://ghcr.io/akuity/kargo-charts/kargo | ||
| ## For a classic (non-OCI) repo, set chart_repo_name + chart_repo_url instead. | ||
| chart_repo_name: "" | ||
| chart_repo_url: "" | ||
| version: "" | ||
| timeout: 10m | ||
| ## Optional locally built image to load into the kind cluster before install, | ||
| ## e.g. kargo:dev (pair with `set` entries pointing the chart at it). | ||
| image: "" | ||
| set: [] | ||
| values_files: [ | ||
| ../../values.test.yaml | ||
| ] | ||
|
|
||
| kargo_cli: | ||
| ## Indicate that we need to run `kargo login` to login into a kargo instance in `kind` cluster | ||
| kargo_login: | ||
| ## Use tmp directory to store kargo config | ||
| use_tmp_config_home: true | ||
|
|
||
| argocd_cli: | ||
| ## Using system-local argocd config created by `argocd login` | ||
| config_file: ~/.config/argocd/config | ||
| ## Indicate that we need to run `argocd login` to login to an argocd instance in `kind` cluster | ||
| argocd_login: true | ||
|
|
||
| context: | ||
| # kargo_demo_gitops_repo: <specify a repo here> | ||
| # git_pat: <specify a PAT here> | ||
| # http_endpoint: <URL of an HTTP endpoint that returns 2xx to a POST> |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| ## Environment template used to configure nightly e2e runs. | ||
|
|
||
| ## It is based on kind_config.yaml and is going to use `kind` and `helm` to set up kargo and argocd instances. | ||
| description: "Nightly test wth kind cluster" | ||
|
|
||
| cluster: | ||
| name: kargo-e2e | ||
|
|
||
| ## cert-manager is a prerequisite for Kargo's self-signed certificates. | ||
| cert_manager: | ||
| namespace: cert-manager | ||
| timeout: 10m | ||
|
|
||
| argocd: | ||
| namespace: argocd | ||
| timeout: 10m | ||
| values_files: [ | ||
| ../../values.argocd.test.yaml | ||
| ] | ||
|
|
||
| argo-rollouts: | ||
| namespace: argo-rollouts | ||
| timeout: 10m | ||
|
|
||
| kargo: | ||
| namespace: kargo | ||
| ## Using a chart directly from the repo | ||
| chart: ../../../../../charts/kargo | ||
| ## Using an image built with make hack-build | ||
| image: docker.io/library/kargo:dev | ||
| timeout: 10m | ||
| values_files: [ | ||
| ../../values.test.yaml | ||
| ] | ||
|
|
||
| kargo_cli: | ||
| ## Indicate that we need to run `kargo login` to login into a kargo instance in `kind` cluster | ||
| kargo_login: | ||
| ## Use tmp directory to store kargo config | ||
| use_tmp_config_home: true | ||
|
|
||
| argocd_cli: | ||
| ## Using system-local argocd config created by `argocd login` | ||
| config_file: ~/.config/argocd/config | ||
| ## Indicate that we need to run `argocd login` to login to an argocd instance in `kind` cluster | ||
| argocd_login: true | ||
|
|
||
| context: | ||
| # kargo_demo_gitops_repo: <specify a repo here> | ||
| # git_pat: <specify a PAT here> | ||
| # http_endpoint: <URL of an HTTP endpoint that returns 2xx to a POST> |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.