From ba4c7a8e88cf78fd2fa5748dda90a5adac7b4d65 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 17 Mar 2021 15:31:00 -0500 Subject: [PATCH] Add a step to wait until REST API is ready (returns 200) --- .github/workflows/build.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be958e7369..8c6d921237 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,7 +80,16 @@ jobs: docker-compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli docker container ls - - name: Check DSpace REST Backend available (for e2e tests) + # Wait until the REST API returns a 200 response (or for a max of 30 seconds) + # https://github.com/nev7n/wait_for_response + - name: Wait for DSpace REST Backend to be ready (for e2e tests) + uses: nev7n/wait_for_response@v1 + with: + url: 'http://localhost:8080/server/api' + responseCode: 200 + timeout: 30000 + + - name: Check DSpace REST Backend response (for e2e tests) run: curl http://localhost:8080/server/api - name: Run e2e tests (integration tests)