Skip to content

Commit fd2790c

Browse files
Merge pull request opendatahub-io#101 from rimolive/rmartine
Add e2e tests for recurring runs
2 parents 5a78f67 + 89a9274 commit fd2790c

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

tests/basictests/dsp-operator.sh

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function create_run() {
140140
EOF
141141
) | jq -r .run.id)
142142
143-
os::cmd::try_until_not_text "curl -s -k -H 'Authorization: Bearer ${SA_TOKEN}' https://${ROUTE}/apis/v1beta1/runs/${RUN_ID} | jq '" "null" $odhdefaulttimeout $odhdefaultinterval
143+
os::cmd::try_until_not_text "curl -s -k -H 'Authorization: Bearer ${SA_TOKEN}' https://${ROUTE}/apis/v1beta1/runs/${RUN_ID} | jq " "null" $odhdefaulttimeout $odhdefaultinterval
144144
}
145145
146146
function create_experiment_run() {
@@ -170,7 +170,7 @@ function create_experiment_run() {
170170
EOF
171171
) | jq -r .run.id)
172172
173-
os::cmd::try_until_not_text "curl -s -k -H 'Authorization: Bearer ${SA_TOKEN}' https://${ROUTE}/apis/v1beta1/runs/${RUN_ID_EXPT} | jq '" "null" $odhdefaulttimeout $odhdefaultinterval
173+
os::cmd::try_until_not_text "curl -s -k -H 'Authorization: Bearer ${SA_TOKEN}' https://${ROUTE}/apis/v1beta1/runs/${RUN_ID_EXPT} | jq " "null" $odhdefaulttimeout $odhdefaultinterval
174174
}
175175
176176
function verify_run_availabilty() {
@@ -208,6 +208,44 @@ function delete_pipeline() {
208208
os::cmd::try_until_text "curl -s -k -H 'Authorization: Bearer ${SA_TOKEN}' -X DELETE https://${ROUTE}/apis/v1beta1/pipelines/${PIPELINE_ID} | jq" "" $odhdefaulttimeout $odhdefaultinterval
209209
}
210210
211+
function create_recurring_run() {
212+
header "Creating the Recurring Run from uploaded pipeline"
213+
214+
JOB_ID=$((curl -k -H "Authorization: Bearer ${SA_TOKEN}" \
215+
-H "Content-Type: application/json" \
216+
-X POST "https://${ROUTE}/apis/v1beta1/jobs" \
217+
-d @- << EOF
218+
{
219+
"name":"test-recurring-run",
220+
"pipeline_spec":{
221+
"pipeline_id":"${PIPELINE_ID}"
222+
},
223+
"max_concurrency": 10,
224+
"trigger": {
225+
"periodic_schedule": {
226+
"interval_second": 3600
227+
}
228+
},
229+
"enabled": true
230+
}
231+
EOF
232+
) | jq -r .id)
233+
234+
os::cmd::try_until_not_text "curl -s -k -H 'Authorization: Bearer ${SA_TOKEN}' https://${ROUTE}/apis/v1beta1/jobs/${JOB_ID} | jq " "null" $odhdefaulttimeout $odhdefaultinterval
235+
}
236+
237+
function verify_recurring_run_availabilty() {
238+
header "verify the Recurring Run exists"
239+
240+
os::cmd::try_until_text "curl -s -k -H 'Authorization: Bearer ${SA_TOKEN}' https://${ROUTE}/apis/v1beta1/jobs | jq '.total_size'" "1" $odhdefaulttimeout $odhdefaultinterval
241+
}
242+
243+
function delete_recurring_run() {
244+
header "Deleting the Recurring Run"
245+
246+
os::cmd::try_until_text "curl -s -k -H 'Authorization: Bearer ${SA_TOKEN}' -X DELETE https://${ROUTE}/apis/v1beta1/jobs/${PIPELINE_ID} | jq" "" $odhdefaulttimeout $odhdefaultinterval
247+
}
248+
211249
212250
echo "Testing Data Science Pipelines Operator functionality"
213251
@@ -228,6 +266,9 @@ verify_run_availabilty
228266
check_run_status
229267
delete_runs
230268
delete_experiment
269+
create_recurring_run
270+
verify_recurring_run_availabilty
271+
delete_recurring_run
231272
delete_pipeline
232273
233274
os::test::junit::declare_suite_end

0 commit comments

Comments
 (0)