From 5ce08523f82153b1429d71899e8f8c9f09bf351e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 9 Jan 2019 14:21:45 +0100 Subject: [PATCH] split up script for unit and end-to-end tests so unit tests are not run as part of e2e tests --- .travis.yml | 9 ++------- scripts/travis/{test-riot.sh => build.sh} | 14 ------------- scripts/travis/end-to-end-tests.sh | 24 +++++++++++++++++++++++ scripts/travis/unit-tests.sh | 10 ++++++++++ 4 files changed, 36 insertions(+), 21 deletions(-) rename scripts/travis/{test-riot.sh => build.sh} (61%) mode change 100755 => 100644 create mode 100755 scripts/travis/end-to-end-tests.sh create mode 100644 scripts/travis/unit-tests.sh diff --git a/.travis.yml b/.travis.yml index b51f102cbf..2c414e7c59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,9 +14,7 @@ node_js: addons: chrome: stable install: - - npm install - ./scripts/travis/install-deps.sh - matrix: include: - name: Linting Checks @@ -25,12 +23,9 @@ matrix: - npm run lintwithexclusions - name: End-to-End Tests install: - - npm install - - ./scripts/travis/install-deps.sh - sudo apt-get install build-essential python2.7-dev libffi-dev python-pip python-setuptools sqlite3 libssl-dev python-virtualenv libjpeg-dev libxslt1-dev script: - - ./scripts/travis/test-riot.sh + - ./scripts/travis/end-to-end-tests.sh - name: Unit Tests script: - - npm run test - + - ./scripts/travis/unit-tests.sh diff --git a/scripts/travis/test-riot.sh b/scripts/travis/build.sh old mode 100755 new mode 100644 similarity index 61% rename from scripts/travis/test-riot.sh rename to scripts/travis/build.sh index d1c2804b2a..a353e38a06 --- a/scripts/travis/test-riot.sh +++ b/scripts/travis/build.sh @@ -24,18 +24,4 @@ rm -r node_modules/matrix-react-sdk ln -s "$REACT_SDK_DIR" node_modules/matrix-react-sdk npm run build -npm run test popd - -if [ "$TRAVIS_BRANCH" = "develop" ] -then - # run end to end tests - scripts/fetchdep.sh matrix-org matrix-react-end-to-end-tests master - pushd matrix-react-end-to-end-tests - ln -s $REACT_SDK_DIR/$RIOT_WEB_DIR riot/riot-web - # PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true ./install.sh - # CHROME_PATH=$(which google-chrome-stable) ./run.sh - ./install.sh - ./run.sh --travis - popd -fi diff --git a/scripts/travis/end-to-end-tests.sh b/scripts/travis/end-to-end-tests.sh new file mode 100755 index 0000000000..285458bd4b --- /dev/null +++ b/scripts/travis/end-to-end-tests.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# +# script which is run by the travis build (after `npm run test`). +# +# clones riot-web develop and runs the tests against our version of react-sdk. + +set -ev + +RIOT_WEB_DIR=riot-web +REACT_SDK_DIR=`pwd` + +if [ "$TRAVIS_BRANCH" = "develop" ] +then + scripts/travis/build.sh + # run end to end tests + scripts/fetchdep.sh matrix-org matrix-react-end-to-end-tests master + pushd matrix-react-end-to-end-tests + ln -s $REACT_SDK_DIR/$RIOT_WEB_DIR riot/riot-web + # PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true ./install.sh + # CHROME_PATH=$(which google-chrome-stable) ./run.sh + ./install.sh + ./run.sh --travis + popd +fi diff --git a/scripts/travis/unit-tests.sh b/scripts/travis/unit-tests.sh new file mode 100644 index 0000000000..a8e0a63b31 --- /dev/null +++ b/scripts/travis/unit-tests.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# +# script which is run by the travis build (after `npm run test`). +# +# clones riot-web develop and runs the tests against our version of react-sdk. + +set -ev + +scripts/travis/build.sh +npm run test