Skip to content

Commit f2c4717

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

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

.github/workflows/integration-test.yml

Lines changed: 11 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,27 @@ 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+
sleep 301
144+
TASKTYPES=$(curl -s -u "$CREDS" -H "oCS-APIRequest: true" -H "Content-type: application/json" http://localhost:8080/ocs/v2.php/taskprocessing/tasktypes?format=json)
145+
echo $TASKTYPES
146+
[ "$(echo $TASKTYPES | jq -r '.ocs.meta.status')" == "ok" ]
147+
148+
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": ""}')
150149
echo $TASK
150+
[ "$(echo $TASK | jq -r '.ocs.meta.status')" == "ok" ]
151+
151152
TASK_ID=$(echo $TASK | jq '.ocs.data.task.id')
152153
NEXT_WAIT_TIME=0
153154
TASK_STATUS='"STATUS_SCHEDULED"'
154155
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)
156+
TASK=$(curl -s -u "$CREDS" -H "oCS-APIRequest: true" http://localhost:8080/ocs/v2.php/taskprocessing/task/$TASK_ID?format=json)
156157
echo $TASK
157158
TASK_STATUS=$(echo $TASK | jq '.ocs.data.task.status')
158159
echo $TASK_STATUS
159160
sleep $(( NEXT_WAIT_TIME++ ))
160161
done
161-
curl -u "$CREDS" -H "oCS-APIRequest: true" http://localhost:8080/ocs/v2.php/taskprocessing/task/$TASK_ID?format=json
162+
curl -s -u "$CREDS" -H "oCS-APIRequest: true" http://localhost:8080/ocs/v2.php/taskprocessing/task/$TASK_ID?format=json
162163
[ "$TASK_STATUS" == '"STATUS_SUCCESSFUL"' ]
163164
[ "$(echo $TASK | jq '.ocs.data.task.output')" == '"Hallo Welt!"' ]
164165

0 commit comments

Comments
 (0)