Skip to content

Commit

Permalink
test: Continuous test case failure fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Vipin Kumar authored and Vipin Kumar committed Jan 6, 2025
1 parent 07b33ed commit 8a6214f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/other_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestRunCompleteExample(t *testing.T) {
if err1 != nil {
log.Fatalf("Error getting current working directory: %v", err1)
}
sigDirectory = cwd + "/keys"
sigDirectory := cwd + "/keys"

admins, err := CreateSigKeys(usernames, sigDirectory)
if !assert.Nilf(t, err, "Error creating sigkeys: %v", err) {
Expand Down
13 changes: 6 additions & 7 deletions tests/pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
// Use existing resource group
// const resourceGroup = "geretain-test-resources"

var sigDirectory string

// Note: if this is needed again in another module move the code to github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper

// CreateSigKeys generates signature keys for the provided usernames and stores them in the specified output directory.
Expand Down Expand Up @@ -87,11 +85,6 @@ func CreateSigKeys(usernames []string, outputDir string) (string, error) {
}

func TestMain(m *testing.M) {
cwd, err := os.Getwd()
if err != nil {
log.Fatalf("Error getting current working directory: %v", err)
}
sigDirectory = cwd + "/sigs"

os.Exit(m.Run())
}
Expand All @@ -116,6 +109,12 @@ func TestRunUpgradeExample(t *testing.T) {

usernames := []string{"admin1"}

cwd, err := os.Getwd()
if err != nil {
log.Fatalf("Error getting current working directory: %v", err)
}
sigDirectory := cwd + "/sigs"

admins, err := CreateSigKeys(usernames, sigDirectory)
if !assert.Nilf(t, err, "Error creating sigkeys: %v", err) {
log.Fatalf("Error creating sigkeys: %v", err)
Expand Down

0 comments on commit 8a6214f

Please sign in to comment.