Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Split JS tests into a separate build #1070

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -29,25 +32,27 @@ 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'"
- "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"
- "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
- "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:
- ./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"
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@
}
},
"dependencies": {
"lodash": "~2.4.1",
"q": "~0.9.7",
"vumigo_v01": "~0.1.22",
"vumigo_v02": "~0.2"
},
"optionalDependencies": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Failure to install optional dependencies doesn't fail the install process, which might be annoying -- https://docs.npmjs.com/files/package.json#optionaldependencies.

Just mentioning this in case others feel it's a show stopper.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I don't think we can consider these deps optional.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only alternatives I can think of are listing them in a file and running cat extra-node-deps.txt | xargs npm install or something, or having a second package.json with the extra deps it in that we can install separately. I really don't want to leave these in dependencies, because installing libxmljs takes rather a long time.

(FWIW, these deps are optional in the sense that nothing in vumi-go depends on them -- they're only required by some jsbox apps.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, ideally those deps shouldn't be in the vumi-go repo, they're needed in production, not here. A better solution would be to have a separate package.json for production with these dependencies in that doesn't live in this repo. Maybe we should do something like that instead? In the mean time, I do think its going to be safer to not make these deps optional here. There's potential for deploys to go bad if dependencies that need to be deployed aren't deployed.

"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",
Expand Down