Skip to content

Commit

Permalink
Added environment variable null checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
johncollinson2001 committed Sep 20, 2024
1 parent 47459de commit 372c4c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/end-to-end-tests/basic_deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ func TestBasicDeployment(t *testing.T) {
terraformStateStorageAccount := os.Getenv("TF_STATE_STORAGE_ACCOUNT")
terraformStateContainer := os.Getenv("TF_STATE_STORAGE_CONTAINER")

if terraformStateResourceGroup == "" || terraformStateStorageAccount == "" || terraformStateContainer == "" {
t.Fatalf("One or more required environment variables (TF_STATE_RESOURCE_GROUP, TF_STATE_STORAGE_ACCOUNT, TF_STATE_STORAGE_CONTAINER) are not set.")
}

vaultName := random.UniqueId()
vaultLocation := "uksouth"
vaultRedundancy := "LocallyRedundant"
Expand Down
4 changes: 4 additions & 0 deletions tests/end-to-end-tests/full_deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ func TestFullDeployment(t *testing.T) {
terraformStateStorageAccount := os.Getenv("TF_STATE_STORAGE_ACCOUNT")
terraformStateContainer := os.Getenv("TF_STATE_STORAGE_CONTAINER")

if terraformStateResourceGroup == "" || terraformStateStorageAccount == "" || terraformStateContainer == "" {
t.Fatalf("One or more required environment variables (TF_STATE_RESOURCE_GROUP, TF_STATE_STORAGE_ACCOUNT, TF_STATE_STORAGE_CONTAINER) are not set.")
}

vaultName := random.UniqueId()
vaultLocation := "uksouth"
vaultRedundancy := "LocallyRedundant"
Expand Down

0 comments on commit 372c4c2

Please sign in to comment.