Skip to content

Commit

Permalink
helper for tests that shouldn't be vcr'd
Browse files Browse the repository at this point in the history
  • Loading branch information
monde committed Aug 4, 2023
1 parent a57f9f2 commit 1ea80e7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions okta/max_api_capacity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import (
)

func TestAccMaxApiCapacity(t *testing.T) {
if skipVCRTest(t) {
return
}

mgr := newFixtureManager(appGroupAssignments, t.Name())
config := mgr.GetFixtures("datasource.tf", t)

Expand Down
5 changes: 5 additions & 0 deletions okta/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -660,3 +660,8 @@ type vcrManager struct {
CurrentCassette string
VCRModeName string
}

func skipVCRTest(t *testing.T) bool {
t.Skipf("test %q is not VCR compatible", t.Name())
return os.Getenv("OKTA_VCR_TF_ACC") != ""
}
4 changes: 4 additions & 0 deletions okta/resource_okta_app_oauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,10 @@ resource "okta_app_oauth" "test" {
//
// https://developer.okta.com/docs/reference/api/apps/#username-template-object
func TestAccResourceOktaAppOauth_config_combinations(t *testing.T) {
if skipVCRTest(t) {
// the way this is table tested is not friendly w/ VCR
return
}
mgr := newFixtureManager(appOAuth, t.Name())

cases := []struct {
Expand Down
3 changes: 3 additions & 0 deletions okta/resource_okta_group_custom_schema_property_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,9 @@ func TestAccResourceOktaGroupSchema_enum_string(t *testing.T) {
// backoff in create and update for okta_group_schema_property resource is
// operating correctly.
func TestAccResourceOktaGroupSchema_parallel_api_calls(t *testing.T) {
if skipVCRTest(t) {
return
}
mgr := newFixtureManager(groupSchemaProperty, t.Name())
config := `
resource "okta_group_schema_property" "one" {
Expand Down
3 changes: 3 additions & 0 deletions okta/resource_okta_user_custom_schema_property_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,9 @@ func testUserSchemaPropertyExists(schemaUserType, index, resolutionScope string)
// backoff in create and update for okta_ser_schema_property resource is
// operating correctly.
func TestAccResourceOktaUserSchema_parallel_api_calls(t *testing.T) {
if skipVCRTest(t) {
return
}
mgr := newFixtureManager(userSchemaProperty, t.Name())
config := `
resource "okta_user_schema_property" "one" {
Expand Down

0 comments on commit 1ea80e7

Please sign in to comment.