Skip to content

Commit

Permalink
Renaming function arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
harshitap26 committed Dec 6, 2024
1 parent 35d546f commit 3ca1972
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions test/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ const (

var grpcClient *grpc.ClientConn

func readConfigFile(configurationFile string) {
func readConfigFile(filePath string) {
/* load array config and give proper errors if not ok*/
if _, err := os.Stat(configurationFile); err == nil {
if _, err := os.ReadFile(configurationFile); err != nil {
err = fmt.Errorf("DEBUG integration pre requisites missing %s with multi array configuration file ", configurationFile)
if _, err := os.Stat(filePath); err == nil {
if _, err := os.ReadFile(filePath); err != nil {
err = fmt.Errorf("DEBUG integration pre requisites missing %s with multi array configuration file ", filePath)
panic(err)
}
f, err := os.Open(configurationFile)
f, err := os.Open(filePath)
r := bufio.NewReader(f)
mdms := make([]string, 0)
line, isPrefix, err := r.ReadLine()
Expand Down
14 changes: 7 additions & 7 deletions test/integration/step_defs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,19 @@ func (f *feature) getGoscaleioClient() (client *goscaleio.Client, err error) {
// there is no way to call service.go methods from here
// hence copy same method over there , this is used to get all arrays and pick different
// systemID to test with see method iSetAnotherSystemID
func (f *feature) getArrayConfig(configurationFile string) (map[string]*ArrayConnectionData, error) {
func (f *feature) getArrayConfig(filePath string) (map[string]*ArrayConnectionData, error) {
arrays := make(map[string]*ArrayConnectionData)

_, err := os.Stat(configurationFile)
_, err := os.Stat(filePath)
if err != nil {
if os.IsNotExist(err) {
return nil, fmt.Errorf("File %s does not exist", configurationFile)
return nil, fmt.Errorf("File %s does not exist", filePath)
}
}

config, err := os.ReadFile(filepath.Clean(configurationFile))
config, err := os.ReadFile(filepath.Clean(filePath))
if err != nil {
return nil, fmt.Errorf("File %s errors: %v", configurationFile, err)
return nil, fmt.Errorf("File %s errors: %v", filePath, err)
}

if string(config) != "" {
Expand All @@ -162,7 +162,7 @@ func (f *feature) getArrayConfig(configurationFile string) (map[string]*ArrayCon
}

if len(jsonCreds) == 0 {
return nil, fmt.Errorf("no arrays are provided in configFile %s", configurationFile)
return nil, fmt.Errorf("no arrays are provided in configFile %s", filePath)
}

noOfDefaultArray := 0
Expand Down Expand Up @@ -221,7 +221,7 @@ func (f *feature) getArrayConfig(configurationFile string) (map[string]*ArrayCon
arrays[c.SystemID] = &copyOfCred
}
} else {
return nil, fmt.Errorf("arrays details are not provided in configFile %s", configurationFile)
return nil, fmt.Errorf("arrays details are not provided in configFile %s", filePath)
}
return arrays, nil
}
Expand Down

0 comments on commit 3ca1972

Please sign in to comment.