-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for testing aws-hosted-cp
* Break KubeClient helpers into provider specific file. * Try to simplify the validation process for lots of different providers with different requirements. * Finish aws-hosted-cp test and add comments through test to make it easier to understand. * Use GinkgoHelper across e2e tests, populate hosted vars from AWSCluster. * No longer rely on local registry for images in test/e2e. * Support OS for awscli install. * Prepend hostname to collected log artifacts. * Support no cleanup of provider specs, differentiate ci cluster names. * Add docs on running tests, do not wait for all providers if configured. * Reinstantiate resource validation map on each instance of validation. * Enable the external-gc feature via annotation, featureGate bool. (Closes: #152) * Bump aws-*-cp templates to 0.1.3 * Bump cluster-api-provider-aws template to 0.1.2 * Improve test logging to log template name and validation phase. * Bump k0s version to v1.30.4+k0s.0, set CCM nodeSelector to null for aws-hosted-cp. (Closes: #290) * Break cleanup into seperate job so that it is unaffected by concurrency group cancellations. * Make dev-aws-nuke target less PHONY. Closes: #212 Signed-off-by: Kyle Squizzato <[email protected]>
- Loading branch information
Showing
31 changed files
with
960 additions
and
423 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,12 +1,7 @@ | ||
name: E2E Tests | ||
|
||
concurrency: | ||
group: test-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
pull_request_target: | ||
types: [labeled] | ||
pull_request: | ||
branches: | ||
- main | ||
- release-* | ||
|
@@ -15,31 +10,91 @@ on: | |
- '**.md' | ||
env: | ||
GO_VERSION: '1.22' | ||
AWS_REGION: us-west-2 | ||
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_SECRET_ACCESS_KEY }} | ||
|
||
jobs: | ||
e2etest: | ||
concurrency: | ||
group: test-e2e-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
name: E2E Tests | ||
runs-on: ubuntu-latest | ||
if: contains(github.event.pull_request.labels.*.name, 'test-e2e') | ||
env: | ||
AWS_REGION: us-west-2 | ||
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_SECRET_ACCESS_KEY }} | ||
outputs: | ||
clustername: ${{ steps.vars.outputs.clustername }} | ||
version: ${{ steps.vars.outputs.version }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: Set up Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GHCR | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Get outputs | ||
id: vars | ||
run: | | ||
echo "version=$(git describe --tags --always)" >> $GITHUB_OUTPUT | ||
echo "clustername=ci-$(date +%s)-e2e-test" >> $GITHUB_OUTPUT | ||
- name: Build and push HMC controller image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
build-args: | | ||
LD_FLAGS=-s -w -X github.com/Mirantis/hmc/internal/build.Version=${{ steps.vars.outputs.version }} | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
tags: | | ||
ghcr.io/mirantis/hmc/controller-ci:${{ steps.vars.outputs.version }} | ||
push: true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
- name: Prepare and push HMC template charts | ||
run: | | ||
make hmc-chart-release | ||
REGISTRY_REPO="oci://ghcr.io/mirantis/hmc/charts-ci" make helm-push | ||
- name: Setup kubectl | ||
uses: azure/setup-kubectl@v4 | ||
- name: Run E2E tests | ||
env: | ||
MANAGED_CLUSTER_NAME: ${{ steps.vars.outputs.clustername }} | ||
REGISTRY_REPO: 'oci://ghcr.io/mirantis/hmc/charts-ci' | ||
IMG: 'ghcr.io/mirantis/hmc/controller-ci:${{ steps.vars.outputs.version }}' | ||
run: | | ||
make test-e2e | ||
- name: Archive test results | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-logs | ||
path: | | ||
test/e2e/*.log | ||
name: test-logs | ||
path: | | ||
test/e2e/*.log | ||
cleanup: | ||
name: Cleanup | ||
needs: e2etest | ||
runs-on: ubuntu-latest | ||
if: ${{ always() }} | ||
timeout-minutes: 15 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: AWS Test Resources | ||
env: | ||
CLUSTER_NAME: '${{ needs.e2etest.outputs.clustername }}' | ||
run: | | ||
make dev-aws-nuke |
This file contains 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 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 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 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 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 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 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.