Skip to content

Commit

Permalink
Add the ability to execute tests in parallel (hashicorp#2207)
Browse files Browse the repository at this point in the history
  • Loading branch information
arybolovlev authored Jul 31, 2023
1 parent 9a15d95 commit e3289bd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/acceptance_tests_kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ on:
terraformVersion:
description: Terraform version
default: 1.5.3
parallelRuns:
description: The maximum number of tests to run simultaneously
default: 8
schedule:
- cron: '0 21 * * *'

env:
KUBECONFIG: ${{ github.workspace }}/.kube/config
KIND_VERSION: ${{ github.event.inputs.kind_version || vars.KIND_VERSION }}
TERRAFORM_VERSION: ${{ github.event.inputs.terraformVersion || vars.TERRAFORM_VERSION }}
PARALLEL_RUNS: ${{ github.event.inputs.parallelRuns || vars.PARALLEL_RUNS }}

jobs:
acceptance_tests:
Expand Down Expand Up @@ -47,6 +51,3 @@ jobs:
TESTARGS: -run '${{ github.event.inputs.runTests }}'
run: |
make testacc
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ website/vendor
!command/test-fixtures/**/.terraform/

# output binary
terraform-provider-kubernetes
terraform-provider-kubernetes
__debug_bin
5 changes: 4 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ endif
LAST_RELEASE?=$$(git describe --tags $$(git rev-list --tags --max-count=1))
THIS_RELEASE?=$$(git rev-parse --abbrev-ref HEAD)

# The maximum number of tests to run simultaneously.
PARALLEL_RUNS?=8

default: build

all: build depscheck fmtcheck test testacc test-compile tests-lint tests-lint-fix tools vet website-lint website-lint-fix
Expand Down Expand Up @@ -78,7 +81,7 @@ test: fmtcheck
go test ./tools

testacc: fmtcheck vet
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 3h
TF_ACC=1 go test $(TEST) -v -vet=off $(TESTARGS) -parallel $(PARALLEL_RUNS) -timeout 3h

test-compile:
@if [ "$(TEST)" = "./..." ]; then \
Expand Down
Binary file removed __debug_bin
Binary file not shown.

0 comments on commit e3289bd

Please sign in to comment.