diff --git a/.github/workflows/build_test_ci.yml b/.github/workflows/build_test_ci.yml index 25c69641d..f8cc5e1b7 100644 --- a/.github/workflows/build_test_ci.yml +++ b/.github/workflows/build_test_ci.yml @@ -74,6 +74,9 @@ jobs: needs: [go-build-test, docker-build] runs-on: ubuntu-latest if: github.event.pull_request.draft == false + env: + GITHUB_TOKEN: ${{ secrets.github_token }} + LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }} steps: - name: Harden Runner uses: step-security/harden-runner@v2 @@ -122,27 +125,26 @@ jobs: if: github.ref == 'refs/heads/main' run: make e2etest env: - GITHUB_TOKEN: ${{ secrets.github_token }} - LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }} INSTALL_K3S_PROVIDER: true INSTALL_RKE2_PROVIDER: true LINODE_REGION: us-sea LINODE_CONTROL_PLANE_MACHINE_TYPE: g6-standard-2 LINODE_MACHINE_TYPE: g6-standard-2 + CLUSTERCTL_CONFIG: /home/runner/work/cluster-api-provider-linode/cluster-api-provider-linode/e2e/clusterctl-config.yaml - name: Quick E2E Test run: make e2etest env: - GITHUB_TOKEN: ${{ secrets.github_token }} - LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }} + # TODO: Switch selector to quick before the PR can be merged + E2E_FLAGS: '--selector flavors' + # TODO: ALL the var below need to be deleted before the PR can be merged INSTALL_K3S_PROVIDER: true INSTALL_RKE2_PROVIDER: true LINODE_REGION: us-sea LINODE_CONTROL_PLANE_MACHINE_TYPE: g6-standard-2 LINODE_MACHINE_TYPE: g6-standard-2 CLUSTERCTL_CONFIG: /home/runner/work/cluster-api-provider-linode/cluster-api-provider-linode/e2e/clusterctl-config.yaml - E2E_SELECTOR: '--selector flavors' - name: Copy logs if: ${{ always() }} diff --git a/Makefile b/Makefile index 6848c5e12..deaf1f5e8 100644 --- a/Makefile +++ b/Makefile @@ -147,7 +147,7 @@ test: generate fmt vet envtest ## Run tests. .PHONY: e2etest e2etest: generate local-release local-deploy chainsaw - GIT_REF=$(GIT_REF) $(CHAINSAW) test ./e2e --assert-timeout 600s $(E2E_SELECTOR) + GIT_REF=$(GIT_REF) $(CHAINSAW) test ./e2e $(E2E_FLAGS) local-deploy: kind ctlptl tilt kustomize clusterctl @echo -n "LINODE_TOKEN=$(LINODE_TOKEN)" > config/default/.env.linode diff --git a/e2e/default-CAPL-cluster/chainsaw-test.yaml b/e2e/default-CAPL-cluster/chainsaw-test.yaml index 4b2b6d7fc..bb2b50f89 100755 --- a/e2e/default-CAPL-cluster/chainsaw-test.yaml +++ b/e2e/default-CAPL-cluster/chainsaw-test.yaml @@ -9,6 +9,8 @@ metadata: default-cluster: flavors: spec: + timeouts: + assert: 1000s bindings: # A short identifier for the E2E test run - name: run @@ -77,8 +79,13 @@ spec: apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster name: ($cluster) + - delete: + ref: + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 + kind: LinodeVPC + name: ($vpc) - error: - file: check-child-cluster-deleted.yaml + file: check-child-cluster-and-vpc-deleted.yaml - name: Check if the linodes are deleted try: - script: diff --git a/e2e/default-CAPL-cluster/check-child-cluster-deleted.yaml b/e2e/default-CAPL-cluster/check-child-cluster-and-vpc-deleted.yaml similarity index 58% rename from e2e/default-CAPL-cluster/check-child-cluster-deleted.yaml rename to e2e/default-CAPL-cluster/check-child-cluster-and-vpc-deleted.yaml index 81cd1fd17..55d060246 100644 --- a/e2e/default-CAPL-cluster/check-child-cluster-deleted.yaml +++ b/e2e/default-CAPL-cluster/check-child-cluster-and-vpc-deleted.yaml @@ -3,3 +3,8 @@ kind: LinodeMachine metadata: labels: cluster.x-k8s.io/cluster-name: ($cluster) +--- +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 +kind: LinodeVPC +metadata: + name: ($vpc) diff --git a/e2e/k3s-capl-cluster/chainsaw-test.yaml b/e2e/k3s-capl-cluster/chainsaw-test.yaml index c138447ef..0a67afc96 100755 --- a/e2e/k3s-capl-cluster/chainsaw-test.yaml +++ b/e2e/k3s-capl-cluster/chainsaw-test.yaml @@ -9,6 +9,8 @@ metadata: k3s: flavors: spec: + timeouts: + assert: 300s bindings: # A short identifier for the E2E test run - name: run @@ -77,8 +79,13 @@ spec: apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster name: ($cluster) + - delete: + ref: + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 + kind: LinodeVPC + name: ($vpc) - error: - file: check-child-cluster-deleted.yaml + file: check-child-cluster-and-vpc-deleted.yaml - name: Check if the linodes are deleted try: - script: diff --git a/e2e/k3s-capl-cluster/check-child-cluster-deleted.yaml b/e2e/k3s-capl-cluster/check-child-cluster-and-vpc-deleted.yaml similarity index 58% rename from e2e/k3s-capl-cluster/check-child-cluster-deleted.yaml rename to e2e/k3s-capl-cluster/check-child-cluster-and-vpc-deleted.yaml index 81cd1fd17..55d060246 100644 --- a/e2e/k3s-capl-cluster/check-child-cluster-deleted.yaml +++ b/e2e/k3s-capl-cluster/check-child-cluster-and-vpc-deleted.yaml @@ -3,3 +3,8 @@ kind: LinodeMachine metadata: labels: cluster.x-k8s.io/cluster-name: ($cluster) +--- +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 +kind: LinodeVPC +metadata: + name: ($vpc) diff --git a/e2e/rke2-capl-cluster/chainsaw-test.yaml b/e2e/rke2-capl-cluster/chainsaw-test.yaml index 5e55adacb..6f8d1dc35 100755 --- a/e2e/rke2-capl-cluster/chainsaw-test.yaml +++ b/e2e/rke2-capl-cluster/chainsaw-test.yaml @@ -9,6 +9,8 @@ metadata: rke2: flavors: spec: + timeouts: + assert: 300s bindings: # A short identifier for the E2E test run - name: run @@ -77,8 +79,13 @@ spec: apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster name: ($cluster) + - delete: + ref: + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 + kind: LinodeVPC + name: ($vpc) - error: - file: check-child-cluster-deleted.yaml + file: check-child-cluster-and-vpc-deleted.yaml - name: Check if the linodes are deleted try: - script: diff --git a/e2e/rke2-capl-cluster/check-child-cluster-deleted.yaml b/e2e/rke2-capl-cluster/check-child-cluster-and-vpc-deleted.yaml similarity index 58% rename from e2e/rke2-capl-cluster/check-child-cluster-deleted.yaml rename to e2e/rke2-capl-cluster/check-child-cluster-and-vpc-deleted.yaml index 81cd1fd17..55d060246 100644 --- a/e2e/rke2-capl-cluster/check-child-cluster-deleted.yaml +++ b/e2e/rke2-capl-cluster/check-child-cluster-and-vpc-deleted.yaml @@ -3,3 +3,8 @@ kind: LinodeMachine metadata: labels: cluster.x-k8s.io/cluster-name: ($cluster) +--- +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 +kind: LinodeVPC +metadata: + name: ($vpc)