Wait for server to start before Cypress tests (#5846)
This commit is contained in:
parent
dcfb8f6e48
commit
5edd9d0fdb
6
.github/workflows/client-test.yml
vendored
6
.github/workflows/client-test.yml
vendored
|
|
@ -333,7 +333,11 @@ jobs:
|
||||||
APPSMITH_ENCRYPTION_SALT: "salt"
|
APPSMITH_ENCRYPTION_SALT: "salt"
|
||||||
APPSMITH_IS_SELF_HOSTED: false
|
APPSMITH_IS_SELF_HOSTED: false
|
||||||
run: |
|
run: |
|
||||||
./scripts/start-dev-server.sh > /dev/null 2>&1 &
|
./scripts/start-dev-server.sh > /dev/null 2>&1 &
|
||||||
|
|
||||||
|
- name: Wait for 30 seconds for server to start
|
||||||
|
run: sleep 30s
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: Use Node.js 14.15.4
|
- name: Use Node.js 14.15.4
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,23 @@ sleep 30
|
||||||
echo "Checking if the containers have started"
|
echo "Checking if the containers have started"
|
||||||
sudo docker ps -a
|
sudo docker ps -a
|
||||||
|
|
||||||
|
echo "Checking if the server has started"
|
||||||
|
status_code=$(curl -o /dev/null -s -w "%{http_code}\n" https://dev.appsmith.com/api/v1/users)
|
||||||
|
|
||||||
|
retry_count=1
|
||||||
|
|
||||||
|
while [ "$retry_count" -le "3" -a "$status_code" -eq "502" ]; do
|
||||||
|
echo "Hit 502.Server not started retrying..."
|
||||||
|
retry_count=$((1 + $retry_count))
|
||||||
|
sleep 30
|
||||||
|
status_code=$(curl -o /dev/null -s -w "%{http_code}\n" https://dev.appsmith.com/api/v1/users)
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$status_code" -eq "502" ]; then
|
||||||
|
echo "Unable to connect to server"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Create the test user
|
# Create the test user
|
||||||
curl -k --request POST -v 'https://dev.appsmith.com/api/v1/users' \
|
curl -k --request POST -v 'https://dev.appsmith.com/api/v1/users' \
|
||||||
--header 'Content-Type: application/json' \
|
--header 'Content-Type: application/json' \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user