Skip to content

Commit

Permalink
Introduce MODE and TARGET for E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziopandini committed Jan 29, 2024
1 parent 156564e commit 418c0b2
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 222 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ GINKGO_FOCUS ?=
GINKGO_SKIP ?=
GINKGO_NODES ?= 1
GINKGO_TIMEOUT ?= 3h
E2E_CONF_FILE ?= $(abspath test/e2e/config/vsphere-dev.yaml)
E2E_CONF_FILE ?= $(abspath test/e2e/config/vsphere.yaml)
E2E_CAPV_MODE ?= legacy
E2E_TARGET_TYPE ?= byo
E2E_BYO_CONF_OVERRIDES ?= $(abspath test/e2e/config/byo-overrides.yaml)
E2E_IPAM_KUBECONFIG ?=
INTEGRATION_CONF_FILE ?= $(abspath test/integration/integration-dev.yaml)
E2E_TEMPLATE_DIR := $(abspath test/e2e/data/infrastructure-vsphere/)
SKIP_RESOURCE_CLEANUP ?= false
USE_EXISTING_CLUSTER ?= false
GINKGO_NOCOLOR ?= false
E2E_IPAM_KUBECONFIG ?=

# to set multiple ginkgo skip flags, if any
ifneq ($(strip $(GINKGO_SKIP)),)
Expand Down Expand Up @@ -532,6 +535,9 @@ e2e: $(GINKGO) $(KUSTOMIZE) $(KIND) $(GOVC) ## Run e2e tests
--e2e.artifacts-folder="$(ARTIFACTS)" \
--e2e.skip-resource-cleanup=$(SKIP_RESOURCE_CLEANUP) \
--e2e.use-existing-cluster="$(USE_EXISTING_CLUSTER)" \
--e2e.capv-mode="$(E2E_CAPV_MODE)" \
--e2e.target-type="$(E2E_TARGET_TYPE)" \
--e2e.byo-config-overrides="$(E2E_BYO_CONF_OVERRIDES)" \
--e2e.ipam-kubeconfig="$(E2E_IPAM_KUBECONFIG)"

## --------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/release/release-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This comes down to changing occurrences of the old version to the new version, e
1. Goal is that our clusterctl upgrade tests are testing the right versions. For `v1.8` this means:
- v1beta1: `v1.8` (will change with each new release)
- v1beta1: `v1.7` (will change with each new release)
2. Update providers in `vsphere-ci.yaml`, `vsphere-dev.yaml`, `integration-dev.yaml`:
2. Update providers in `vsphere.yaml`, `integration-dev.yaml`:
1. Add a new `v1.7.0` entry.
2. Remove providers that are not used anymore in clusterctl upgrade tests.
3. Change `v1.7.99` to `v1.8.99`.
Expand Down
5 changes: 4 additions & 1 deletion hack/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ function login() {

AUTH=
E2E_IMAGE_SHA=
CAPV_MODE="${CAPV_MODE:-legacy}"
GCR_KEY_FILE="${GCR_KEY_FILE:-}"
export VSPHERE_SERVER="${GOVC_URL}"
export VSPHERE_USERNAME="${GOVC_USERNAME}"
export VSPHERE_PASSWORD="${GOVC_PASSWORD}"
export VSPHERE_SSH_AUTHORIZED_KEY="${VM_SSH_PUB_KEY}"
export VSPHERE_SSH_PRIVATE_KEY="/root/ssh/.private-key/private-key"
export E2E_CONF_FILE="${REPO_ROOT}/test/e2e/config/vsphere-ci.yaml"
export E2E_CONF_FILE="${REPO_ROOT}/test/e2e/config/vsphere.yaml"
export E2E_CAPV_MODE="${CAPV_MODE}"
export E2E_TARGET_TYPE="vmc"
export ARTIFACTS="${ARTIFACTS:-${REPO_ROOT}/_artifacts}"
export DOCKER_IMAGE_TAR="/tmp/images/image.tar"
export GC_KIND="false"
Expand Down
1 change: 1 addition & 0 deletions test/e2e/config/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
byo-overrides.yaml
36 changes: 36 additions & 0 deletions test/e2e/config/byo-overrides-example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
# This e2e config file conatins an example of overrides for a tests targeting a user provided vCenter instance.
# Those overrides will be applied on top of the content of the config file used for CI (only variables and intervals are considered)

variables:
# Change following values with the info about the user provided vCenter instance (current values are just examples)
VSPHERE_SERVER: "vcenter.vmware.com"
VSPHERE_TLS_THUMBPRINT: "AA:BB:CC:DD:11:22:33:44:EE:FF"
VSPHERE_DATACENTER: "SDDC-Datacenter"
VSPHERE_COMPUTE_CLUSTER: "cluster0"
VSPHERE_FOLDER: "FolderName"
VSPHERE_RESOURCE_POOL: "ResourcePool"
VSPHERE_DATASTORE: "WorkloadDatastore"
VSPHERE_STORAGE_POLICY: "Cluster API vSphere Storage Policy"
VSPHERE_NETWORK: "network-1"
VSPHERE_TEMPLATE: "ubuntu-2204-kube-v1.29.0"
FLATCAR_VSPHERE_TEMPLATE: "flatcar-stable-3602.2.3-kube-v1.29.0"
CONTROL_PLANE_ENDPOINT_IP: "10.0.0.10"
# Only for clusterctl upgrade tests
# WORKLOAD_CONTROL_PLANE_ENDPOINT_IP:
# Also following variables are required but it is recommended to use env variables to avoid disclosure of sensitive data
# VSPHERE_SSH_AUTHORIZED_KEY:
# VSPHERE_PASSWORD:
# VSPHERE_USERNAME:

# Only for multivc_test info about a second user provided vCenter instance must be provided
VSPHERE2_SERVER: "vcenter2.vmware.com"
VSPHERE2_TLS_THUMBPRINT: "AA:BB:CC:DD:11:22:33:44:EE:FF"
VSPHERE2_RESOURCE_POOL: "ResourcePool"
VSPHERE2_TEMPLATE: "ubuntu-2204-kube-v1.29.0"
VSPHERE2_CONTROL_PLANE_ENDPOINT_IP: "10.0.0.11"
# Also following variables are required but it is recommended to use env variables to avoid disclosure of sensitive data
# VSPHERE2_USERNAME:
# VSPHERE2_PASSWORD:

intervals:
218 changes: 0 additions & 218 deletions test/e2e/config/vsphere-dev.yaml

This file was deleted.

File renamed without changes.
Loading

0 comments on commit 418c0b2

Please sign in to comment.