Skip to content

Commit ee10002

Browse files
[YOLO] Update pipeline Test functional by framework - multisteps (#1464)
1 parent ce34704 commit ee10002

File tree

1 file changed

+63
-8
lines changed

1 file changed

+63
-8
lines changed

.harness/test_functional_by_framework_multisteps.yaml

Lines changed: 63 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pipeline:
105105
description: ""
106106
type: CI
107107
spec:
108-
cloneCodebase: true
108+
cloneCodebase: false
109109
execution:
110110
steps:
111111
- step:
@@ -121,6 +121,32 @@ pipeline:
121121
spec:
122122
branch: <+pipeline.variables.target_branch>
123123
description: Explicitly clone repo to pull a commit created during reconciliation
124+
- step:
125+
type: Run
126+
name: report_status_to_github_start
127+
identifier: report_status_to_github_start
128+
spec:
129+
shell: Bash
130+
command: |-
131+
cd /harness/<+pipeline.variables.target_repo>
132+
git log -2
133+
latest_commit_sha=$(git log -1 --pretty=format:"%H")
134+
echo ${latest_commit_sha}
135+
pipeline_execution_github_status_key="Test framework - <+matrix.env.env_folder> - <+matrix.env.repo>:<+matrix.env.tag>"
136+
137+
echo "Update PR status"
138+
curl -i -X POST \
139+
-H "Authorization: Bearer <+secrets.getValue("account.Github_Access_Token")>" \
140+
-H "Accept: application/vnd.github.v3+json" \
141+
https://api.github.com/repos/<+account.name>/datarobot-user-models/statuses/${latest_commit_sha} \
142+
-d "{\"state\":\"pending\",\"target_url\":\"<+pipeline.execution.url>\",\"description\":\"Test is running\",\"context\":\"$pipeline_execution_github_status_key\"}"
143+
outputVariables:
144+
- name: pipeline_execution_github_status_key
145+
type: String
146+
value: pipeline_execution_github_status_key
147+
- name: latest_commit_sha
148+
type: String
149+
value: latest_commit_sha
124150
- step:
125151
type: Run
126152
name: Run functional test in provided framework
@@ -138,6 +164,42 @@ pipeline:
138164
memory: 3G
139165
when:
140166
stageStatus: Success
167+
contextType: Pipeline
168+
- step:
169+
type: Run
170+
name: report_status_to_github_end
171+
identifier: report_status_to_github_end
172+
spec:
173+
shell: Bash
174+
command: |-
175+
latest_commit_sha="<+execution.steps.report_status_to_github_start.output.outputVariables.latest_commit_sha>"
176+
github_status_key="<+execution.steps.report_status_to_github_start.output.outputVariables.pipeline_execution_github_status_key>"
177+
178+
echo ${latest_commit_sha}
179+
echo ${github_status_key}
180+
181+
status_0="<+execution.steps.Run_1.status>"
182+
183+
echo "Update PR status"
184+
185+
if [[ "$status_0" == "SUCCEEDED" ]]; then
186+
state="success"
187+
description="Passed"
188+
elif [[ "$status_0" == "PENDING" ]]; then
189+
state="pending"
190+
description="Pending"
191+
else
192+
state="failure"
193+
description="Failed"
194+
fi
195+
196+
curl -i -u <+account.name>:<+secrets.getValue("account.Github_Access_Token")> \
197+
-X POST \
198+
-H "Accept: application/vnd.github.v3+json" \
199+
https://api.github.com/repos/<+account.name>/datarobot-user-models/statuses/${latest_commit_sha} \
200+
-d "{\"state\":\"$state\",\"target_url\":\"<+pipeline.execution.url>\",\"description\":\"$description\",\"context\":\"$github_status_key\"}"
201+
when:
202+
stageStatus: All
141203
caching:
142204
enabled: true
143205
paths: []
@@ -184,10 +246,3 @@ pipeline:
184246
description: Whether to force all requirements update to the latest versions
185247
required: false
186248
value: <+input>.default(false).allowedValues(true,false)
187-
properties:
188-
ci:
189-
codebase:
190-
connectorRef: account.svc_harness_git1
191-
repoName: datarobot-user-models
192-
build: <+input>
193-
sparseCheckout: []

0 commit comments

Comments
 (0)