mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-09-07 13:44:18 +08:00
CHORE: Rename -provider
to -profile
within the documentation.
This commit is contained in:
parent
1742e65f39
commit
533c7e0946
8 changed files with 22 additions and 22 deletions
|
@ -253,7 +253,7 @@ To run the integration test with the BIND provider:
|
|||
|
||||
```shell
|
||||
cd integrationTest # NOTE: Not needed if already in that subdirectory
|
||||
go test -v -verbose -provider BIND
|
||||
go test -v -verbose -profile BIND
|
||||
```
|
||||
|
||||
Once the code works for BIND, consider submitting a PR at this point.
|
||||
|
@ -276,7 +276,7 @@ export R53_DOMAIN=dnscontroltest-r53.com # Use a test domain.
|
|||
export R53_KEY_ID=CHANGE_TO_THE_ID
|
||||
export R53_KEY='CHANGE_TO_THE_KEY'
|
||||
cd integrationTest # NOTE: Not needed if already in that subdirectory
|
||||
go test -v -verbose -provider ROUTE53
|
||||
go test -v -verbose -profile ROUTE53
|
||||
```
|
||||
|
||||
The test should reveal any bugs. Keep iterating between fixing the
|
||||
|
|
|
@ -11,5 +11,5 @@ dlv test github.com/StackExchange/dnscontrol/v4/pkg/diff2 -- -test.run Test_anal
|
|||
Debug the integration tests:
|
||||
|
||||
```shell
|
||||
dlv test github.com/StackExchange/dnscontrol/v4/integrationTest -- -test.v -test.run ^TestDNSProviders -verbose -provider NAMEDOTCOM -start 1 -end 1 -diff2
|
||||
dlv test github.com/StackExchange/dnscontrol/v4/integrationTest -- -test.v -test.run ^TestDNSProviders -verbose -profile NAMEDOTCOM -start 1 -end 1 -diff2
|
||||
```
|
||||
|
|
|
@ -14,7 +14,7 @@ For each step, it will run the config once and expect changes. It will run it ag
|
|||
|
||||
1. The integration tests need a test domain to run on. All the records of this domain will be deleted!
|
||||
2. Define all environment variables expected for the provider you wish to run.
|
||||
3. run `cd integrationTest && go test -v -provider $NAME` where $NAME is the name of the provider you wish to run.
|
||||
3. run `cd integrationTest && go test -v -profile $NAME` where $NAME is the name of the provider you wish to run.
|
||||
|
||||
Example:
|
||||
|
||||
|
@ -36,15 +36,15 @@ export ROUTE53_DOMAIN="testdomain.tld"
|
|||
|
||||
```shell
|
||||
cd integrationTest # NOTE: Not needed if already in that subdirectory
|
||||
go test -v -verbose -provider ROUTE53
|
||||
go test -v -verbose -profile ROUTE53
|
||||
```
|
||||
|
||||
The `-start` and `-end` flags allow you to run just a portion of the tests.
|
||||
|
||||
```shell
|
||||
go test -v -verbose -provider ROUTE53 -start 16
|
||||
go test -v -verbose -provider ROUTE53 -end 5
|
||||
go test -v -verbose -provider ROUTE53 -start 16 -end 20
|
||||
go test -v -verbose -profile ROUTE53 -start 16
|
||||
go test -v -verbose -profile ROUTE53 -end 5
|
||||
go test -v -verbose -profile ROUTE53 -start 16 -end 20
|
||||
```
|
||||
|
||||
The `start` and `end` flags are both inclusive (i.e. `-start 16 -end 20` will run `[16, 17, 18, 19, 20]`).
|
||||
|
@ -52,10 +52,10 @@ The `start` and `end` flags are both inclusive (i.e. `-start 16 -end 20` will ru
|
|||
For some providers it may be necessary to increase the test timeout using `-test`. The default is 10 minutes. `0` is "no limit". Typical Go durations work too (`1h` for 1 hour, etc).
|
||||
|
||||
```shell
|
||||
go test -timeout 0 -v -verbose -provider CLOUDNS
|
||||
go test -timeout 0 -v -verbose -profile CLOUDNS
|
||||
```
|
||||
|
||||
FYI: The order of the flags matters. Flags native to the Go testing suite (`-timeout` and `-v`) must come before flags that are part of the DNSControl integration tests (`-verbose`, `-provider`). Yeah, that sucks and is confusing.
|
||||
FYI: The order of the flags matters. Flags native to the Go testing suite (`-timeout` and `-v`) must come before flags that are part of the DNSControl integration tests (`-verbose`, `-profile`). Yeah, that sucks and is confusing.
|
||||
|
||||
The actual tests are in the file `integrationTest/integration_test.go`. The
|
||||
tests are in a little language which can be used to describe just about any
|
||||
|
|
|
@ -394,7 +394,7 @@ have access to read/edit Workers. This flag will eventually go away.
|
|||
|
||||
```shell
|
||||
cd integrationTest # NOTE: Not needed if already in that subdirectory
|
||||
go test -v -verbose -provider CLOUDFLAREAPI -cfworkers=false
|
||||
go test -v -verbose -profile CLOUDFLAREAPI -cfworkers=false
|
||||
```
|
||||
|
||||
When `-cfworkers=false` is set, tests related to Workers are skipped. The Account ID is not required.
|
||||
|
|
|
@ -58,7 +58,7 @@ export CNR_ENTITY=OTE
|
|||
export CNR_UID=test.user
|
||||
export CNR_PW=test.passw0rd
|
||||
cd integrationTest # NOTE: Not needed if already in that subdirectory
|
||||
go test -v -verbose -provider CNR
|
||||
go test -v -verbose -profile CNR
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
|
|
@ -62,7 +62,7 @@ export HEXONET_ENTITY=OTE
|
|||
export HEXONET_UID=test.user
|
||||
export HEXONET_PW=test.passw0rd
|
||||
cd integrationTest # NOTE: Not needed if already in that subdirectory
|
||||
go test -v -verbose -provider HEXONET
|
||||
go test -v -verbose -profile HEXONET
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
|
|
@ -28,7 +28,7 @@ as usual. The directory to be in is `/go/dnscontrol/integrationTest`.
|
|||
|
||||
```shell
|
||||
cd /go/dnscontrol/integrationTest
|
||||
go test -v -verbose -provider INSERT_PROVIDER_NAME -start 1 -end 3
|
||||
go test -v -verbose -profile INSERT_PROVIDER_NAME -start 1 -end 3
|
||||
```
|
||||
|
||||
Change `INSERT_PROVIDER_NAME` to the name of your provider (`BIND`, `ROUTE53`, `GCLOUD`, etc.)
|
||||
|
|
|
@ -173,7 +173,7 @@ For example, test BIND:
|
|||
```shell
|
||||
cd integrationTest # NOTE: Not needed if already there
|
||||
export BIND_DOMAIN='example.com'
|
||||
go test -v -verbose -provider BIND
|
||||
go test -v -verbose -profile BIND
|
||||
```
|
||||
|
||||
(BIND is a good place to start since it doesn't require API keys.)
|
||||
|
@ -185,22 +185,22 @@ export R53_DOMAIN='dnscontroltest-r53.com' # Use a test domain.
|
|||
export R53_KEY_ID='CHANGE_TO_THE_ID'
|
||||
export R53_KEY='CHANGE_TO_THE_KEY'
|
||||
cd integrationTest # NOTE: Not needed if already there
|
||||
go test -v -verbose -provider ROUTE53
|
||||
go test -v -verbose -profile ROUTE53
|
||||
```
|
||||
|
||||
Some useful `go test` flags:
|
||||
|
||||
* Run only certain tests using the `-start` and `-end` flags.
|
||||
* Rather than running all the tests, run just the tests you want.
|
||||
* These flags must be *after* the `-provider FOO` flag.
|
||||
* Example: `go test -v -verbose -provider ROUTE53 -start 10 -end 20` run tests 10-20 inclusive.
|
||||
* Example: `go test -v -verbose -provider ROUTE53 -start 5 -end 5` runs only test 5.
|
||||
* Example: `go test -v -verbose -provider ROUTE53 -start 20` skip the first 19 tests.
|
||||
* Example: `go test -v -verbose -provider ROUTE53 -end 20` only run the first 20 tests.
|
||||
* These flags must be *after* the `-profile FOO` flag.
|
||||
* Example: `go test -v -verbose -profile ROUTE53 -start 10 -end 20` run tests 10-20 inclusive.
|
||||
* Example: `go test -v -verbose -profile ROUTE53 -start 5 -end 5` runs only test 5.
|
||||
* Example: `go test -v -verbose -profile ROUTE53 -start 20` skip the first 19 tests.
|
||||
* Example: `go test -v -verbose -profile ROUTE53 -end 20` only run the first 20 tests.
|
||||
* Slow tests? Add `-timeout n` to increase the timeout for tests
|
||||
* `go test` kills the tests after 10 minutes by default. Some providers need more time.
|
||||
* This flag must be *before* the `-verbose` flag. Usually it is the first flag after `go test`.
|
||||
* Example: `go test -timeout 20m -v -verbose -provider CLOUDFLAREAPI`
|
||||
* Example: `go test -timeout 20m -v -verbose -profile CLOUDFLAREAPI`
|
||||
* If a test will always fail because the provider doesn't support the feature, you can opt out of the test. Look at `func makeTests()` in [integrationTest/integration_test.go](https://github.com/StackExchange/dnscontrol/blob/2f65533e1b92c2967229a92a304fff7c14f7f4b6/integrationTest/integration_test.go#L675) for more details.
|
||||
|
||||
## Step 8: Manual tests
|
||||
|
|
Loading…
Add table
Reference in a new issue