Skip to content

Commit

Permalink
test(project): fix failing tests (#1404)
Browse files Browse the repository at this point in the history
(cherry picked from commit f64aa9b)
  • Loading branch information
Serpentiel committed Oct 26, 2023
1 parent 03251ba commit 371a796
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions internal/service/project/project_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
"testing"

"github.com/aiven/aiven-go-client"
acc "github.com/aiven/terraform-provider-aiven/internal/acctest"
"github.com/aiven/terraform-provider-aiven/internal/schemautil"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"

acc "github.com/aiven/terraform-provider-aiven/internal/acctest"
"github.com/aiven/terraform-provider-aiven/internal/schemautil"
)

func TestAccAivenProjectUser_basic(t *testing.T) {
Expand Down Expand Up @@ -79,14 +80,19 @@ func testAccCheckAivenProjectUserResourceDestroy(s *terraform.State) error {

func testAccProjectUserResource(name string) string {
return fmt.Sprintf(`
resource "aiven_account" "foo" {
name = "test-acc-ac-%[1]s"
}
resource "aiven_project" "foo" {
project = "test-acc-pr-%s"
project = "test-acc-pr-%[1]s"
default_cloud = "aws-eu-west-2"
account_id = aiven_account.foo.id
}
resource "aiven_project_user" "bar" {
project = aiven_project.foo.project
email = "ivan.savciuc+%[email protected]"
email = "ivan.savciuc+%[1][email protected]"
member_type = "admin"
}
Expand All @@ -95,19 +101,24 @@ data "aiven_project_user" "user" {
email = aiven_project_user.bar.email
depends_on = [aiven_project_user.bar]
}`, name, name)
}`, name)
}

func testAccProjectUserDeveloperResource(name string) string {
return fmt.Sprintf(`
resource "aiven_account" "foo" {
name = "test-acc-ac-%[1]s"
}
resource "aiven_project" "foo" {
project = "test-acc-pr-%s"
project = "test-acc-pr-%[1]s"
default_cloud = "aws-eu-west-2"
account_id = aiven_account.foo.id
}
resource "aiven_project_user" "bar" {
project = aiven_project.foo.project
email = "ivan.savciuc+%[email protected]"
email = "ivan.savciuc+%[1][email protected]"
member_type = "developer"
}
Expand All @@ -116,7 +127,7 @@ data "aiven_project_user" "user" {
email = aiven_project_user.bar.email
depends_on = [aiven_project_user.bar]
}`, name, name)
}`, name)
}

func testAccCheckAivenProjectUserAttributes(n string) resource.TestCheckFunc {
Expand Down

0 comments on commit 371a796

Please sign in to comment.