Skip to content

Commit

Permalink
ci: add eu integration test flow (#461)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?

This duplicates the existing integration test setup to run against our
newer EU infrastructure.

## Short description of the changes

I created a Terraform Provider team in the EU region and configured the
testacc setup and tests in the Action to take the honeycomb api endpoint
as an env var.

## How to verify that this has the expected result

You can see the integration tests successfully ran in US and EU on this
PR.


---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
  - https://app.asana.com/0/0/1205935108176450
  • Loading branch information
brookesargent authored Apr 18, 2024
1 parent 4a47f42 commit ebf1c55
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 5 deletions.
56 changes: 54 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
- name: Build
run: go build -v .

test:
name: Test
test-us:
name: Test US
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
Expand Down Expand Up @@ -82,3 +82,55 @@ jobs:
uses: codecov/codecov-action@v4.3.0
with:
token: ${{ secrets.CODECOV_TOKEN }}

test-eu:
name: Test EU
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
env:
TERRAFORM_VERSION: "1.0.11"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache: true

- name: Setup test environment
env:
HONEYCOMB_API_ENDPOINT: https://api.eu1.honeycomb.io
HONEYCOMB_API_KEY: ${{ secrets.HONEYCOMB_API_KEY_EU }}
HONEYCOMB_DATASET: testacc
run: ./scripts/setup-testsuite-dataset

- name: Run client acceptance tests
timeout-minutes: 10
env:
HONEYCOMB_API_ENDPOINT: https://api.eu1.honeycomb.io
HONEYCOMB_API_KEY: ${{ secrets.HONEYCOMB_API_KEY_EU }}
HONEYCOMB_DATASET: testacc
run: go test -v -coverprofile=client-coverage.txt -covermode=atomic ./client/...

- uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
terraform_wrapper: false

- name: Run TF acceptance tests
timeout-minutes: 10
env:
HONEYCOMB_API_ENDPOINT: https://api.eu1.honeycomb.io
HONEYCOMB_API_KEY: ${{ secrets.HONEYCOMB_API_KEY_EU }}
HONEYCOMB_DATASET: testacc
TF_ACC: 1
TF_ACC_TERRAFORM_VERSION: ${{ env.TERRAFORM_VERSION }}
run: go test -v -coverprofile=tf-coverage.txt -covermode=atomic ./internal/... ./honeycombio/...

- name: Generate Coverage Report
uses: codecov/codecov-action@v4.3.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 3 additions & 3 deletions scripts/setup-testsuite-dataset
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# the integration testsuite requires that a dataset and particular columns already exist
# this little script handles that bit of bootstrapping in an idempotent fashion

HONEYCOMB_API="${HONEYCOMB_API:=https://api.honeycomb.io}"
COLUMNS_API="${HONEYCOMB_API}/1/columns"
DATASETS_API="${HONEYCOMB_API}/1/datasets"
HONEYCOMB_API_ENDPOINT="${HONEYCOMB_API_ENDPOINT:=https://api.honeycomb.io}"
COLUMNS_API="${HONEYCOMB_API_ENDPOINT}/1/columns"
DATASETS_API="${HONEYCOMB_API_ENDPOINT}/1/datasets"

# a map of required columns for the integration tests and their types
declare -A REQUIRED_COLUMNS=(
Expand Down

0 comments on commit ebf1c55

Please sign in to comment.