From dd1abfa68ad3d0e6f58cb3e8cd0eb5ee3cadb945 Mon Sep 17 00:00:00 2001 From: Benjamin Schimke Date: Tue, 16 Jul 2024 16:41:56 +0200 Subject: [PATCH] update readme and cleanup outdated sections --- README.md | 17 ----------------- test/e2e/README.md | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 2e4bf6d1..454ae375 100644 --- a/README.md +++ b/README.md @@ -5,20 +5,3 @@ This repository contains bootstrap and control plane providers to deploy Canonic CABPCK (Cluster API bootstrap provider for Canonical Kubernetes) is responsible for generate cloud-init scripts for generate Machines such that they run Kubernetes nodes. This implementation uses [Canonical Kubernetes](https://github.com/canonical/k8s-snap) to deliver Kubernetes. CACPCK (Cluster API control plane provider for Canonical Kubernetes) is responsible for managing the lifecycle of machines that host the control plane nodes of a Canonical Kubernetes cluster. - -## Tests - -Run the unittests with - -```shell -make test-unit -``` - -For the e2e tests, run: - -```shell -make docker-build-e2e # run only once to build the images -make test-e2e -``` - -Visit the [tests README](./test/e2e/README.md) for more information. diff --git a/test/e2e/README.md b/test/e2e/README.md index a3e3dce8..849be79c 100644 --- a/test/e2e/README.md +++ b/test/e2e/README.md @@ -1,27 +1,29 @@ # e2e test + The e2e test use the [Cluster API test framework](https://pkg.go.dev/sigs.k8s.io/cluster-api/test/framework?tab=doc) and use the [CAPD](https://github.com/kubernetes-sigs/cluster-api/tree/main/test/infrastructure/docker) as the infrastructure provider. Please make sure you have [Docker](https://docs.docker.com/install/) and [kind](https://kind.sigs.k8s.io/) installed. -You could refer to the [Testing Cluster API](https://cluster-api.sigs.k8s.io/developer/testing) for more information. +Refer to the [Testing Cluster API](https://cluster-api.sigs.k8s.io/developer/testing) for more information. ## Run the e2e test + The e2e image will be built with tag `dev`. You should build the image first before running the test. + ```shell make docker-build-e2e # should be run everytime you change the controller code make test-e2e # run all e2e tests ``` + ### Run a specific e2e test + To run a specific e2e test, such as `[PR-Blocking]`, use the `GINKGO_FOCUS` environment variable as shown below: + ```shell make GINKGO_FOCUS="\\[PR-Blocking\\]" test-e2e # only run e2e test with `[PR-Blocking]` in its spec name ``` -### Run the e2e test with tilt -It is quite useful to run the e2e test with [tilt](https://cluster-api.sigs.k8s.io/developer/tilt), so that you will not need to rebuild docker image with `make docker-build-e2e` everytime. Also you will not need to wait a new cluster creation and setup. If you have set up your tilt cluster and made the current context points to this cluster, you could run: -```shell -# running e2e for the cluster pointed by the current context -make USE_EXISTING_CLUSTER=true test-e2e -``` + ## Develop an e2e test -You could refer to [Developing E2E tests](https://cluster-api.sigs.k8s.io/developer/e2e) for a complete guide for developing e2e tests. + +Refer to [Developing E2E tests](https://cluster-api.sigs.k8s.io/developer/e2e) for a complete guide for developing e2e tests. A guide for developing a ck8s e2e test: @@ -31,4 +33,5 @@ A guide for developing a ck8s e2e test: * If reusing a [cluster-api test spec](https://github.com/kubernetes-sigs/cluster-api/tree/main/test/e2e), note that they assume the use of `KubeadmControlPlane`. For customization, copy code into `test/e2e/helpers.go`. ## Troubleshooting + * [Cluster API with Docker - "too many open files".](https://cluster-api.sigs.k8s.io/user/troubleshooting.html?highlight=too%20many#cluster-api-with-docker----too-many-open-files)