From 4ddaf8883dead4b9691e987dd35ecb988433ca6a Mon Sep 17 00:00:00 2001 From: Akarshit Wal Date: Wed, 15 Sep 2021 22:52:05 -0600 Subject: [PATCH] chore: add integration tests Signed-off-by: Akarshit Wal --- .circleci/config.yml | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 426ec79..33c0d6e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,9 +27,9 @@ jobs: - restore_cache: keys: - - v1-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- + - v1-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- - run: npx semantic-release @@ -42,12 +42,32 @@ jobs: - restore_cache: keys: - - v1-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- + - v1-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- - run: npm run lint + test-integration: + docker: + - image: circleci/node:14.11.0-stretch + # Integration tests need MongoDB server running and accessible on port 27017 + - image: circleci/mongo:4.0.0 + command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger + ports: + - "27017:27017" + steps: + - checkout + - run: + name: Run Integration Tests + environment: + MONGO_URL: mongodb://localhost:27017/test + MONGO_USE_UNIFIED_TOPOLOGY: false + command: | + sudo apt-get install -y mongodb + mongo --eval "rs.initiate()" + npx --quiet --package @reactioncommerce/ci-scripts@1.12.2 run-integration-tests + test: docker: - image: node:12.14.1 @@ -57,9 +77,9 @@ jobs: - restore_cache: keys: - - v1-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- + - v1-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- - run: npm run test @@ -75,11 +95,15 @@ workflows: - test: requires: - build + - test-integration: + requires: + - build - deploy: context: reaction-publish-semantic-release requires: - lint - test + - test-integration filters: branches: only: trunk