From e8b0b06a07d36e6a6adbb719ad355a1abb7d87f2 Mon Sep 17 00:00:00 2001 From: Jeremy Thurgood Date: Tue, 25 Aug 2015 19:08:22 +0200 Subject: [PATCH 1/5] Make some JS libs optional. --- package.json | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9cebc91af..39e4ae515 100644 --- a/package.json +++ b/package.json @@ -9,17 +9,19 @@ } }, "dependencies": { + "lodash": "~2.4.1", + "q": "~0.9.7", + "vumigo_v01": "~0.1.22", + "vumigo_v02": "~0.2" + }, + "optionalDependencies": { "go-jsbox-location": "^0.2.0", "go-jsbox-ona": "^0.1.0", "go-jsbox-metrics-helper": "^0.1.0", "go-jsbox-xform": "^0.0.1", "jed": "~0.5.4", "libxmljs": "~0.8.1", - "lodash": "~2.4.1", - "moment": "~2.6", - "q": "~0.9.7", - "vumigo_v01": "~0.1.22", - "vumigo_v02": "~0.2" + "moment": "~2.6" }, "devDependencies": { "bower": "^1.3.11", From 356545cc071c80b5a83f49f6232eb61c431ad09c Mon Sep 17 00:00:00 2001 From: Jeremy Thurgood Date: Tue, 25 Aug 2015 19:08:42 +0200 Subject: [PATCH 2/5] Separate build job for JS things. --- .travis.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index cb6a20921..eb55f313b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,9 @@ matrix: # This is a separate matrix inclusion to avoid spawning unnecessary builds. - python: "2.7" env: RIAK_VERSION="1.4.12" VUMITEST_REDIS_DB=1 VUMI_TEST_TIMEOUT=10 VUMIGO_SKIP_DJANGO=1 + # Test JS stuff. + - python: "2.7" + env: TEST_JS_ONLY=1 VUMIGO_SKIP_DJANGO=1 cache: directories: @@ -36,7 +39,9 @@ install: - "if [ $VUMIGO_SKIP_DJANGO ]; then pip install -e .; else pip install -r requirements.pip; fi" - "pip install -r requirements-dev.pip" - "pip install overalls" - - "npm install" + # Minimal set of JS libs necessary for jsbox and dialogue app tests. + - "npm install --production --no-optional" + - "if [ $TEST_JS_ONLY ]; then npm install; fi" before_script: - "if [ ! $VUMIGO_SKIP_DJANGO ]; then utils/setup-test-database.sh; fi" @@ -46,8 +51,8 @@ before_script: - $HOME/riak/bin/riak version - $HOME/riak/bin/riak-admin member-status script: - - ./run-tests.sh - - grunt test + - "if [ ! $TEST_JS_ONLY ]; then ./run-tests.sh; else grunt test; fi" after_success: - "if [ ! $VUMIGO_SKIP_DJANGO ]; then overalls --py --lcov mochacov.lcov --lcov coverage/*/lcov.info; fi" + - "if [ $TEST_JS_ONLY ]; then overalls --lcov mochacov.lcov --lcov coverage/*/lcov.info; fi" From 13763bd2efba45808804e0ceb223156584afc2b4 Mon Sep 17 00:00:00 2001 From: Jeremy Thurgood Date: Tue, 25 Aug 2015 19:20:00 +0200 Subject: [PATCH 3/5] Only install Riak if we need it. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index eb55f313b..f51908b17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ services: before_install: # Set up an appropriate version of Riak. - - utils/setup_travis_riak.sh "${RIAK_VERSION}" + - "if [ ! $TEST_JS_ONLY ]; then utils/setup_travis_riak.sh ${RIAK_VERSION}; fi" install: # Travis seems to have pip 6.x, which doesn't build and cache wheels. - "pip install 'pip>=7.1.0'" From dc4911639aa593579c45946c818b9d23c72e04cc Mon Sep 17 00:00:00 2001 From: Jeremy Thurgood Date: Tue, 25 Aug 2015 19:29:41 +0200 Subject: [PATCH 4/5] Only poke Riak if we installed it. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f51908b17..b3d9dc24b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ services: before_install: # Set up an appropriate version of Riak. - - "if [ ! $TEST_JS_ONLY ]; then utils/setup_travis_riak.sh ${RIAK_VERSION}; fi" + - "[ ! $TEST_JS_ONLY ] && utils/setup_travis_riak.sh ${RIAK_VERSION}" install: # Travis seems to have pip 6.x, which doesn't build and cache wheels. - "pip install 'pip>=7.1.0'" @@ -48,8 +48,8 @@ before_script: - "export PYTHONPATH=." - "pip list" # To see what version of Riak we're running and check that it's happy. - - $HOME/riak/bin/riak version - - $HOME/riak/bin/riak-admin member-status + - "[ ! $TEST_JS_ONLY ] && $HOME/riak/bin/riak version" + - "[ ! $TEST_JS_ONLY ] && $HOME/riak/bin/riak-admin member-status" script: - "if [ ! $TEST_JS_ONLY ]; then ./run-tests.sh; else grunt test; fi" From 1323c670498cc976632d91757ae0823f47f9634e Mon Sep 17 00:00:00 2001 From: Jeremy Thurgood Date: Tue, 25 Aug 2015 19:51:48 +0200 Subject: [PATCH 5/5] Longer conditionals. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b3d9dc24b..f13763f71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ services: before_install: # Set up an appropriate version of Riak. - - "[ ! $TEST_JS_ONLY ] && utils/setup_travis_riak.sh ${RIAK_VERSION}" + - "if [ ! $TEST_JS_ONLY ]; then utils/setup_travis_riak.sh ${RIAK_VERSION}; fi" install: # Travis seems to have pip 6.x, which doesn't build and cache wheels. - "pip install 'pip>=7.1.0'" @@ -48,8 +48,8 @@ before_script: - "export PYTHONPATH=." - "pip list" # To see what version of Riak we're running and check that it's happy. - - "[ ! $TEST_JS_ONLY ] && $HOME/riak/bin/riak version" - - "[ ! $TEST_JS_ONLY ] && $HOME/riak/bin/riak-admin member-status" + - "if [ ! $TEST_JS_ONLY ]; then $HOME/riak/bin/riak version; fi" + - "if [ ! $TEST_JS_ONLY ]; then $HOME/riak/bin/riak-admin member-status; fi" script: - "if [ ! $TEST_JS_ONLY ]; then ./run-tests.sh; else grunt test; fi"