Skip to content

Commit

Permalink
Enable acceptance tests in CI
Browse files Browse the repository at this point in the history
Switch on the simulated version of acceptance
tests in CI.
  • Loading branch information
stuart-mclaren-hpe committed Sep 2, 2024
1 parent 6187fc2 commit 475fb82
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ jobs:
- run: go version
- run: make build
- run: make build-experimental
- run: make test
22 changes: 22 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2024 Hewlett Packard Enterprise Development LP
name: Test

on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
go: [ '1.22.3' ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- run: go version
- run: make test
- run: make testacc-simulation
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# Note: this Makefile works with GNUMake and BSDMake
#

build:
go build ./...

Expand All @@ -23,7 +24,10 @@ testacc:

testacc-simulation:
go install -tags experimental,simulation ./cmd/...
env TF_ACC=1 go test -v -tags simulation ./test/...
tempfile=$$(mktemp); \
sed "s@__HOME__@${HOME}@g" test/.terraformrc > $$tempfile; \
env TF_ACC=1 env TF_CLI_CONFIG_FILE=$$tempfile \
go test -v -tags simulation ./test/...

lint:
@golangci-lint --version
Expand Down
6 changes: 6 additions & 0 deletions test/.terraformrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
provider_installation {
dev_overrides {
"github.com/HewlettPackard/hpegl-pcbe-terraform-resources" = "__HOME__/go/bin"
}
}

0 comments on commit 475fb82

Please sign in to comment.