From 833c9d633f65cb2c383870e2708e4cef68b13bed Mon Sep 17 00:00:00 2001 From: Venu <40973863+vkumbha@users.noreply.github.com> Date: Wed, 13 Dec 2023 10:02:11 +0530 Subject: [PATCH] Update params and args in test pipelines (#8) --- pipelines/issue/add_issue_assignees.fp | 2 +- .../issue/tests/test_add_issue_assignees.fp | 10 ++++++---- pipelines/issue/tests/test_create_issue.fp | 20 ++++++++++++------- pipelines/issue/tests/test_list_issues.fp | 4 +++- pipelines/issue/tests/test_search_issues.fp | 8 +++++--- .../tests/test_list_pull_requests.fp | 6 ++++-- .../tests/test_search_pull_requests.fp | 6 ++++-- pipelines/repository/search_repositories.fp | 10 ---------- .../tests/test_get_repository_by_full_name.fp | 4 +++- .../tests/test_get_repository_owner.fp | 3 ++- .../tests/test_search_repositories.fp | 2 +- 11 files changed, 42 insertions(+), 33 deletions(-) diff --git a/pipelines/issue/add_issue_assignees.fp b/pipelines/issue/add_issue_assignees.fp index 4316f8c..8c63c3d 100644 --- a/pipelines/issue/add_issue_assignees.fp +++ b/pipelines/issue/add_issue_assignees.fp @@ -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 } diff --git a/pipelines/issue/tests/test_add_issue_assignees.fp b/pipelines/issue/tests/test_add_issue_assignees.fp index 356f38d..1d2fdc5 100644 --- a/pipelines/issue/tests/test_add_issue_assignees.fp +++ b/pipelines/issue/tests/test_add_issue_assignees.fp @@ -14,7 +14,7 @@ pipeline "test_add_issue_assignees" { param "issue_number" { type = number - default = 1 + default = 53 description = "The number of the issue." } @@ -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" } } diff --git a/pipelines/issue/tests/test_create_issue.fp b/pipelines/issue/tests/test_create_issue.fp index 4c247e2..fe7a490 100644 --- a/pipelines/issue/tests/test_create_issue.fp +++ b/pipelines/issue/tests/test_create_issue.fp @@ -25,9 +25,11 @@ 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" } } @@ -35,8 +37,10 @@ pipeline "test_create_issue" { 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 @@ -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" } } diff --git a/pipelines/issue/tests/test_list_issues.fp b/pipelines/issue/tests/test_list_issues.fp index 74ad757..5f5773b 100644 --- a/pipelines/issue/tests/test_list_issues.fp +++ b/pipelines/issue/tests/test_list_issues.fp @@ -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" } } diff --git a/pipelines/issue/tests/test_search_issues.fp b/pipelines/issue/tests/test_search_issues.fp index 207e8a9..94082a4 100644 --- a/pipelines/issue/tests/test_search_issues.fp +++ b/pipelines/issue/tests/test_search_issues.fp @@ -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" } } diff --git a/pipelines/pull_request/tests/test_list_pull_requests.fp b/pipelines/pull_request/tests/test_list_pull_requests.fp index 9419c7d..b6ea00d 100644 --- a/pipelines/pull_request/tests/test_list_pull_requests.fp +++ b/pipelines/pull_request/tests/test_list_pull_requests.fp @@ -15,7 +15,9 @@ 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" } } @@ -23,4 +25,4 @@ pipeline "test_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}" } -} +} \ No newline at end of file diff --git a/pipelines/pull_request/tests/test_search_pull_requests.fp b/pipelines/pull_request/tests/test_search_pull_requests.fp index 4cd2a19..ce28e0f 100644 --- a/pipelines/pull_request/tests/test_search_pull_requests.fp +++ b/pipelines/pull_request/tests/test_search_pull_requests.fp @@ -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 } } diff --git a/pipelines/repository/search_repositories.fp b/pipelines/repository/search_repositories.fp index 97f8b0f..6788082 100644 --- a/pipelines/repository/search_repositories.fp +++ b/pipelines/repository/search_repositories.fp @@ -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." diff --git a/pipelines/repository/tests/test_get_repository_by_full_name.fp b/pipelines/repository/tests/test_get_repository_by_full_name.fp index 407d58d..c9b3227 100644 --- a/pipelines/repository/tests/test_get_repository_by_full_name.fp +++ b/pipelines/repository/tests/test_get_repository_by_full_name.fp @@ -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" } } diff --git a/pipelines/repository/tests/test_get_repository_owner.fp b/pipelines/repository/tests/test_get_repository_owner.fp index 458ae26..5fec060 100644 --- a/pipelines/repository/tests/test_get_repository_owner.fp +++ b/pipelines/repository/tests/test_get_repository_owner.fp @@ -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" } } diff --git a/pipelines/repository/tests/test_search_repositories.fp b/pipelines/repository/tests/test_search_repositories.fp index 35f0256..695c999 100644 --- a/pipelines/repository/tests/test_search_repositories.fp +++ b/pipelines/repository/tests/test_search_repositories.fp @@ -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}" } -} +} \ No newline at end of file