Skip to content

Commit

Permalink
feat: resolved linting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilmhdh committed Nov 20, 2024
1 parent 2e1506a commit 46aa5bf
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ func TestAccProject(t *testing.T) {
projectDetail, err := infisicalApiClient.GetProjectById(infisicalclient.GetProjectByIdRequest{
ID: id.(string),
})
if err != nil {
return err
}

slug, err := tfjsonpath.Traverse(resource.AttributeValues, tfjsonpath.New("slug"))
if err != nil {
Expand Down Expand Up @@ -119,6 +122,10 @@ func TestAccProject(t *testing.T) {
projectDetail, err := infisicalApiClient.GetProjectById(infisicalclient.GetProjectByIdRequest{
ID: id.(string),
})
if err != nil {
return err
}

slug, err := tfjsonpath.Traverse(resource.AttributeValues, tfjsonpath.New("slug"))
if err != nil {
return err
Expand Down
6 changes: 6 additions & 0 deletions internal/testacc/project_role_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ func TestAccProjectRole(t *testing.T) {
ProjectSlug: projectSlug.(string),
RoleSlug: roleName,
})
if err != nil {
return err
}

slug, err := tfjsonpath.Traverse(resource.AttributeValues, tfjsonpath.New("slug"))
if err != nil {
Expand Down Expand Up @@ -109,6 +112,9 @@ func TestAccProjectRole(t *testing.T) {
ProjectSlug: projectSlug.(string),
RoleSlug: roleName,
})
if err != nil {
return err
}

slug, err := tfjsonpath.Traverse(resource.AttributeValues, tfjsonpath.New("slug"))
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions internal/testacc/project_user_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ func TestAccProjectUser(t *testing.T) {
ProjectID: projectId.(string),
Username: email,
})
if err != nil {
return err
}

membershipId, err := tfjsonpath.Traverse(resource.AttributeValues, tfjsonpath.New("membership_id"))
if err != nil {
Expand Down
16 changes: 8 additions & 8 deletions internal/testacc/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func init() {
if v := os.Getenv(env); v != "" {
env_values = append(env_values, v)
} else {
fmt.Errorf("%s must be set for acceptance tests", err)
log.Fatalf("%v must be set for acceptance tests", err)
}
}

Expand Down Expand Up @@ -91,7 +91,7 @@ func protoV6ProviderFactories() map[string]func() (tfprotov6.ProviderServer, err
}
}

// preCheck checks if all conditions for an acceptance test are
// preCheck checks if all conditions for an acceptance test are.
func preCheck(t *testing.T) func() {
return func() {
rootDir, err := findProjectRoot()
Expand Down Expand Up @@ -167,12 +167,12 @@ func loadEnvFile(filename string) error {
return godotenv.Load(filename)
}

func getEnv(key, fallback string) string {
if value, ok := os.LookupEnv(key); ok {
return value
}
return fallback
}
// func getEnv(key, fallback string) string {
// if value, ok := os.LookupEnv(key); ok {
// return value
// }
// return fallback
// }

func getIdentityOrgId() string {
if v := os.Getenv(IDENTITY_TEST_ORG_ID_ENV); v != "" {
Expand Down

0 comments on commit 46aa5bf

Please sign in to comment.