Skip to content

Commit fe9a16a

Browse files
committed
fix: integration test
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
1 parent 28c1e8a commit fe9a16a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/integration-test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,24 @@ jobs:
146146
env:
147147
CREDS: "admin:password"
148148
run: |
149-
TASK=$(curl -X POST -u "$CREDS" -H "oCS-APIRequest: true" -H "Content-type: application/json" http://localhost:8080/ocs/v2.php/taskprocessing/schedule?format=json --data-raw '{"input": {"input": "Hello World!"},"type":"core:text2text:translate", "appId": "test", "customId": ""}')
149+
set -x
150+
curl -s -u "$CREDS" -H "oCS-APIRequest: true" -H "Content-type: application/json" http://localhost:8080/ocs/v2.php/taskprocessing/tasktypes?format=json
151+
152+
TASK=$(curl -s -X POST -u "$CREDS" -H "oCS-APIRequest: true" -H "Content-type: application/json" http://localhost:8080/ocs/v2.php/taskprocessing/schedule?format=json --data-raw '{"input": {"input": "Hello World!", "origin_language": "auto", "target_language": "de"},"type":"core:text2text:translate", "appId": "test", "customId": ""}')
150153
echo $TASK
154+
[ "$(echo $TASK | jq -r '.ocs.meta.status')" == "OK" ]
155+
151156
TASK_ID=$(echo $TASK | jq '.ocs.data.task.id')
152157
NEXT_WAIT_TIME=0
153158
TASK_STATUS='"STATUS_SCHEDULED"'
154159
until [ $NEXT_WAIT_TIME -eq 35 ] || [ "$TASK_STATUS" == '"STATUS_SUCCESSFUL"' ] || [ "$TASK_STATUS" == '"STATUS_FAILED"' ]; do
155-
TASK=$(curl -u "$CREDS" -H "oCS-APIRequest: true" http://localhost:8080/ocs/v2.php/taskprocessing/task/$TASK_ID?format=json)
160+
TASK=$(curl -s -u "$CREDS" -H "oCS-APIRequest: true" http://localhost:8080/ocs/v2.php/taskprocessing/task/$TASK_ID?format=json)
156161
echo $TASK
157162
TASK_STATUS=$(echo $TASK | jq '.ocs.data.task.status')
158163
echo $TASK_STATUS
159164
sleep $(( NEXT_WAIT_TIME++ ))
160165
done
161-
curl -u "$CREDS" -H "oCS-APIRequest: true" http://localhost:8080/ocs/v2.php/taskprocessing/task/$TASK_ID?format=json
166+
curl -s -u "$CREDS" -H "oCS-APIRequest: true" http://localhost:8080/ocs/v2.php/taskprocessing/task/$TASK_ID?format=json
162167
[ "$TASK_STATUS" == '"STATUS_SUCCESSFUL"' ]
163168
[ "$(echo $TASK | jq '.ocs.data.task.output')" == '"Hallo Welt!"' ]
164169

0 commit comments

Comments
 (0)