From c316d03143f812d2a5a581dadde910ffcdd081ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20GAUTREAU?= Date: Mon, 2 Nov 2020 12:00:46 +0100 Subject: [PATCH] :bug: fix for e2e test --- .circleci/config.yml | 49 +++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7f9b8ef..7e63a85 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,57 +12,74 @@ workflows: - yarn - e2e-test: requires: - - yarn + - lint + - test jobs: yarn: docker: - - image: cimg/node:14.10.1 + - image: "circleci/node:12" steps: - checkout - restore_cache: - key: npm-v1-dependencies-{{ checksum "yarn.lock" }} + key: npm-v2-dependencies-{{ checksum "yarn.lock" }} - run: yarn global add node-gyp && yarn install - save_cache: - key: npm-v1-dependencies-{{ checksum "yarn.lock" }} + key: npm-v2-dependencies-{{ checksum "yarn.lock" }} paths: - ./node_modules lint: docker: - - image: cimg/node:14.10.1 + - image: "circleci/node:12" steps: - checkout - restore_cache: - key: npm-v1-dependencies-{{ checksum "yarn.lock" }} + key: npm-v2-dependencies-{{ checksum "yarn.lock" }} - run: yarn lint - run: yarn format:check test: docker: - - image: cimg/node:14.10.1 + - image: "circleci/node:12" steps: - checkout - restore_cache: - key: npm-v1-dependencies-{{ checksum "yarn.lock" }} + key: npm-v2-dependencies-{{ checksum "yarn.lock" }} - run: yarn test:ci e2e-test: docker: - - image: cimg/node:14.10.1 + - image: "circleci/node:12" + environment: + DATABASE_URL: postgres://jeffyshewan:password@localhost:5432/testbdd + JWT_SECRET: ARMA_eau_de_combat + API_PORT: 3000 + API_HOST: localhost + API_PROTOCOL: http + + - image: "circleci/postgres:9.6.2-alpine" environment: - DATABASE_URL: postgres://psqluer:psqlpassword@localhost:5432/psdb - JWT_SECRET: ARMA, l'eau de combat - API_PORT: 3000 - API_HOST: localhost - API_PROTOCOL: http + POSTGRES_USER: jeffyshewan + POSTGRES_DB: testbdd + POSTGRES_PASSWORD: password steps: - checkout - restore_cache: - key: npm-v1-dependencies-{{ checksum "yarn.lock" }} + key: npm-v2-dependencies-{{ checksum "yarn.lock" }} + + - run: + name: connecting postgres + command: dockerize -wait tcp://localhost:5432 -timeout 1m + - run: + name: start e2e test + command: yarn test:e2e - - run: yarn test:e2e \ No newline at end of file + - save_cache: + key: npm-v2-dependencies-{{ checksum "yarn.lock" }} + paths: + - ./node_modules