diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0101f3f..f04d400 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,4 +16,16 @@ 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** + +[Running Unit Tests](https://github.com/devfile/registry-operator/blob/main/CONTRIBUTING.md#unit-tests) + +[Running Integration Tests](https://github.com/devfile/registry-operator/blob/main/CONTRIBUTING.md#integration-tests) + + +**Special notes to the reviewer**: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a4c891f..b6ba854 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -114,12 +114,21 @@ 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..5233994 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. @@ -173,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)