From 549024f496db863deee3c893378dbc9177884923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fleschenberg?= Date: Thu, 28 Jul 2016 14:37:35 +0200 Subject: [PATCH 01/10] Prepare tox and travis for client-side tests --- .travis.yml | 7 ++++++- tox.ini | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 12bc119..74e2632 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,11 +9,16 @@ env: - DJANGOVER=django17 - DJANGOVER=django18 - DJANGOVER=django19 + - CLIENT_TESTS=1 matrix: exclude: - python: 3.5 env: DJANGOVER=django17 + - python: 2.7 + env: CLIENT_TESTS=1 + - python: 3.4 + env: CLIENT_TESTS=1 install: - pip install tox @@ -23,5 +28,5 @@ before_script: - sh -e /etc/init.d/xvfb start script: - - export TOX_ENV=py${TRAVIS_PYTHON_VERSION/./}-${DJANGOVER} + - "if [[ $CLIENT_TESTS == '1' ]]; then export TOX_ENV=client-tests; else; export TOX_ENV=py${TRAVIS_PYTHON_VERSION/./}-${DJANGOVER}; fi" - tox -r -e "$TOX_ENV" diff --git a/tox.ini b/tox.ini index 04c2f1f..474bd3a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = coverage-clean, py{27,34,35}-django{18,19}, py{27,34}-django17, coverage-report +envlist = client-tests, coverage-clean, py{27,34,35}-django{18,19}, py{27,34}-django17, coverage-report skipsdist = true [testenv] @@ -22,6 +22,13 @@ deps= django18: Django==1.8.14 django19: Django==1.9.8 +[testenv:client-tests] +commands = + # Insert JS test commands here and change or remove whitelist_externals + true +whitelist_externals = + true + [testenv:coverage-clean] commands = rm -f .coverage deps= From 8ff05c1ef3c940e410fa7f9039e6e3fd68906573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fleschenberg?= Date: Thu, 28 Jul 2016 14:41:23 +0200 Subject: [PATCH 02/10] Fix bash syntax --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 74e2632..ec40a55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,5 +28,5 @@ before_script: - sh -e /etc/init.d/xvfb start script: - - "if [[ $CLIENT_TESTS == '1' ]]; then export TOX_ENV=client-tests; else; export TOX_ENV=py${TRAVIS_PYTHON_VERSION/./}-${DJANGOVER}; fi" + - "if [[ $CLIENT_TESTS == '1' ]]; then export TOX_ENV=client-tests; else export TOX_ENV=py${TRAVIS_PYTHON_VERSION/./}-${DJANGOVER}; fi" - tox -r -e "$TOX_ENV" From f79d256764504b6c76dd7dbd0e6a3a9e0516c905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fleschenberg?= Date: Thu, 28 Jul 2016 14:59:41 +0200 Subject: [PATCH 03/10] The travis shell doesn't have pushd, apparently --- tox.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 88f1277..15a814a 100644 --- a/tox.ini +++ b/tox.ini @@ -37,8 +37,7 @@ whitelist_externals = [testenv:client-tests] commands = - pushd . cd client npm install npm run test-single-run - popd + cd .. From 77b4880d8b86803011f1265910653d62c30ac464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fleschenberg?= Date: Thu, 28 Jul 2016 15:12:49 +0200 Subject: [PATCH 04/10] Fix working directory for client-tests --- tox.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 15a814a..23df3fb 100644 --- a/tox.ini +++ b/tox.ini @@ -36,8 +36,7 @@ whitelist_externals = coverage [testenv:client-tests] +changedir = {toxinidir}/client commands = - cd client npm install npm run test-single-run - cd .. From d472dc2cb9df5daa94346f7c6ad0ed4d4c6886fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fleschenberg?= Date: Thu, 28 Jul 2016 15:19:01 +0200 Subject: [PATCH 05/10] tox: whitelist npm --- tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index 23df3fb..8b3cfa5 100644 --- a/tox.ini +++ b/tox.ini @@ -40,3 +40,5 @@ changedir = {toxinidir}/client commands = npm install npm run test-single-run +whitelist_externals = + /usr/bin/npm From 07fa46b306e509288e6689933d037b6734a64d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fleschenberg?= Date: Thu, 28 Jul 2016 15:27:55 +0200 Subject: [PATCH 06/10] Fix npm whitelisting --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 8b3cfa5..1aee20e 100644 --- a/tox.ini +++ b/tox.ini @@ -41,4 +41,4 @@ commands = npm install npm run test-single-run whitelist_externals = - /usr/bin/npm + npm From d2a0657aa50e303302446149dd347b5714cff657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fleschenberg?= Date: Thu, 28 Jul 2016 15:39:36 +0200 Subject: [PATCH 07/10] Use firefox for client tests ChromeCanary is not available on travis, it seems --- client/karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/karma.conf.js b/client/karma.conf.js index 8a14d9a..886f28a 100644 --- a/client/karma.conf.js +++ b/client/karma.conf.js @@ -39,7 +39,7 @@ module.exports = function(config) { // - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`) // - PhantomJS // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`) - browsers: ['ChromeCanary'], + browsers: ['Firefox'], // If browser does not capture in given timeout [ms], kill it captureTimeout: 60000, From fa4a6bcc6a2b8f1452c27c852a293904fbabade3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fleschenberg?= Date: Thu, 28 Jul 2016 16:08:20 +0200 Subject: [PATCH 08/10] Maybe lowercase works? --- client/karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/karma.conf.js b/client/karma.conf.js index 886f28a..cbe0f6c 100644 --- a/client/karma.conf.js +++ b/client/karma.conf.js @@ -39,7 +39,7 @@ module.exports = function(config) { // - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`) // - PhantomJS // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`) - browsers: ['Firefox'], + browsers: ['firefox'], // If browser does not capture in given timeout [ms], kill it captureTimeout: 60000, From 875b5ce8ecd0d1fd1268be9716163c08c41bfbc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fleschenberg?= Date: Thu, 28 Jul 2016 16:09:02 +0200 Subject: [PATCH 09/10] Give xvfb time to start --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ec40a55..d1cdaab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,7 @@ install: before_script: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start + - sleep 3 script: - "if [[ $CLIENT_TESTS == '1' ]]; then export TOX_ENV=client-tests; else export TOX_ENV=py${TRAVIS_PYTHON_VERSION/./}-${DJANGOVER}; fi" From ed130dbfea8c5de225d630b1d6d65bb10f10d87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fleschenberg?= Date: Thu, 28 Jul 2016 16:23:19 +0200 Subject: [PATCH 10/10] Fix karma config --- client/karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/karma.conf.js b/client/karma.conf.js index cbe0f6c..886f28a 100644 --- a/client/karma.conf.js +++ b/client/karma.conf.js @@ -39,7 +39,7 @@ module.exports = function(config) { // - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`) // - PhantomJS // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`) - browsers: ['firefox'], + browsers: ['Firefox'], // If browser does not capture in given timeout [ms], kill it captureTimeout: 60000,