github.com/cloudfoundry/cli@v7.1.0+incompatible/integration/README.md (about) 1 # CLI Integration Tests 2 3 ## Introduction 4 5 These are high-level tests for the CLI that make assertions about the behavior of the `cf` binary. 6 7 On most systems `cf` points to an installed version. To test the latest source (most likely source that you're changing), ensure the dev `cf` binary is in your `PATH`: 8 9 ``` 10 [[ `which cf` = *"$GOPATH/src/code.cloudfoundry.org/cli/out"* ]] || 11 export PATH="$GOPATH/src/code.cloudfoundry.org/cli/out:$PATH" 12 ``` 13 14 You'll also need to rebuild `cf` after making any relevant changes to the source: 15 16 ``` 17 make build 18 ``` 19 20 Running `make integration-tests` can be time-consuming, because it includes the unparallelized `global` suite. Best to constrain runs to relevant tests until a long break in your workday, when you can run `make integration-tests` and cover everything. If you're primarily working in code that is tested by the parallelized suites, running the rake tasks for those specific suites instead of `integration-tests` and setting the `NODES` environment variable to a higher value will improve your feedback cycle. 21 22 ## Explanation of test suites 23 - `global` suite is for tests that affect an entire CF instance. *These tests do not run in parallel.* 24 - `isolated` suite is for tests that are stand alone and do not affect each other. They are meant to run in their own organization and space, and will not affect system state. This is the most common type of integration tests. 25 - `push` suite is for tests related to the `cf push` command only. 26 - `experimental` suite is for tests that require the cf experimental flag to be set and/or an experimental feature for the CF CLI. 27 - `plugin` suite is for tests that surround the CF CLI plugin framework. *These tests do not run in parallel.* 28 29 ## How to run 30 These tests rely on [ginkgo](https://github.com/onsi/ginkgo) to be installed. 31 32 Run command for the `isolated`, `push` and `experimental` suite: 33 ``` 34 ginkgo -p -r -randomizeAllSpecs -slowSpecThreshold=120 integration/shared/isolated integration/v6/push integration/shared/experimental 35 ``` 36 37 Run command for the `global` and `plugin` suites: 38 ``` 39 ginkgo -r -randomizeAllSpecs -slowSpecThreshold=120 integration/shared/global integration/shared/plugin 40 ``` 41 42 ### Customizations (based on environment variables) 43 44 - `CF_INT_API` - Sets the CF API URL these tests will be using. Will default to `api.bosh-lite.com` if not set. 45 - `SKIP_SSL_VALIDATION` - If true, will skip SSL Validation. Will default to `--skip-ssl-validation` if not set. 46 - `CF_INT_USERNAME` - The CF Administrator username. Will default to `admin` if not set. 47 - `CF_INT_PASSWORD` - The CF Administrator password. Will default to `admin` if not set. 48 - `CF_INT_CLIENT_ID` - The ID for the integration client credentials identity. 49 - `CF_INT_CLIENT_SECRET` - The secret for the integration client credentials identity. 50 - `CF_INT_CLIENT_CREDENTIALS_TEST_MODE` - If `true` all tests capable of being run under a client will authenticate with client credentials. 51 - `CF_INT_CUSTOM_CLIENT_ID` - The ID for a custom client used in place of the standard `cf` client. 52 - `CF_INT_CUSTOM_CLIENT_SECRET` - The secret for a custom client used in place of the standard `cf` client. 53 - `CF_INT_OIDC_USERNAME` - The admin user in the OIDC identity provider. Will default to `admin_oidc` if not set. 54 - `CF_INT_OIDC_PASSWORD` - The admin password in the OIDC identity provider. Will default to `admin` if not set. 55 - `CF_INT_DOCKER_IMAGE` - A private docker image used for the docker authentication tests. 56 - `CF_INT_DOCKER_USERNAME` - The username for the private docker registry for `CF_INT_DOCKER_IMAGE`. 57 - `CF_INT_DOCKER_PASSWORD` - The password for `CF_INT_DOCKER_USERNAME`. 58 - `CF_INT_IGNORE_API_VERSION_CHECK` - If `true`, will not skip tests that are dependent on a minimum version of the API. 59 - `CF_CLI_EXPERIMENTAL` - Will enable both experimental functionality of the CF CLI and tests for that functionality. Will default to `false` if not set. 60 - `KEEP_FAKE_SERVICE_BROKERS` - If `true`, will not delete any deployed reusable fake service broker apps. Useful for local development: allows for faster test suite re-runs. Will default to `false` if not set. 61 62 ### The test suite does not cleanup after itself! 63 In order to focus on clean test code and performance of each test, we have decided to not cleanup after each test. However, in order to facilitate [clean up scripts](https://github.com/cloudfoundry/cli-ci/blob/master/bin/cleanup-integration), we are trying to keep consistent naming across organizations, spaces, etc. 64 65 In addition, several router groups are created using a `INTEGRATION-TCP-NODE-[NUMBER]` format. These cannot be deleted without manual changes to the database.