ARO-RP/docs/testing.md

1.4 KiB

Testing

Unit tests

To run RP unit tests:

make test-go

To run python client and az aro CLI tests:

make test-python

To run Go linting tasks (requires golanglint-ci to be installed):

make lint-go

For faster feedback, you may want to set up golanglint-ci's editor integration.

E2e tests

E2e tests can be run in CI with the /azp run e2e command in your GitHub PR.

E2e tests can also be run locally as follows:

  • Deploy or use an existing cosmos database
  • Run the RP
  • Validate the RP is running properly by hitting the /healthz route
  • Register a subscription where to run the e2e
  • Run the make test-e2e target
  • Delete the cosmos database, if applicable

These steps can be acheived using commands below. Look at the e2e helper file to understand each of the bash functions below.

# source your environment file
. ./secrets/env

# source the e2e helper file
. ./hack/e2e/run-rp-and-e2e.sh

# Deploy a new DB
deploy_e2e_db

# build the rp binary
make aro

# run the RP as background process
run_rp

# validate if the RP is ready to receive requests
validate_rp_running

# Register the sub you are using to run e2e
register_sub

# Run e2e
make test-e2e

# Stop the local RP
kill_rp

# Delete the DB
clean_e2e_db