Skip to content

Commit

Permalink
Add functional tests to circleci
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsmorais committed Oct 7, 2018
1 parent 54042a5 commit 2e344f4
Showing 1 changed file with 34 additions and 9 deletions.
43 changes: 34 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,50 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:8

- image: circleci/node:8-browsers
working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: yarn install

- run:
name: Install dependencies
command: yarn
- run:
name: Run unit tests with coverage
command: yarn test:coverage && cat ./tests/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
- run:
name: Start functional tests server
command: yarn start:server
background: true
- run:
name: Wait for functional tests server to be initialized
command: |
TIMEOUT=30
until curl 'http://localhost:8008/' > /dev/null 2>&1 || [ $TIMEOUT -eq 0 ]; do
echo "Waiting for functional tests server, $((TIMEOUT--)) remaining attempts..."
sleep 1
done
- run:
name: Start selenium
command: yarn start:selenium
background: true
- run:
name: Wait for selenium to be initialized
command: |
TIMEOUT=30
until curl 'http://localhost:4444/' > /dev/null 2>&1 || [ $TIMEOUT -eq 0 ]; do
echo "Waiting for selenium, $((TIMEOUT--)) remaining attempts..."
sleep 1
done
- run:
name: Run functional tests
command: yarn test:functional
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

- run: yarn test:coverage && cat ./tests/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

0 comments on commit 2e344f4

Please sign in to comment.