Skip to content

Commit

Permalink
Update params and args in test pipelines (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkumbha authored Dec 13, 2023
1 parent 9c41de1 commit 833c9d6
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 33 deletions.
2 changes: 1 addition & 1 deletion pipelines/issue/add_issue_assignees.fp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pipeline "add_issue_assignees" {
default = "default"
}

param "repository_full_name" {
param "repository_owner" {
type = string
description = local.repository_owner_param_description
}
Expand Down
10 changes: 6 additions & 4 deletions pipelines/issue/tests/test_add_issue_assignees.fp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pipeline "test_add_issue_assignees" {

param "issue_number" {
type = number
default = 1
default = 53
description = "The number of the issue."
}

Expand All @@ -26,9 +26,11 @@ pipeline "test_add_issue_assignees" {
step "pipeline" "add_issue_assignees" {
pipeline = pipeline.add_issue_assignees
args = {
cred = param.cred
issue_number = param.issue_number
assignee_ids = param.assignee_ids
assignee_ids = param.assignee_ids
cred = param.cred
issue_number = param.issue_number
repository_name = "deleteme"
repository_owner = "vkumbha"
}
}

Expand Down
20 changes: 13 additions & 7 deletions pipelines/issue/tests/test_create_issue.fp
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,22 @@ pipeline "test_create_issue" {
step "pipeline" "create_issue" {
pipeline = pipeline.create_issue
args = {
cred = param.cred
issue_title = param.issue_title
issue_body = param.issue_body
cred = param.cred
issue_body = param.issue_body
issue_title = param.issue_title
repository_name = "deleteme"
repository_owner = "vkumbha"
}
}

step "pipeline" "get_issue_by_number" {
if = !is_error(step.pipeline.create_issue)
pipeline = pipeline.get_issue_by_number
args = {
cred = param.cred
issue_number = step.pipeline.create_issue.output.issue.number
cred = param.cred
issue_number = step.pipeline.create_issue.output.issue.number
repository_name = "deleteme"
repository_owner = "vkumbha"
}

# Ignore errors so we can delete
Expand All @@ -52,8 +56,10 @@ pipeline "test_create_issue" {

pipeline = pipeline.close_issue
args = {
cred = param.cred
issue_number = step.pipeline.create_issue.output.issue.number
cred = param.cred
issue_number = step.pipeline.create_issue.output.issue.number
repository_name = "deleteme"
repository_owner = "vkumbha"
}
}

Expand Down
4 changes: 3 additions & 1 deletion pipelines/issue/tests/test_list_issues.fp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ pipeline "test_list_issues" {
step "pipeline" "list_issues" {
pipeline = pipeline.list_issues
args = {
cred = param.cred
cred = param.cred
repository_name = "flowpipe"
repository_owner = "turbot"
}
}

Expand Down
8 changes: 5 additions & 3 deletions pipelines/issue/tests/test_search_issues.fp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ pipeline "test_search_issues" {

param "search_value" {
type = string
default = "test"
default = "CLI"
}

step "pipeline" "search_issues" {
pipeline = pipeline.search_issues
args = {
cred = param.cred
search_value = param.search_value
cred = param.cred
search_value = param.search_value
repository_name = "flowpipe"
repository_owner = "turbot"
}
}

Expand Down
6 changes: 4 additions & 2 deletions pipelines/pull_request/tests/test_list_pull_requests.fp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ pipeline "test_list_pull_requests" {
step "pipeline" "list_pull_requests" {
pipeline = pipeline.list_pull_requests
args = {
cred = param.cred
cred = param.cred
repository_name = "flowpipe"
repository_owner = "turbot"
}
}

output "list_pull_requests" {
description = "Check for pipeline.list_pull_requests."
value = !is_error(step.pipeline.list_pull_requests) ? "pass" : "fail: ${step.pipeline.list_pull_requests.errors}"
}
}
}
6 changes: 4 additions & 2 deletions pipelines/pull_request/tests/test_search_pull_requests.fp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ pipeline "test_search_pull_requests" {
step "pipeline" "search_pull_requests" {
pipeline = pipeline.search_pull_requests
args = {
cred = param.cred
search_value = param.search_value
cred = param.cred
repository_name = "flowpipe"
repository_owner = "turbot"
search_value = param.search_value
}
}

Expand Down
10 changes: 0 additions & 10 deletions pipelines/repository/search_repositories.fp
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ pipeline "search_repositories" {
default = "default"
}

param "repository_owner" {
type = string
description = local.repository_owner_param_description
}

param "repository_name" {
type = string
description = local.repository_name_param_description
}

param "search_value" {
type = string
description = "The search string to look for. Examples: steampipe, owner:turbot steampipe, repo:vkumbha/deleteme."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ pipeline "test_get_repository_by_full_name" {
step "pipeline" "get_repository_by_full_name" {
pipeline = pipeline.get_repository_by_full_name
args = {
cred = param.cred
cred = param.cred
repository_name = "flowpipe"
repository_owner = "turbot"
}
}

Expand Down
3 changes: 2 additions & 1 deletion pipelines/repository/tests/test_get_repository_owner.fp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ pipeline "test_get_repository_owner" {
step "pipeline" "get_repository_owner" {
pipeline = pipeline.get_repository_owner
args = {
cred = param.cred
cred = param.cred
repository_owner = "turbot"
}
}

Expand Down
2 changes: 1 addition & 1 deletion pipelines/repository/tests/test_search_repositories.fp
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ pipeline "test_search_repositories" {
description = "Check for pipeline.search_repositories."
value = !is_error(step.pipeline.search_repositories) ? "pass" : "fail: ${step.pipeline.search_repositories.errors}"
}
}
}

0 comments on commit 833c9d6

Please sign in to comment.