From 4f094ea779ddeaeda4ddb6d66cc27981aa823497 Mon Sep 17 00:00:00 2001 From: Arpit Mohan Date: Wed, 4 Nov 2020 00:32:42 +0530 Subject: [PATCH] Moving the postgres container to Cypress test setup --- .github/workflows/client.yml | 14 -------------- app/client/cypress/setup-test.sh | 6 ++++++ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/client.yml b/.github/workflows/client.yml index a84b7ebed7..cc96f7cef0 100644 --- a/.github/workflows/client.yml +++ b/.github/workflows/client.yml @@ -106,20 +106,6 @@ jobs: image: mongo ports: - 27017:27017 - # This is required in Cypress tests that test the datasource integrations - postgres: - image: postgres - ports: - - 5432:5432 - env: - POSTGRES_PASSWORD: postgres - POSTGRES_USER: postgres - POSTGRES_DB: postgres - # Set health checks to wait until postgres has started - # Also initialize the docker container with data - options: >- - --name postgres - -v ${{ github.workspace }}/app/client/cypress/init-pg-dump-for-test.sql:/docker-entrypoint-initdb.d/init-pg-dump-for-test.sql steps: # Checkout the code diff --git a/app/client/cypress/setup-test.sh b/app/client/cypress/setup-test.sh index c81ead59fd..1ba495861d 100755 --- a/app/client/cypress/setup-test.sh +++ b/app/client/cypress/setup-test.sh @@ -67,6 +67,12 @@ curl -k --request POST -v 'https://dev.appsmith.com/api/v1/users' \ "password": "'"$CYPRESS_TESTPASSWORD2"'" }' +sudo docker run --network host --name postgres -d -p 5432:5432 \ + -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD \ + -v `pwd`/cypress/init-pg-dump-for-test.sql:/docker-entrypoint-initdb.d/init-pg-dump-for-test.sql \ + --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 \ + postgres:latest + # DEBUG=cypress:* $(npm bin)/cypress version # sed -i -e "s|api_url:.*$|api_url: $CYPRESS_URL|g" /github/home/.cache/Cypress/4.1.0/Cypress/resources/app/packages/server/config/app.yml # cat /github/home/.cache/Cypress/4.1.0/Cypress/resources/app/packages/server/config/app.yml