Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix trigger tests #582

Merged
merged 5 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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