Skip to content

Commit c65b20a

Browse files
committed
Revert "adding prefix for tests to mark them for deletion"
This reverts commit 544a083.
1 parent 544a083 commit c65b20a

File tree

3 files changed

+5
-22
lines changed

3 files changed

+5
-22
lines changed

internal/acctest/acctest.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ import (
1818
"github.com/ory/terraform-provider-orynetwork/internal/provider"
1919
)
2020

21-
// Projects with names starting with this prefix are automatically purged by the e2e cleanup job.
22-
// DO NOT CHANGE THIS PREFIX - it must match the pattern in cloud/backoffice/backoffice/x/patterns.go
23-
const TestProjectNamePrefix = "ory-cy-e2e-da2f162d-af61-42dd-90dc-e3fcfa7c84a0"
24-
2521
// TestProject holds information about a test project created for acceptance tests.
2622
type TestProject struct {
2723
ID string
@@ -156,7 +152,7 @@ func createSharedProject(t *testing.T) {
156152
return
157153
}
158154

159-
projectName := fmt.Sprintf("%s-tf-%d", TestProjectNamePrefix, time.Now().UnixNano())
155+
projectName := fmt.Sprintf("tf-acc-test-%d", time.Now().UnixNano())
160156
t.Logf("Creating test project: %s (environment: prod)", projectName)
161157

162158
// Create as "prod" environment to support all features including organizations

internal/resources/project/resource_test.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
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.
3029
func 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.
5856
func 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-
8072
func testAccProjectResourceConfig(name, environment string) string {
8173
return fmt.Sprintf(`
8274
provider "ory" {}

scripts/run-acceptance-tests.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,7 @@ parse_curl_response() {
5454
# Configuration
5555
CONSOLE_API_URL="${ORY_CONSOLE_API_URL:-https://api.console.ory.sh}"
5656
PROJECT_API_URL="${ORY_PROJECT_API_URL:-https://%s.projects.oryapis.com}"
57-
58-
# Magic prefix that triggers hard deletion in the Ory Cloud backend.
59-
# Projects with names starting with this prefix are automatically purged by the e2e cleanup job.
60-
# DO NOT CHANGE THIS PREFIX - it must match the pattern in cloud/backoffice/backoffice/x/patterns.go
61-
PROJECT_NAME_PREFIX="ory-cy-e2e-da2f162d-af61-42dd-90dc-e3fcfa7c84a0"
62-
PROJECT_NAME="${PROJECT_NAME_PREFIX}-tf-$(date +%s)"
57+
PROJECT_NAME="tf-acc-test-$(date +%s)"
6358

6459
# Validate required environment variables
6560
if [[ -z "${ORY_WORKSPACE_API_KEY:-}" ]]; then

0 commit comments

Comments
 (0)