Skip to content

Commit 2b7b767

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

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.github/workflows/integration-test.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,6 @@ jobs:
8585
with:
8686
path: ${{ env.APP_ID }}
8787

88-
- name: Checkout AppAPI
89-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
90-
with:
91-
repository: cloud-py-api/app_api
92-
path: apps/app_api
93-
ref: v2.7.0
94-
9588
- name: Set up Nextcloud
9689
if: ${{ matrix.databases != 'pgsql'}}
9790
run: |
@@ -146,19 +139,26 @@ jobs:
146139
env:
147140
CREDS: "admin:password"
148141
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": ""}')
142+
set -x
143+
TASKTYPES=$(curl -s -u "$CREDS" -H "oCS-APIRequest: true" -H "Content-type: application/json" http://localhost:8080/ocs/v2.php/taskprocessing/tasktypes?format=json)
144+
echo $TASKTYPES
145+
[ "$(echo $TASKTYPES | jq -r '.ocs.meta.status')" == "OK" ]
146+
147+
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": ""}')
150148
echo $TASK
149+
[ "$(echo $TASK | jq -r '.ocs.meta.status')" == "OK" ]
150+
151151
TASK_ID=$(echo $TASK | jq '.ocs.data.task.id')
152152
NEXT_WAIT_TIME=0
153153
TASK_STATUS='"STATUS_SCHEDULED"'
154154
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)
155+
TASK=$(curl -s -u "$CREDS" -H "oCS-APIRequest: true" http://localhost:8080/ocs/v2.php/taskprocessing/task/$TASK_ID?format=json)
156156
echo $TASK
157157
TASK_STATUS=$(echo $TASK | jq '.ocs.data.task.status')
158158
echo $TASK_STATUS
159159
sleep $(( NEXT_WAIT_TIME++ ))
160160
done
161-
curl -u "$CREDS" -H "oCS-APIRequest: true" http://localhost:8080/ocs/v2.php/taskprocessing/task/$TASK_ID?format=json
161+
curl -s -u "$CREDS" -H "oCS-APIRequest: true" http://localhost:8080/ocs/v2.php/taskprocessing/task/$TASK_ID?format=json
162162
[ "$TASK_STATUS" == '"STATUS_SUCCESSFUL"' ]
163163
[ "$(echo $TASK | jq '.ocs.data.task.output')" == '"Hallo Welt!"' ]
164164

0 commit comments

Comments
 (0)