From 599e7121815735a4e514c68aeedef1f92e7f20fc Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 26 Jun 2019 19:39:13 +0200 Subject: [PATCH] fail faster on Travis --- .travis.yml | 3 +++ package.json | 2 +- scripts/test.sh | 6 +----- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 03f2406..be68b97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,10 @@ before_install: script: # - ./scripts/install.sh # runs automatically with npm ci + # executing `npm test` scripts individually here, so first one failing will exit the build + - npm run lint || travis_terminate 1 - ./scripts/test.sh || travis_terminate 1 + - npm run test:e2e || travis_terminate 1 - ./scripts/coverage.sh - ./scripts/build.sh diff --git a/package.json b/package.json index 7aedac4..c96d56d 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "start": "concurrently \"cd client && npm start\" \"cd server && npm start\"", "start:commons-and-ganache": "concurrently 'npm run start:ganache' 'npm run start'", "build": "./scripts/build.sh", - "test": "npm run lint && scripts/test.sh", + "test": "npm run lint && scripts/test.sh && npm run test:e2e", "test:e2e": "start-test start:commons-and-ganache http-get://localhost:3000 cypress:run", "test:watch": "npm run lint && concurrently \"cd client && npm run test:watch\" \"cd server && npm run test:watch\"", "start:ganache": "ganache-cli -m 'stamp polar cup smart ill agree human episode reform trigger text forget' -i 5777", diff --git a/scripts/test.sh b/scripts/test.sh index 78c67e3..244698b 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,4 +1,4 @@ -#/usr/bin/env/sh +#!/bin/bash set -e components="server client" @@ -10,7 +10,3 @@ do npm test cd .. done - -echo "Running End-to-End tests" - -npm run test:e2e