From 070469f07d0fdcafbb1ad5a89ba0056d0c490205 Mon Sep 17 00:00:00 2001 From: Sagar Tomar Date: Tue, 18 Jun 2024 17:37:17 +0530 Subject: [PATCH] test: seperated envs for keploy tests in ci --- .env.keploy | 15 +++++++++++++++ .env.local | 1 + .github/workflows/test_workflows/keploy.sh | 4 ++-- keploy-docker-compose.yml | 4 ++-- 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 .env.keploy diff --git a/.env.keploy b/.env.keploy new file mode 100644 index 00000000..5179555f --- /dev/null +++ b/.env.keploy @@ -0,0 +1,15 @@ +DB_URI=postgres://reporting_dashboard_role:reportingdashboard123@localhost:5432/reporting_dashboard_dev +POSTGRES_HOST=0.0.0.0 +POSTGRES_DB=reporting_dashboard_dev +POSTGRES_USER=reporting_dashboard_role +POSTGRES_PASSWORD=reportingdashboard123 +NODE_ENV=local +ACCESS_TOKEN_SECRET=4cd7234152590dcfe77e1b6fc52e84f4d30c06fddadd0dd2fb42cbc51fa14b1bb195bbe9d72c9599ba0c6b556f9bd1607a8478be87e5a91b697c74032e0ae7af +REDIS_HOST=localhost +REDIS_PORT=6379 +BUILD_NAME=docker +POSTGRES_PORT=5432 +NODE_ENV=production +ENVIRONMENT_NAME=keploy +APP_PATH=/home/runner/work/node-express-graphql-template/node-express-graphql-template +ENABLE_DEDUP=false diff --git a/.env.local b/.env.local index 281b9357..a7e269fc 100644 --- a/.env.local +++ b/.env.local @@ -12,3 +12,4 @@ POSTGRES_PORT=5432 NODE_ENV=production ENVIRONMENT_NAME=local APP_PATH=/Users/apple/repos/node-express-graphql-template +ENABLE_DEDUP=false diff --git a/.github/workflows/test_workflows/keploy.sh b/.github/workflows/test_workflows/keploy.sh index 6fa25f7d..5f6b5e8e 100644 --- a/.github/workflows/test_workflows/keploy.sh +++ b/.github/workflows/test_workflows/keploy.sh @@ -1,7 +1,7 @@ curl --silent -O -L https://keploy.io/ent/install.sh -sudo docker compose -f keploy-docker-compose.yml build +sudo docker compose -f keploy-docker-compose.yml --env-file .env.keploy build export KEPLOY_API_KEY=Iba1IAlh+GKnXPzYeA== curl --silent -o keployE --location "https://keploy-enterprise.s3.us-west-2.amazonaws.com/releases/latest/enterprise_linux_amd64" sudo chmod a+x keployE && sudo mkdir -p /usr/local/bin && sudo mv keployE /usr/local/bin @@ -11,7 +11,7 @@ sudo chmod a+x keployE && sudo mkdir -p /usr/local/bin && sudo mv keployE /usr/l echo "Project built successfully" -sudo -E env PATH="$PATH" /usr/local/bin/keployE test -c "sudo docker compose -f keploy-docker-compose.yml up" --containerName "custom_app" --delay 30 --apiTimeout 300 --generateGithubActions=false --coverage=true +sudo -E env PATH="$PATH" /usr/local/bin/keployE test -c "sudo docker compose -f keploy-docker-compose.yml --env-file .env.keploy up" --containerName "custom_app" --delay 30 --apiTimeout 300 --generateGithubActions=false --coverage=true echo "Keploy started in test mode" all_passed=true diff --git a/keploy-docker-compose.yml b/keploy-docker-compose.yml index f2024b45..eafba97c 100644 --- a/keploy-docker-compose.yml +++ b/keploy-docker-compose.yml @@ -6,11 +6,11 @@ services: context: . args: BUILD_NAME: keploy - APP_PATH: /home/runner/work/node-express-graphql-template/node-express-graphql-template + APP_PATH: ${APP_PATH} ports: - 9000:9000 env_file: - - .env.local + - .env.${ENVIRONMENT_NAME} networks: - keploy-network volumes: