Skip to content

Commit

Permalink
Integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
mcpherrinm committed Nov 16, 2023
1 parent 2374e56 commit 3ac3d2b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: integration

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
integration:
runs-on: [ubuntu-latest]
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "1.21.x"
- name: checkout
uses: actions/checkout@v4
- name: Start containers
run: docker compose up --build --detach
- name: run integration test
run: go test --tags=integration
- name: Stop containers
if: always()
run: docker compose down
17 changes: 17 additions & 0 deletions integration_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//go:build integration

package main

// TestIntegration checks that unbound_exporter is running, successfully
// scraping and exporting metrics.
//
// It assumes unbound_exporter is available on localhost:9167, and Unbound on
// localhost:1053, as is set up in the docker-compose.yml file.
//
// A typical invocation of this test would look like
// docker compose up --build -d
// go test --tags=integration
// docker compose down
func TestIntegration(t *testing.T) {

Check failure on line 15 in integration_test.go

View workflow job for this annotation

GitHub Actions / integration

undefined: testing
// TODO
}

0 comments on commit 3ac3d2b

Please sign in to comment.