Skip to content

Commit 22f65fe

Browse files
committed
Added support for DEBUG_TEST_STEPS_SHOW_CONFIG_ONLY flag into acceptance test
1 parent e1386a3 commit 22f65fe

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

internal/acctest/test_helpers.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ func GenericTestStepPreConfiguration(steps []resource.TestStep, stepNumber int,
495495
log.Println()
496496
log.Printf("====================== Executing Test Step %d ===================", stepNumber)
497497
log.Println()
498-
if strings.ToLower(utils.GetEnvSettingWithBlankDefault(globalvar.DebugTestSteps)) == "true" {
498+
if strings.ToLower(utils.GetEnvSettingWithBlankDefault(globalvar.DebugTestSteps)) == "true" || strings.ToLower(utils.GetEnvSettingWithBlankDefault(globalvar.DebugTestStepsShowConfigOnly)) == "true" {
499499
if err := WriteToFileWithStepNumber(steps[stepNumber].Config, stepNumber, t); err != nil {
500500
log.Printf("Failed to write TF content to file with error: %q", err)
501501
}
@@ -604,6 +604,12 @@ func ResourceTest(t *testing.T, checkDestroyFunc resource.TestCheckFunc, steps [
604604
for index, _ := range steps {
605605
if steps[index].PreConfig == nil {
606606
steps[index].PreConfig = GenericTestStepPreConfiguration(steps, index, t)
607+
steps[index].SkipFunc = func() (bool, error) {
608+
if strings.ToLower(utils.GetEnvSettingWithBlankDefault(globalvar.DebugTestStepsShowConfigOnly)) == "true" {
609+
return true, nil
610+
}
611+
return false, nil
612+
}
607613
}
608614
}
609615

internal/globalvar/constants.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ const (
7878
OciEnvPrefix = "OCI_"
7979
)
8080
const (
81-
DebugTestSteps = "DEBUG_TEST_STEPS"
81+
DebugTestSteps = "DEBUG_TEST_STEPS"
82+
DebugTestStepsShowConfigOnly = "DEBUG_TEST_STEPS_SHOW_CONFIG_ONLY"
8283
)
8384
const TerraformDocumentLink = "https://registry.terraform.io/providers/oracle/oci/latest/docs/"

0 commit comments

Comments
 (0)