From 2f062cf5c73097a19599b7f9c11dafe854d0f5c8 Mon Sep 17 00:00:00 2001 From: John Berlin Date: Mon, 9 Jul 2018 16:21:14 -0400 Subject: [PATCH] New integration tests using webrecorder-tests: (#355) New integration tests using webrecorder-tests: - WR_TEST=true is set for integration test run (only run with py3.6, excluded for py2.7, 3.5) - Added .travis directory that includes two scripts: install.sh and test.sh. - install.sh handles all installation and test.sh handles running of unit or integration tests - sudo: true required to run headless chrome --- .travis.yml | 30 ++++++++++++++++++++---------- .travis/install.sh | 15 +++++++++++++++ .travis/test.sh | 10 ++++++++++ 3 files changed, 45 insertions(+), 10 deletions(-) create mode 100755 .travis/install.sh create mode 100755 .travis/test.sh diff --git a/.travis.yml b/.travis.yml index dbc29343..63e6c5cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,16 @@ python: os: - linux +addons: + apt: + packages: + # This is required to run new chrome on old trusty + - libnss3 + +env: + - WR_TEST=no + - WR_TEST=yes + addons: sauce_connect: true @@ -16,25 +26,25 @@ cache: - $HOME/.cache/pip - node_modules -sudo: false +sudo: true install: - #- pip install boto certauth youtube-dl - #- pip install git+https://github.com/esnme/ultrajson.git - - python setup.py -q install - - pip install -r extra_requirements.txt - - pip install coverage pytest-cov coveralls - - pip install codecov - - npm install + - ./.travis/install.sh before_script: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start script: - - python setup.py test - - cd karma-tests && make test && cd .. + - ./.travis/test.sh after_success: - codecov +matrix: + exclude: + - env: WR_TEST=yes + python: "2.7" + - env: WR_TEST=yes + python: "3.5" + diff --git a/.travis/install.sh b/.travis/install.sh new file mode 100755 index 00000000..500dbdeb --- /dev/null +++ b/.travis/install.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +python setup.py -q install +pip install -r extra_requirements.txt +pip install coverage pytest-cov coveralls +pip install codecov +npm install + +if [ "$WR_TEST" = "yes" ]; then + git clone https://github.com/webrecorder/webrecorder-tests.git + cd webrecorder-tests + pip install --upgrade -r requirements.txt + ./bootstrap.sh +fi diff --git a/.travis/test.sh b/.travis/test.sh new file mode 100755 index 00000000..dbd51861 --- /dev/null +++ b/.travis/test.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + +if [ "$WR_TEST" = "no" ]; then + python setup.py test + cd karma-tests && make test && cd .. +else + cd webrecorder-tests + INTRAVIS=1 pytest -m "pywbtest" +fi