Skip to content

Commit

Permalink
fix: [CDS-101927]: Remove Test Project Dependency (#1109)
Browse files Browse the repository at this point in the history
* fix: [CDS-101927]: Updated Skip with Ticket

* fix: [CDS-101927]: Remove Project Dependency

* fix: [CDS-101927]: Remove Project Dependency
  • Loading branch information
ritek01 authored Nov 13, 2024
1 parent 7eb49ac commit 62aa516
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 25 deletions.
8 changes: 0 additions & 8 deletions internal/service/cd_nextgen/_PreRequisites/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ variable "TF_VAR_harness_automation_github_token" {
type = string
}

resource "harness_platform_project" "TF_Pipeline_Test" {
identifier = "TF_Pipeline_Test"
name = "TF_Pipeline_Test"
color = "#0063F7"
org_id = "default"
}

resource "harness_platform_secret_text" "TF_spot_account_id" {
identifier = "TF_spot_account_id"
name = "TF_spot_account_id"
Expand All @@ -31,7 +24,6 @@ resource "harness_platform_secret_text" "TF_spot_account_id" {
secret_manager_identifier = "harnessSecretManager"
value_type = "Inline"
value = "my_secret_value"
depends_on = [harness_platform_project.TF_Pipeline_Test]
}

resource "harness_platform_secret_text" "TF_spot_api_token" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import (
)

func TestAccDataSourceOverrides(t *testing.T) {
t.Skip("Skipping this test as it need to check if overrides are supported or not")

t.Skip("Skipping Test until https://harness.atlassian.net/browse/CDS-81394 is done")
id := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(6))
name := id
resourceName := "data.harness_platform_overrides.test"
Expand All @@ -31,8 +30,7 @@ func TestAccDataSourceOverrides(t *testing.T) {
}

func TestDataSourceRemoteOverrides(t *testing.T) {
t.Skip("Skipping this test as it need to check if overrides are supported or not")

t.Skip("Skipping Test until https://harness.atlassian.net/browse/CDS-81394 is done")
id := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(6))
name := id
resourceName := "data.harness_platform_overrides.test"
Expand Down
12 changes: 4 additions & 8 deletions internal/service/cd_nextgen/overrides/resource_overrides_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import (
)

func TestAccOverrides_ProjectScope(t *testing.T) {
t.Skip("Skipping this test as it need to check if overrides are supported or not")

t.Skip("Skipping Test until https://harness.atlassian.net/browse/CDS-81394 is done")
id := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(4))
name := id
resourceName := "harness_platform_overrides.test"
Expand Down Expand Up @@ -42,8 +41,7 @@ func TestAccOverrides_ProjectScope(t *testing.T) {
}

func TestAccOverrides_OrgScope(t *testing.T) {
t.Skip("Skipping this test as it need to check if overrides are supported or not")

t.Skip("Skipping Test until https://harness.atlassian.net/browse/CDS-81394 is done")
id := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(4))
name := id
resourceName := "harness_platform_overrides.test"
Expand All @@ -70,8 +68,7 @@ func TestAccOverrides_OrgScope(t *testing.T) {
}

func TestAccOverrides_AccountScope(t *testing.T) {
t.Skip("Skipping this test as it need to check if overrides are supported or not")

t.Skip("Skipping Test until https://harness.atlassian.net/browse/CDS-81394 is done")
id := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(4))
name := id
resourceName := "harness_platform_overrides.test"
Expand All @@ -96,8 +93,7 @@ func TestAccOverrides_AccountScope(t *testing.T) {
}

func TestAccRemoteOverrides(t *testing.T) {
t.Skip("Skipping this test as it need to check if overrides are supported or not")

t.Skip("Skipping Test until https://harness.atlassian.net/browse/CDS-81394 is done")
id := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(4))
name := id
resourceName := "harness_platform_overrides.test"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,16 @@ func testDataSourceGitXOrgLevel(webhook_identifier string, webhook_name string)

func testDataSourceGitXProjectLevel(webhook_identifier string, webhook_name string) string {
return fmt.Sprintf(`
resource "harness_platform_project" "Project_Test" {
identifier = "%[1]s_project"
name = "%[2]s_project"
color = "#0063F7"
org_id = "default"
}
resource "harness_platform_gitx_webhook" "test" {
identifier= "%[1]s"
name = "%[2]s"
project_id = "TF_Pipeline_Test"
project_id = harness_platform_project.Project_Test.identifier
org_id = "default"
repo_name = "GitXTest3"
connector_ref = "account.TF_github_account_level_connector"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,16 @@ func testGitXAccountLevel(webhook_identifier string, webhook_name string) string

func testGitXProjectProjectLevel(webhook_identifier string, webhook_name string) string {
return fmt.Sprintf(`
resource "harness_platform_project" "Project_Test" {
identifier = "%[1]s_project"
name = "%[2]s_project"
color = "#0063F7"
org_id = "default"
}
resource "harness_platform_gitx_webhook" "test" {
identifier= "%[1]s"
name = "%[2]s"
project_id = "TF_Pipeline_Test"
project_id = harness_platform_project.Project_Test.identifier
org_id = "default"
repo_name = "GitXTest3"
connector_ref = "account.TF_github_account_level_connector"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,16 @@ func testAccResourceInputSetImportFromGit(id string, name string) string {
identifier = "%[1]s"
name = "%[2]s"
}
resource "harness_platform_project" "Project_Test" {
identifier = "TF_InputSet_Pipeline_Test"
name = "TF_InputSet_Pipeline_Test"
color = "#0063F7"
org_id = "default"
}
resource "harness_platform_input_set" "test" {
identifier = "inputset"
org_id = "default"
project_id = "TF_Pipeline_Test"
project_id = harness_platform_project.Project_Test.identifier
name = "inputset"
pipeline_id = "DoNotDeletePipeline"
import_from_git = true
Expand Down
8 changes: 7 additions & 1 deletion internal/service/pipeline/pipeline/resource_pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,16 @@ func testAccResourcePipelineImportFromGit(id string, name string) string {
identifier = "%[1]s"
name = "%[2]s"
}
resource "harness_platform_project" "Project_Test" {
identifier = "TF_GitX_Pipeline_Test"
name = "TF_GitX_Pipeline_Test"
color = "#0063F7"
org_id = "default"
}
resource "harness_platform_pipeline" "test" {
identifier = "gitx"
org_id = "default"
project_id = "TF_Pipeline_Test"
project_id = "TF_GitX_Pipeline_Test"
name = "gitx"
import_from_git = true
git_import_info {
Expand Down
8 changes: 7 additions & 1 deletion internal/service/pipeline/template/resource_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1406,10 +1406,16 @@ func testAccResourceTemplateOrgScopeImportFromGit(id string, name string) string
func testAccResourceTemplateProjectScopeImportFromGit(id string, name string) string {
// This has project and org id static due to its config in the git.
return fmt.Sprintf(`
resource "harness_platform_project" "Project_Test" {
identifier = "TF_Project_Pipeline_Test"
name = "TF_Project_Pipeline_Test"
color = "#0063F7"
org_id = "default"
}
resource "harness_platform_template" "test" {
identifier = "%[1]s"
org_id = "default"
project_id = "TF_Pipeline_Test"
project_id = harness_platform_project.Project_Test.identifier
name = "%[2]s"
version = "v2"
import_from_git = true
Expand Down

0 comments on commit 62aa516

Please sign in to comment.