diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f65d435fc..7fca1ad48 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,24 @@ 2. Clone this repo: `git clone git@github.com:auth0/auth0-cli` 3. `make test` - ensure everything works correctly. Should see things pass. +### Adjusting your Development Environment (Optional) + +To pass the integration tests, you must have the `AUTH0_CLI_CLIENT_DOMAIN`, `AUTH0_CLI_CLIENT_ID` and `AUTH0_CLI_CLIENT_SECRET` environment variable set. To get these values, you can: + +1. Install [jq](https://jqlang.github.io/jq/) +2. [Setup a Machine-to-Machine application](https://auth0.com/docs/get-started/auth0-overview/create-applications/machine-to-machine-apps) +3. Use the resulting **Client Secret** values + +#### Using the Bash or Zsh shell + +You can set these variables in your `~/.bashrc` or `~/.zshrc` (replace the values with your own): + +```shell +export AUTH0_CLI_CLIENT_DOMAIN="yourappdomain" +export AUTH0_CLI_CLIENT_ID="yourclientid" +export AUTH0_CLI_CLIENT_SECRET="yourcedentialsecret" +``` + ## Build and run on native platform From the top-level directory: diff --git a/Makefile b/Makefile index 469d52bc5..dc3bdbb15 100644 --- a/Makefile +++ b/Makefile @@ -164,10 +164,14 @@ test-unit: ## Run unit tests ${call print, "Running unit tests"} @go test -v -race ${GO_PACKAGES} -coverprofile="coverage-unit-tests.out" -test-integration: install-with-cover $(GO_BIN)/commander ## Run integration tests. To run a specific test pass the FILTER var. Usage: `make test-integration FILTER="attack protection"` +test-integration: install-with-cover $(GO_BIN)/auth0 $(GO_BIN)/commander ## Run integration tests. To run a specific test pass the FILTER var. Usage: `make test-integration FILTER="attack protection"` ${call print, "Running integration tests"} @mkdir -p "coverage" - @GOCOVERDIR=coverage bash ./test/integration/scripts/run-test-suites.sh + @AUTH0_CLI_CLIENT_DOMAIN=$$AUTH0_CLI_CLIENT_DOMAIN \ + AUTH0_CLI_CLIENT_ID=$$AUTH0_CLI_CLIENT_ID \ + AUTH0_CLI_CLIENT_SECRET=$$AUTH0_CLI_CLIENT_SECRET \ + PATH=$$PATH:$(GO_BIN) \ + GOCOVERDIR=coverage bash ./test/integration/scripts/run-test-suites.sh @go tool covdata textfmt -i "coverage" -o "coverage-integration-tests.out" test-mocks: $(GO_BIN)/mockgen ## Generate testing mocks using mockgen