diff --git a/openai/finetune_resource_test.go b/openai/finetune_resource_test.go index 403daa9..76bb654 100644 --- a/openai/finetune_resource_test.go +++ b/openai/finetune_resource_test.go @@ -10,7 +10,7 @@ import ( func TestAccFineTuneResource(t *testing.T) { t.Skip("Cost associated with test") resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOpenAI(t); testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ // Create and Read testing diff --git a/openai/provider_test.go b/openai/provider_test.go index fc50227..f27ac6e 100644 --- a/openai/provider_test.go +++ b/openai/provider_test.go @@ -1,6 +1,7 @@ package openai import ( + "os" "testing" "github.com/hashicorp/terraform-plugin-framework/providerserver" @@ -20,3 +21,10 @@ func testAccPreCheck(t *testing.T) { // about the appropriate environment variables being set are common to see in a pre-check // function. } + +func testAccOpenAI(t *testing.T) { + // Use this to skip tests that might take a long time or cost too much + if os.Getenv("TF_ACC_OPENAI") != "" { + t.Skipf("env var TF_ACC_OPENAI not set. Skipping acceptance test") + } +}