Skip to content

Commit

Permalink
test: it check comment
Browse files Browse the repository at this point in the history
Signed-off-by: Yvonnick Esnault <[email protected]>
  • Loading branch information
yesnault committed Feb 11, 2024
1 parent 5e02366 commit f36dd5e
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions tests/08_v2_workflow_on_pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ testcases:
retry: 10
delay: 12

- name: Create the pull-request
- name: Create Pull-Request
steps:
- name: Create the pull-request on gitea
type: http
method: POST
url: "{{.git.host}}/api/v1/repos/{{.git.user}}/{{.git_repo}}/pulls"
Expand All @@ -123,8 +125,10 @@ testcases:
"title": "test pull-request"
}
assertions:
- or:
- result.statuscode ShouldEqual 201
vars:
prNumber:
from: result.bodyjson.number

- name: Check if workflow triggered on the new-branch is ok after pull-request creation
steps:
Expand All @@ -141,3 +145,25 @@ testcases:

- name: Check workflowEnv log content
script: "cat {{.cds_workflow}}-*-myjob* | grep \"job done\""

- name: Check comment created on gitea
steps:
- name: Get pull-request from gitea and check comment
type: http
method: GET
url: "{{.git.host}}/api/v1/repos/{{.git.user}}/{{.git_repo}}/pulls/{{.Create-Pull-Request.prNumber}}/reviews"
basic_auth_user: "{{.git.user}}"
basic_auth_password: "{{.git.password}}"
headers:
Content-Type: application/json
body: >
{
"base": "master",
"body": "test body pull-request",
"head": "new-branch",
"title": "test pull-request"
}
assertions:
- result.statuscode ShouldEqual 200
- result.bodyjson ShouldHaveLength 1
- result.bodyjson.bodyjson0.body ShouldEqual "a comment here"

0 comments on commit f36dd5e

Please sign in to comment.