Skip to content

Commit

Permalink
[testing] : convert existing e2e tests to chainsaw tests (#253)
Browse files Browse the repository at this point in the history
* convert e2e tests to chainsaw tests

* fix dir naming and test failures

* fix failing tests

* add fw test, add script and run 2 tests in parallel

* add check for error to be null

* fix install failures by pinning bootstrap and control-plane versions

* fix typos
  • Loading branch information
rahulait authored Dec 11, 2024
1 parent 5426f27 commit 155acd1
Show file tree
Hide file tree
Showing 68 changed files with 3,260 additions and 2,760 deletions.
12 changes: 12 additions & 0 deletions .chainsaw.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/configuration-chainsaw-v1alpha1.json
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Configuration
metadata:
name: configuration
spec:
timeouts:
assert: 5m0s
cleanup: 5m0s
delete: 5m0s
error: 5m0s
exec: 5m0s
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ HELM_VERSION ?= v3.16.3
#####################################################################
CLUSTER_NAME ?= ccm-$(shell git rev-parse --short HEAD)
K8S_VERSION ?= "v1.31.2"
CAPI_VERSION ?= "v1.6.3"
CAPI_VERSION ?= "v1.8.5"
CAAPH_VERSION ?= "v0.2.1"
CAPL_VERSION ?= "v0.7.1"
CONTROLPLANE_NODES ?= 1
Expand All @@ -24,6 +24,7 @@ LINODE_FIREWALL_ENABLED ?= true
LINODE_REGION ?= us-lax
LINODE_OS ?= linode/ubuntu22.04
KUBECONFIG_PATH ?= $(CURDIR)/test-cluster-kubeconfig.yaml
MGMT_KUBECONFIG_PATH ?= $(CURDIR)/mgmt-cluster-kubeconfig.yaml

# if the $DEVBOX_PACKAGES_DIR env variable exists that means we are within a devbox shell and can safely
# use devbox's bin for our tools
Expand Down Expand Up @@ -174,8 +175,11 @@ mgmt-cluster:
--wait-providers \
--wait-provider-timeout 600 \
--core cluster-api:$(CAPI_VERSION) \
--bootstrap kubeadm:$(CAPI_VERSION) \
--control-plane kubeadm:$(CAPI_VERSION) \
--addon helm:$(CAAPH_VERSION) \
--infrastructure linode-linode:$(CAPL_VERSION)
kind get kubeconfig --name=caplccm > $(MGMT_KUBECONFIG_PATH)

.PHONY: cleanup-cluster
cleanup-cluster:
Expand All @@ -186,7 +190,12 @@ cleanup-cluster:

.PHONY: e2e-test
e2e-test:
$(MAKE) -C e2e test LINODE_API_TOKEN=$(LINODE_TOKEN) SUITE_ARGS="--region=$(LINODE_REGION) --use-existing --timeout=5m --kubeconfig=$(KUBECONFIG_PATH) --image=$(IMG) --linode-url https://api.linode.com/"
CLUSTER_NAME=$(CLUSTER_NAME) \
MGMT_KUBECONFIG=$(MGMT_KUBECONFIG_PATH) \
KUBECONFIG=$(KUBECONFIG_PATH) \
REGION=$(LINODE_REGION) \
LINODE_TOKEN=$(LINODE_TOKEN) \
chainsaw test e2e/test --parallel 2

#####################################################################
# OS / ARCH
Expand Down
34 changes: 0 additions & 34 deletions e2e/Makefile

This file was deleted.

4 changes: 0 additions & 4 deletions e2e/README.md

This file was deleted.

77 changes: 0 additions & 77 deletions e2e/go.mod

This file was deleted.

Loading

0 comments on commit 155acd1

Please sign in to comment.