From 62c774c5174e409507b2f19c86ddc17e529c277f Mon Sep 17 00:00:00 2001 From: Nancy Hong Date: Wed, 11 Sep 2024 09:19:26 -0700 Subject: [PATCH] docs: add steps for testing the connector --- .envrc.example | 8 ++++++++ CONTRIBUTING.md | 15 +++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .envrc.example diff --git a/.envrc.example b/.envrc.example new file mode 100644 index 00000000..1ff1f0a5 --- /dev/null +++ b/.envrc.example @@ -0,0 +1,8 @@ +export ALLOYDB_DB="some-db" +export ALLOYDB_USER="some-user" +export ALLOYDB_PASS="some-password" +export ALLOYDB_INSTANCE_NAME="projects//locations//clusters//instances/" +export ALLOYDB_INSTANCE_IP="some-IP-address" +export ALLOYDB_IAM_USER="some-user@my-project.iam" +export ALLOYDB_IMPERSONATED_USER="some-impersonated-IAM-user" +export ALLOYDB_PSC_INSTANCE_URI="projects//locations//clusters//instances/" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6272489d..7164fe1e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,3 +26,18 @@ information on using pull requests. This project follows [Google's Open Source Community Guidelines](https://opensource.google/conduct/). + +## Testing + +NOTE: Be sure to run the following commands in the same VPC as the AlloyDB instance + +1. Setup local environment to work with virtualenv and nox if you haven't already, e.g. +``` +python3 -m venv venv +source ./venv/bin/activate +pip install nox +``` +1. Set the environment variables. You can see an example of the environment variables needed by running `cat .envrc.example` +1. Run `gcloud auth application-default login` +1. Command to run the unit tests: `nox -s unit-` +1. Command to run the integration tests: `nox -s system-`