From 5e3cca03608ca3c2d041be175104120bf9d56771 Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Mon, 15 Apr 2024 14:53:51 -0400 Subject: [PATCH 1/5] update documentation for testing the operator Signed-off-by: Jordan Dubrick --- CONTRIBUTING.md | 16 +++++++++++----- README.md | 13 +------------ 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a4c891f..d17c5e8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -114,12 +114,18 @@ The unit tests for this repository are located under the `pkg/` folder and are d The integration tests for this repository are located under the `tests/integration` folder and contain tests that validate the Operator's functionality when running on an OpenShift cluster. -To run these tests, run the following commands: +One of the `oc` or `kubectl` executables must be accessible. If both are present in your path, `oc` will be used, except if you +define the environment variable `K8S_CLI` with the command you prefer to use. -```bash -export IMG= -make test-integration -``` +By default, the tests will use the default image for the operator, `quay.io/devfile/registry-operator:next`. + +You can use `make -build` to build your own image, `make -push` to publish it - Replace `` with `podman` or `docker`. You will need to have a reference to your newly built image available via the `IMG` environment variable. + +In order for `make test-integration` to properly run you must first ensure your environment is prepared for the operator. The following steps should be done **before** running `make test-integration` and +these commands should be run from the root of the repository where the [`Makefile`](Makefile) is located. +1. Run `make install-cert` and wait for pods in the `cert-manager` namespace to be running before moving to step 2. +2. Run `make install && make deploy` and wait until pods in the `registry-operator-system` namespace are running before proceeding to step 3. +3. Run `make test-integration` or `IMG= make test-integration` to run the integration tests. ### Submitting Pull Request diff --git a/README.md b/README.md index 2264479..9dc50cc 100644 --- a/README.md +++ b/README.md @@ -131,18 +131,7 @@ To see all rules supported by the makefile, run `make help` ## Testing -To run integration tests for the operator, run `make test-integration`. - -One of the `oc` or `kubectl` executables must be accessible. If both are present in your path, `oc` will be used, except if you -define the environment variable `K8S_CLI` with the command you prefer to use. - -By default, the tests will use the default image for the operator, `quay.io/devfile/registry-operator:next`. - -You can use `make -build` to build your own image, `make -push` to publish it - Replace `` with `podman` or `docker`. Then, to use your own image, run: - -``` -IMG= make test-integration -``` +Detailed instructions on how to run tests for the Devfile Registry Operator are found in [CONTRIBUTING.md](CONTRIBUTING.md#testing-your-changes). ### Run operator locally It's possible to run an instance of the operator locally while communicating with a cluster. From b896e6db7f7479df05eaea04820be5d87c77bf6d Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Mon, 15 Apr 2024 15:05:05 -0400 Subject: [PATCH 2/5] update pr template for testing changes Signed-off-by: Jordan Dubrick --- .github/PULL_REQUEST_TEMPLATE.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0101f3f..5395956 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,4 +16,20 @@ Fixes #? Documentation - [ ] Does the registry operator documentation need to be updated with your changes? -**How to test changes / Special notes to the reviewer**: + +**Testing changes** + +Unit Tests: +- Run `make test` from root of the repository. + +Integration Tests: +- Run `make install-cert` and wait for pods in `cert-manager` namespace. +- Run `make install && make deploy` and wait for pods in `registry-operator-system` namespace. +- Run `make test-integration`. + + +**Special notes to the reviewer**: From a6505fe8b2d753b333567424f3d42afc048abe99 Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Mon, 15 Apr 2024 15:06:07 -0400 Subject: [PATCH 3/5] make reference to files consistent cases Signed-off-by: Jordan Dubrick --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9dc50cc..5233994 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,7 @@ make run ENABLE_WEBHOOKS=false ## Contributing -Please see our [contributing.md](./CONTRIBUTING.md). +Please see our [CONTRIBUTING.md](./CONTRIBUTING.md). ## Known Issues - [`make test-integration` times out when running in Minikube](https://github.com/devfile/api/issues/1313) From 05e31262fe2818fabffe848e02c412a1f57a1327 Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Mon, 15 Apr 2024 16:52:39 -0400 Subject: [PATCH 4/5] add comment as reminder to update docs Signed-off-by: Jordan Dubrick --- .github/PULL_REQUEST_TEMPLATE.md | 3 +++ CONTRIBUTING.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5395956..eb361a5 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -24,6 +24,9 @@ Instructions for locally testing changes made to the operator, drawn from CONTRI Unit Tests: - Run `make test` from root of the repository. + Integration Tests: - Run `make install-cert` and wait for pods in `cert-manager` namespace. - Run `make install && make deploy` and wait for pods in `registry-operator-system` namespace. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d17c5e8..b6ba854 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -121,6 +121,9 @@ By default, the tests will use the default image for the operator, `quay.io/devf You can use `make -build` to build your own image, `make -push` to publish it - Replace `` with `podman` or `docker`. You will need to have a reference to your newly built image available via the `IMG` environment variable. + In order for `make test-integration` to properly run you must first ensure your environment is prepared for the operator. The following steps should be done **before** running `make test-integration` and these commands should be run from the root of the repository where the [`Makefile`](Makefile) is located. 1. Run `make install-cert` and wait for pods in the `cert-manager` namespace to be running before moving to step 2. From c1f521206e0f9224ef172eacd5ebcd88423e233f Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Tue, 16 Apr 2024 09:44:23 -0400 Subject: [PATCH 5/5] link test instructions in pr template to contributing Signed-off-by: Jordan Dubrick --- .github/PULL_REQUEST_TEMPLATE.md | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index eb361a5..f04d400 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -21,16 +21,9 @@ Instructions for locally testing changes made to the operator, drawn from CONTRI --> **Testing changes** -Unit Tests: -- Run `make test` from root of the repository. +[Running Unit Tests](https://github.com/devfile/registry-operator/blob/main/CONTRIBUTING.md#unit-tests) - -Integration Tests: -- Run `make install-cert` and wait for pods in `cert-manager` namespace. -- Run `make install && make deploy` and wait for pods in `registry-operator-system` namespace. -- Run `make test-integration`. +[Running Integration Tests](https://github.com/devfile/registry-operator/blob/main/CONTRIBUTING.md#integration-tests)