From f9cec8a29061cacee9e2db94afb5bb58c0955812 Mon Sep 17 00:00:00 2001 From: Ibukun Dairo Date: Tue, 10 Mar 2020 23:14:42 +0100 Subject: [PATCH] Setup e2e enterprise tests --- .gitlab-ci.yml | 24 +++++++++++++++++++ docker-compose.yml | 10 +++++++- install.sh | 0 smoke-test/accounts.test.enterprise.js | 0 smoke-test/admin-dashboard.test.enterprise.js | 0 smoke-test/backend.test.enterprise.js | 0 smoke-test/dashboard.test.enterprise.js | 0 smoke-test/package.json | 9 ++++++- 8 files changed, 41 insertions(+), 2 deletions(-) mode change 100644 => 100755 install.sh create mode 100644 smoke-test/accounts.test.enterprise.js create mode 100644 smoke-test/admin-dashboard.test.enterprise.js create mode 100644 smoke-test/backend.test.enterprise.js create mode 100644 smoke-test/dashboard.test.enterprise.js diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d4d9376f62..464d6362ac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -697,6 +697,7 @@ e2e_docker_compose_test: # Install Docker Compose. - sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - sudo chmod +x /usr/local/bin/docker-compose + - export IS_SAAS_SERVICE=true # Install the cluster. - sudo bash install.sh # Set env var @@ -714,6 +715,29 @@ e2e_docker_compose_test: - release - master +e2e_docker_compose_enterprise_test: + stage: E2E + script: + - sudo apt-get update + - curl -sSL https://get.docker.com/ | sh #Install docker. + # Install Docker Compose. + - sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + - sudo chmod +x /usr/local/bin/docker-compose + # Install the cluster. + - sudo bash install.sh + # Set env var + - export ACCOUNTS_URL=http://localhost:3003 + - export ADMIN_DASHBOARD_URL=http://localhost:3100 + - export DASHBOARD_URL=http://localhost:3000 + - export BACKEND_URL=http://localhost:3002 + - cd smoke-test + - npm ci + - npm run enterprise-test + only: + refs: + - release + - master + # VERSION UPDATE version_update: before_script: diff --git a/docker-compose.yml b/docker-compose.yml index f265d6509e..9be4a580c1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,6 +22,7 @@ services: environment: - MONGO_URL=mongodb://mongo:27017/fyipedb - REDIS_HOST=redis + - IS_SAAS_SERVICE depends_on: - mongo - redis @@ -33,6 +34,8 @@ services: build: ./accounts env_file: - ./accounts/.env + environment: + - IS_SAAS_SERVICE depends_on: - backend @@ -42,8 +45,11 @@ services: build: ./dashboard env_file: - ./dashboard/.env + environment: + - IS_SAAS_SERVICE depends_on: - backend + - accounts home: ports: @@ -66,9 +72,11 @@ services: admin-dashboard: ports: - '3100:3100' + build: ./admin-dashboard env_file: - ./admin-dashboard/.env - build: ./admin-dashboard + environment: + - IS_SAAS_SERVICE depends_on: - backend - accounts diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 diff --git a/smoke-test/accounts.test.enterprise.js b/smoke-test/accounts.test.enterprise.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/smoke-test/admin-dashboard.test.enterprise.js b/smoke-test/admin-dashboard.test.enterprise.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/smoke-test/backend.test.enterprise.js b/smoke-test/backend.test.enterprise.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/smoke-test/dashboard.test.enterprise.js b/smoke-test/dashboard.test.enterprise.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/smoke-test/package.json b/smoke-test/package.json index 74d6e756cd..de197a713e 100644 --- a/smoke-test/package.json +++ b/smoke-test/package.json @@ -4,7 +4,8 @@ "description": "Smoke tests for fyipe", "main": "index.test.js", "scripts": { - "test": "jest --runInBand ." + "test": "jest --runInBand ./*.test.js", + "enterpise-test": "jest --runInBand ./*.test.enterprise.js" }, "keywords": [], "author": "", @@ -15,5 +16,11 @@ "jest": "^24.9.0", "puppeteer": "^1.19.0", "should": "^13.2.3" + }, + "jest": { + "testMatch": [ + "/**/*.test.js", + "/**/*.test.enterprise.js" + ] } }