66 "fmt"
77 "os"
88 "testing"
9- "time"
109
1110 "github.com/hashicorp/terraform-plugin-testing/helper/resource"
1211
@@ -28,17 +27,16 @@ func testAccPreCheck(t *testing.T) {
2827// WARNING: This test creates and deletes a real Ory project.
2928// Only run this test if you have quota available and understand the implications.
3029func TestAccProjectResource_basic (t * testing.T ) {
31- projectName := testProjectName ("basic" )
3230 acctest .RunTest (t , resource.TestCase {
3331 PreCheck : func () { testAccPreCheck (t ) },
3432 ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories (),
3533 Steps : []resource.TestStep {
3634 // Create and Read
3735 {
38- Config : testAccProjectResourceConfig (projectName , "dev" ),
36+ Config : testAccProjectResourceConfig ("tf-test-project" , "dev" ),
3937 Check : resource .ComposeAggregateTestCheckFunc (
4038 resource .TestCheckResourceAttrSet ("ory_project.test" , "id" ),
41- resource .TestCheckResourceAttr ("ory_project.test" , "name" , projectName ),
39+ resource .TestCheckResourceAttr ("ory_project.test" , "name" , "tf-test-project" ),
4240 resource .TestCheckResourceAttr ("ory_project.test" , "environment" , "dev" ),
4341 resource .TestCheckResourceAttrSet ("ory_project.test" , "slug" ),
4442 resource .TestCheckResourceAttr ("ory_project.test" , "state" , "running" ),
@@ -56,13 +54,12 @@ func TestAccProjectResource_basic(t *testing.T) {
5654
5755// TestAccProjectResource_prodEnvironment tests creating a production project.
5856func TestAccProjectResource_prodEnvironment (t * testing.T ) {
59- projectName := testProjectName ("prod" )
6057 acctest .RunTest (t , resource.TestCase {
6158 PreCheck : func () { testAccPreCheck (t ) },
6259 ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories (),
6360 Steps : []resource.TestStep {
6461 {
65- Config : testAccProjectResourceConfig (projectName , "prod" ),
62+ Config : testAccProjectResourceConfig ("tf-test-prod-project" , "prod" ),
6663 Check : resource .ComposeAggregateTestCheckFunc (
6764 resource .TestCheckResourceAttrSet ("ory_project.test" , "id" ),
6865 resource .TestCheckResourceAttr ("ory_project.test" , "environment" , "prod" ),
@@ -72,11 +69,6 @@ func TestAccProjectResource_prodEnvironment(t *testing.T) {
7269 })
7370}
7471
75- // testProjectName generates a project name with the e2e prefix for hard deletion support.
76- func testProjectName (suffix string ) string {
77- return fmt .Sprintf ("%s-tf-%s-%d" , acctest .TestProjectNamePrefix , suffix , time .Now ().UnixNano ())
78- }
79-
8072func testAccProjectResourceConfig (name , environment string ) string {
8173 return fmt .Sprintf (`
8274provider "ory" {}
0 commit comments