Skip to content

Commit

Permalink
Fix trigger tests (#582)
Browse files Browse the repository at this point in the history
* Fix trigger tests

* Update docs

* Update docs

* Update docs
  • Loading branch information
rathodmeetsatish committed Jun 15, 2023
1 parent a6e7d42 commit c714e08
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 72 deletions.
35 changes: 18 additions & 17 deletions docs/resources/platform_triggers.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,35 @@ resource "harness_platform_triggers" "example" {
target_id = "pipelineIdentifier"
yaml = <<-EOT
trigger:
name: "name"
identifier: "identifier"
name: name
identifier: identifier
enabled: true
description: ""
tags: {}
projectIdentifier: "projectIdentifier"
orgIdentifier: "orgIdentifer"
pipelineIdentifier: "pipelineIdentifier"
projectIdentifier: projectIdentifier
orgIdentifier: orgIdentifer
pipelineIdentifier: pipelineIdentifier
source:
type: "Webhook"
type: Webhook
spec:
type: "Github"
type: Github
spec:
type: "Push"
type: Push
spec:
connectorRef: "account.TestAccResourceConnectorGithub_Ssh_IZBeG"
connectorRef: account.TestAccResourceConnectorGithub_Ssh_IZBeG
autoAbortPreviousExecutions: false
payloadConditions:
- key: "changedFiles"
operator: "Equals"
value: "value"
- key: "targetBranch"
operator: "Equals"
value: "value"
- key: changedFiles
operator: Equals
value: value
- key: targetBranch
operator: Equals
value: value
headerConditions: []
repoName: "repoName"
repoName: repoName
actions: []
inputYaml: "pipeline: {}\n"
inputYaml: |
pipeline: {}\n
EOT
}
```
Expand Down
35 changes: 18 additions & 17 deletions examples/resources/harness_platform_triggers/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,34 @@ resource "harness_platform_triggers" "example" {
target_id = "pipelineIdentifier"
yaml = <<-EOT
trigger:
name: "name"
identifier: "identifier"
name: name
identifier: identifier
enabled: true
description: ""
tags: {}
projectIdentifier: "projectIdentifier"
orgIdentifier: "orgIdentifer"
pipelineIdentifier: "pipelineIdentifier"
projectIdentifier: projectIdentifier
orgIdentifier: orgIdentifer
pipelineIdentifier: pipelineIdentifier
source:
type: "Webhook"
type: Webhook
spec:
type: "Github"
type: Github
spec:
type: "Push"
type: Push
spec:
connectorRef: "account.TestAccResourceConnectorGithub_Ssh_IZBeG"
connectorRef: account.TestAccResourceConnectorGithub_Ssh_IZBeG
autoAbortPreviousExecutions: false
payloadConditions:
- key: "changedFiles"
operator: "Equals"
value: "value"
- key: "targetBranch"
operator: "Equals"
value: "value"
- key: changedFiles
operator: Equals
value: value
- key: targetBranch
operator: Equals
value: value
headerConditions: []
repoName: "repoName"
repoName: repoName
actions: []
inputYaml: "pipeline: {}\n"
inputYaml: |
pipeline: {}\n
EOT
}
38 changes: 19 additions & 19 deletions internal/service/platform/triggers/data_source_triggers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,37 +92,37 @@ EOT
name = "%[2]s"
target_id = harness_platform_pipeline.pipeline.id
yaml = <<-EOT
---
trigger:
name: "%[2]s"
identifier: "%[1]s"
name: %[2]s
identifier: %[1]s
enabled: true
description: ""
tags: {}
projectIdentifier: "${harness_platform_project.test.id}"
orgIdentifier: "${harness_platform_project.test.org_id}"
pipelineIdentifier: "${harness_platform_pipeline.pipeline.id}"
projectIdentifier: ${harness_platform_project.test.id}
orgIdentifier: ${harness_platform_project.test.org_id}
pipelineIdentifier: ${harness_platform_pipeline.pipeline.id}
source:
type: "Webhook"
pollInterval: "0"
type: Webhook
pollInterval: 0
spec:
type: "Github"
type: Github
spec:
type: "Push"
type: Push
spec:
connectorRef: "account.Jajoo"
connectorRef: account.Jajoo
autoAbortPreviousExecutions: false
payloadConditions:
- key: "changedFiles"
operator: "Equals"
value: "fjjfjfjf"
- key: "targetBranch"
operator: "Equals"
value: "fhfhfh"
- key: changedFiles
operator: Equals
value: fjjfjfjf
- key: targetBranch
operator: Equals
value: fhfhfh
headerConditions: []
repoName: "gfgfgf"
repoName: gfgfgf
actions: []
inputYaml: "pipeline: {}\n"
inputYaml: |
pipeline: {}\n
EOT
}
Expand Down
38 changes: 19 additions & 19 deletions internal/service/platform/triggers/resource_triggers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,37 +181,37 @@ EOT
name = "%[2]s"
target_id = harness_platform_pipeline.pipeline.id
yaml = <<-EOT
---
trigger:
name: "%[2]s"
identifier: "%[1]s"
name: %[2]s
identifier: %[1]s
enabled: true
description: ""
tags: {}
projectIdentifier: "${harness_platform_project.test.id}"
orgIdentifier: "${harness_platform_project.test.org_id}"
pipelineIdentifier: "${harness_platform_pipeline.pipeline.id}"
projectIdentifier: ${harness_platform_project.test.id}
orgIdentifier: ${harness_platform_project.test.org_id}
pipelineIdentifier: ${harness_platform_pipeline.pipeline.id}
source:
type: "Webhook"
pollInterval: "0"
type: Webhook
pollInterval: 0
spec:
type: "Github"
type: Github
spec:
type: "Push"
type: Push
spec:
connectorRef: "account.Jajoo"
connectorRef: account.Jajoo
autoAbortPreviousExecutions: false
payloadConditions:
- key: "changedFiles"
operator: "Equals"
value: "fjjfjfjf"
- key: "targetBranch"
operator: "Equals"
value: "fhfhfh"
- key: changedFiles
operator: Equals
value: fjjfjfjf
- key: targetBranch
operator: Equals
value: fhfhfh
headerConditions: []
repoName: "gfgfgf"
repoName: gfgfgf
actions: []
inputYaml: "pipeline: {}\n"
inputYaml: |
pipeline: {}\n
EOT
}
`, id, name)
Expand Down

0 comments on commit c714e08

Please sign in to comment.