github.com/verrazzano/verrazzano-monitoring-operator@v0.0.30/test/integ/README.md (about)

     1  # Integration Testing
     2  
     3  The integration tests are end-to-end and designed to test real user scenarios against a live Kubernetes cluster.
     4  
     5  ## Build and run integration tests
     6  
     7  ### Requirements
     8  
     9  The following is required to build and run the integration tests:
    10  
    11  *	Golang 1.9 or higher
    12  *	Kubernetes v1.9.x or higher (e.g. OKE/OCE, [terraform-kubernetes-installer](https://github.com/oracle/terraform-kubernetes-installer), Docker for Mac [with Kubernetes](https://docs.docker.com/docker-for-mac/#kubernetes))
    13  
    14  
    15  ## Run integration tests
    16  
    17  There are a variety of ways to run and configure the integration tests including from the top-level `Makefile` and using `go test`.
    18  
    19  ### Configure integration tests
    20  
    21  The following parameters can be used to configure the tests:
    22  
    23  | Test parameter | Description | Makefile variable | Default value |
    24  | -------- | -------- | -------- | -------- |
    25  | kubeconfig   | path to kubeconfig   | KUBECONFIG   | ""   |
    26  | externalIp   | external IP over which to access deployments   | INTEG_K8S_EXTERNAL_IP   | localhost   |
    27  | namespace   | integration test namespace to use   | K8S_NAMESPACE   | default   |
    28  | skipteardown   | skips tearing down VMO instances and artifacts created by the tests (useful to save test run)   | INTEG_SKIP_TEARDOWN   | false  |
    29  | runid   | optional string that will be used to uniquely identify this test run   | INTEG_RUN_ID  | generated  |
    30  | phase   | optional phase to test (before|after) | none   | ""  |
    31  
    32  ### Run all integration from the top-level Makefile
    33  ```
    34  make integ-test KUBECONFIG=${KUBECONFIG} K8S_EXTERNAL_IP=${INTEG_K8S_EXTERNAL_IP}
    35  ```
    36  
    37  ### Run all integration tests using go test
    38  ```
    39  go test -v ./test/integ/ --kubeconfig=$KUBECONFIG --externalip=$INTEG_K8S_EXTERNAL_IP --namespace=default
    40  ```
    41  
    42  ### Run a specific integration tests using go test
    43  ```
    44  go test -v ./test/integ/ -run SimpleVMO --kubeconfig=$KUBECONFIG --externalip=$INTEG_K8S_EXTERNAL_IP --namespace=integ-test
    45  ```
    46  
    47  ## Developing new tests
    48  
    49  ### Re-compile the test framework and utils
    50  
    51  ```
    52  go install ./test/integ/framework/ ./test/integ/client/ ./test/integ/util/
    53  ```