From bf9007fde4352b387ade3932026605e01336100d Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Fri, 9 Mar 2018 06:53:25 -0500 Subject: [PATCH] add example and tips --- integrationTest/readme.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/integrationTest/readme.md b/integrationTest/readme.md index 0e83c7fca..dd91ccec9 100644 --- a/integrationTest/readme.md +++ b/integrationTest/readme.md @@ -13,4 +13,29 @@ For each step, it will run the config once and expect changes. It will run it ag ## Running a test 1. Define all environment variables expected for the provider you wish to run. I setup a local `.env` file with the appropriate values and use [zoo](https://github.com/jsonmaur/zoo) to run my commands. -2. run `go test -v -provider $NAME` where $NAME is the name of the provider you wish to run. \ No newline at end of file +2. run `go test -v -provider $NAME` where $NAME is the name of the provider you wish to run. + +Example: + +``` +$ egrep R53 providers.json + "KeyId": "$R53_KEY_ID", + "SecretKey": "$R53_KEY", + "domain": "$R53_DOMAIN" +$ export R53_KEY_ID="redacted" +$ export R53_KEY="also redacted" +$ export R53_DOMAIN="testdomain.tld" +$ go test -v -verbose -provider ROUTE53 +``` + +WARNING: The records in the test domain will be deleted. Only use +a domain that is not used in production. Some providers have a way +to run tests on domains that aren't registered (often a test +environment or a side-effect of the company not being a registrar). +In other cases we use a domain we squat on, or we register a domain +called `dnscontrol-$provider.com` just for testing. + +ProTip: If you run these tests frequently (and we hope you do), you +should create a script that you can `source` to set these +variables. Be careful not to check this script into Git since it +contains credentials.