Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/test a branch feedback #10

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions documentation/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
* [Writing new DNS providers](writing-providers.md)
* [Creating new DNS Resource Types (rtypes)](adding-new-rtypes.md)
* [Integration Tests](integration-tests.md)
* [Test a branch](test-a-branch.md)
* [Unit Testing DNS Data](unittests.md)
* [Bug Triage Process](bug-triage.md)
* [Bring-Your-Own-Secrets for automated testing](byo-secrets.md)
Expand Down
66 changes: 66 additions & 0 deletions documentation/test-a-branch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
### Test A Branch

Instructions for testing DNSControl at a particular PR or branch.

Assumptions:
* `/THE/PATH` -- Change this to the full path to where your dnsconfig.js and other files are located.
* `INSERT_BRANCH_HERE` -- The branch you want to test. The branch associated with a PR is listed on [https://github.com/StackExchange/dnscontrol/branches](https://github.com/StackExchange/dnscontrol/branches).

## Using Docker

Using Docker assures you're using the latest version of Go and doesn't require you to install anything on your machine, other than Docker!

```shell
docker run -it -v /THE/PATH:/dns golang
git clone -b INSERT_BRANCH_HERE --single-branch https://github.com/StackExchange/dnscontrol.git
cd dnscontrol
go install
```

```shell
cd /dns
dnscontrol preview
```

If you want to run the integration tests, follow the
[Integration Tests](integration-tests.md) document
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
```

Change `INSERT_PROVIDER_NAME` to the name of your provider (`BIND`, `ROUTE53`, `GCLOUD`, etc.)

## Not using Docker

Step 1: Install Go

[https://go.dev/dl/](https://go.dev/dl/)

Step 2: Check out the software

```shell
git clone -b INSERT_BRANCH_HERE --single-branch https://github.com/StackExchange/dnscontrol.git
cd dnscontrol
go install
```

```shell
cd /THE/PATH
dnscontrol preview
```

Step 3: Clean up

`go install` put the `dnscontrol` program in your `$HOME/bin` directory. You probably want to remove it.

```shell
rm -i $HOME/bin/dnscontrol
```

## Other useful docs

* How to run the integrations tests:
* [https://docs.dnscontrol.org/developer-info/integration-tests](https://docs.dnscontrol.org/developer-info/integration-tests)
Loading