Skip to content

Commit

Permalink
vcr smoke test make target and gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
monde committed Jul 28, 2023
1 parent ef72dfc commit 624f1ef
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/vcr_smoketest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# play specific VCR smoke tests in a GH action
name: VCR Smoketest

on:
workflow_dispatch:
smokeTests:
description: 'List of ACC Test name(s) separated by whitespace'
required: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.20"

- name: Run VCR smoke tests
run: make smoke-test-play-vcr-acc
env: SMOKE_TESTS: ${{ inputs.smokeTests }}
14 changes: 14 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ ifdef TEST_FILTER
TEST_FILTER := -run $(TEST_FILTER)
endif

DEFAULT_SMOKE_TESTS?=\
TestAccDataSourceOktaUser_read \
TestAccResourceOktaUserSchema_crud

ifeq ($(strip $(SMOKE_TESTS)),)
SMOKE_TESTS = $(DEFAULT_SMOKE_TESTS)
endif

space := $(subst ,, )
smoke_tests := $(subst $(space),\|,$(SMOKE_TESTS))

default: build

dep: # Download required dependencies
Expand Down Expand Up @@ -44,6 +55,9 @@ testacc:
test-play-vcr-acc:
OKTA_VCR_TF_ACC=play TF_ACC=1 go test $(TEST) -v $(TESTARGS) $(TEST_FILTER) -timeout 120m

smoke-test-play-vcr-acc:
OKTA_VCR_TF_ACC=play TF_ACC=1 go test -tags unit -mod=readonly -test.v -run ^$(smoke_tests)$$ ./okta

test-record-vcr-acc:
OKTA_VCR_TF_ACC=record TF_ACC=1 go test $(TEST) -v $(TESTARGS) $(TEST_FILTER) -timeout 120m

Expand Down

0 comments on commit 624f1ef

Please sign in to comment.