From 75e622d1da3879f80f3050456ce70dc5f0c23b23 Mon Sep 17 00:00:00 2001 From: John Collier Date: Wed, 14 Jun 2023 14:18:50 -0400 Subject: [PATCH] Add instructions for installing pact for tests (#345) * Add instructions for installing pact for tests * Update README.md Co-authored-by: Michael Valdron --------- Co-authored-by: Michael Valdron --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 452d6dc9c..e388491c9 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ A Kubernetes operator to create and manage applications and control the lifecycle of applications. - ## Building & Testing This operator provides a `Makefile` to run all the usual development tasks. If you simply run `make` without any arguments, you'll get a list of available "targets". @@ -21,6 +20,8 @@ To test the code: make test ``` +**Note:** In order for the controller tests to run, follow the instructions for [installing the Pact tools](#installing-pact-tools) + To build the docker image of the operator one can run: ``` @@ -44,6 +45,16 @@ The image being pushed can again be modified using the environment variable: IMG=quay.io/user/hasoperator:next make docker-push ``` +## Installing Pact Tools + +The Pact tests in the controller package require pact tooling to be installed and on your path. Follow these instructions to do so: + +1. Change directory to an appropriate folder (e.g. `/usr/local`) +2. Run `curl -fsSL https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh | bash` +3. Add the pact tools' bin folder (e.g. `/usr/local/pact/bin`) to your path to your shell PATH. Ensure all binary files within the `bin/` folder has executable permissions +4. Run `go install github.com/pact-foundation/pact-go@v1` to install the `pact-go` tool +5. Run `pact-go install` to validate that all of the necessary Pact tools are installed + ## Deploying the Operator The following section outlines the steps to deploy HAS on a physical Kubernetes cluster.