Skip to content

Commit

Permalink
Fix HCPVS Helm integration tests (#363)
Browse files Browse the repository at this point in the history
Ensure that the HCPVS Helm integration tests run correctly during the
release.
  • Loading branch information
benashz authored Sep 19, 2023
1 parent aaf66df commit 3aae9b8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 2 additions & 0 deletions test/integration/hcpvaultsecretsapp/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ module "vso-helm" {
enable_default_auth_method = false
enable_default_connection = false
operator_helm_chart_path = var.operator_helm_chart_path
operator_image_repo = var.operator_image_repo
operator_image_tag = var.operator_image_tag
}
8 changes: 8 additions & 0 deletions test/integration/hcpvaultsecretsapp/terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ variable "deploy_operator_via_helm" {
variable "operator_helm_chart_path" {
default = "../../../chart"
}

variable "operator_image_repo" {
default = "hashicorp/vault-secrets-operator"
}

variable "operator_image_tag" {
default = "0.0.0-dev"
}
16 changes: 12 additions & 4 deletions test/integration/hcpvaultsecretsapp_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ func TestHCPVaultSecretsApp(t *testing.T) {
ContextName: k8sConfigContext,
Namespace: operatorNS,
}
kustomizeConfigPath := filepath.Join(kustomizeConfigRoot, "default")
if !testWithHelm {
deployOperatorWithKustomize(t, k8sOpts, kustomizeConfigPath)
}

// Construct the terraform options with default retryable errors to handle the most common
// retryable errors in terraform testing.
Expand All @@ -131,6 +127,18 @@ func TestHCPVaultSecretsApp(t *testing.T) {
},
}

kustomizeConfigPath := filepath.Join(kustomizeConfigRoot, "default")
if !testWithHelm {
deployOperatorWithKustomize(t, k8sOpts, kustomizeConfigPath)
} else {
if operatorImageRepo != "" {
tfOptions.Vars["operator_image_repo"] = operatorImageRepo
}
if operatorImageTag != "" {
tfOptions.Vars["operator_image_tag"] = operatorImageTag
}
}

tfOptions = setCommonTFOptions(t, tfOptions)

skipCleanup := os.Getenv("SKIP_CLEANUP") != ""
Expand Down

0 comments on commit 3aae9b8

Please sign in to comment.