Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
kmoe committed Feb 2, 2021
1 parent b28db8c commit b0a6aad
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 26 deletions.
49 changes: 25 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,48 @@ on:
- 'CHANGELOG.md'
- 'website/*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
# build:
# name: Build
# runs-on: ubuntu-latest
# timeout-minutes: 5
# steps:

- name: Set up Go
uses: actions/[email protected]
with:
go-version: '1.15'
id: go
# - name: Set up Go
# uses: actions/[email protected]
# with:
# go-version: '1.15'
# id: go

- name: Check out code into the Go module directory
uses: actions/[email protected]
# - name: Check out code into the Go module directory
# uses: actions/[email protected]

- name: Go fmt
run: |
make fmt
# - name: Go fmt
# run: |
# make fmt

- name: Go vet
run: |
make vet
# - name: Go vet
# run: |
# make vet

- name: Build
run: |
go build -v .
# - name: Build
# run: |
# go build -v .


# run acceptance tests in a matrix with Terraform core versions
test:
name: Matrix Test
needs: build
# needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
terraform:
- '0.12.30'
- '0.13.6'
- '0.14.5'
# - '0.13.6'
# - '0.14.5'

steps:

- name: Set up Go
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/acceptance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ docker run -d -p "$DNS_UPDATE_PORT:53/udp" \
-e BIND_DOMAIN_REVERSE=${DNS_DOMAIN_REVERSE} \
-e BIND_INSECURE=true \
--name "$DOCKER_CONTAINER_NAME" drebes/bind || failed
GO111MODULE=on GOFLAGS=-mod=vendor make testacc TEST=./internal/provider || failed
GO111MODULE=on GOFLAGS=-mod=vendor TESTARGS=-run=TestAccDnsSRV make testacc TEST=./internal/provider || failed
cleanup_docker

# Run with authentication
Expand All @@ -43,5 +43,5 @@ docker run -d -p "$DNS_UPDATE_PORT:53/udp" \
-e BIND_KEY_ALGORITHM=${DNS_UPDATE_KEYALGORITHM} \
-e BIND_KEY_SECRET=${DNS_UPDATE_KEYSECRET} \
--name "$DOCKER_CONTAINER_NAME" drebes/bind || failed
GO111MODULE=on GOFLAGS=-mod=vendor make testacc TEST=./internal/provider || failed
GO111MODULE=on GOFLAGS=-mod=vendor TESTARGS=-run=TestAccDnsSRV make testacc TEST=./internal/provider || failed
cleanup_docker
7 changes: 7 additions & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,9 @@ func resourceDnsRead(d *schema.ResourceData, meta interface{}, rrType uint16) ([
msg := new(dns.Msg)
msg.SetQuestion(fqdn, rrType)

fmt.Println("EXCHANGING DNS MESSAGE:")
fmt.Println(msg)

r, err := exchange(msg, true, meta)
if err != nil {
return nil, fmt.Errorf("Error querying DNS record: %s", err)
Expand All @@ -490,6 +493,10 @@ func resourceDnsRead(d *schema.ResourceData, meta interface{}, rrType uint16) ([
if rrType == dns.TypeNS {
return r.Ns, nil
}

fmt.Println("RECEIVED RESPONSE:")
fmt.Println(r)

return r.Answer, nil
} else {
return nil, fmt.Errorf("update server is not set")
Expand Down

0 comments on commit b0a6aad

Please sign in to comment.