Skip to content

Commit

Permalink
Chore: integration tests
Browse files Browse the repository at this point in the history
 - split into their own workflow
 - completely remove CircleCI
  • Loading branch information
till committed Apr 4, 2021
1 parent 6766073 commit 1c3e08d
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 117 deletions.
65 changes: 0 additions & 65 deletions .circleci/config.yml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: integration

on:
pull_request:

jobs:
snapshot:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --config ./.goreleaser.ci.yml --rm-dist --snapshot
- name: Copy .ini files
run: cp targets.ini rbls.ini ./dist/dnsbl_exporter_linux_amd64
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: dnsbl_exporter
path: dist/dnsbl_exporter_linux_amd64

integration:
runs-on: ubuntu-latest
needs:
- snapshot
services:
unbound:
image: klutchell/unbound:latest
ports:
- 5053:5053
- 5053:5053/udp
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: dnsbl_exporter
- name: Allow running exporter
run: chmod +x ./dnsbl-exporter
- name: Start dnsbl_exporter
run: ./dnsbl-exporter --config.dns-resolver=unbound:5053 &
- name: Test "/" exists
run: curl -I http://127.0.0.1:9211/
- name: Test "/metrics" exists
run: curl -I http://127.0.0.1:9211/metrics
- name: Test "/metrics" with targets
run: curl -i http://127.0.0.1:9211/metrics
52 changes: 0 additions & 52 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,55 +19,3 @@ jobs:
uses: actions/checkout@v2
- name: Test
run: go test ./...

snapshot:
runs-on: ubuntu-latest
needs:
- test
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --config ./.goreleaser.ci.yml --rm-dist --snapshot
- name: Copy .ini files
run: cp targets.ini rbls.ini ./dist/dnsbl_exporter_linux_amd64
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: dnsbl_exporter
path: dist/dnsbl_exporter_linux_amd64

integration:
runs-on: ubuntu-latest
needs:
- snapshot
services:
unbound:
image: klutchell/unbound:latest
ports:
- 5053:5053
- 5053:5053/udp
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: dnsbl_exporter
- name: Allow running exporter
run: chmod +x ./dnsbl-exporter
- name: Start dnsbl_exporter
run: ./dnsbl-exporter --config.dns-resolver=unbound:5053 &
- name: Test "/" exists
run: curl -I http://127.0.0.1:9211/
- name: Test "/metrics" exists
run: curl -I http://127.0.0.1:9211/metrics
- name: Test "/metrics" with targets
run: curl -i http://127.0.0.1:9211/metrics

0 comments on commit 1c3e08d

Please sign in to comment.