Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the Travis JS related tests #300

Open
wants to merge 14 commits into
base: master
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
6 changes: 3 additions & 3 deletions .travis-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ BLACKLIST
if [[ $TASK = 'nosetests' ]]; then
nosetests --verbosity=3 --detailed-errors
elif [[ $TASK = 'karma' ]]; then
grunt --verbose unit-test
grunt --verbose --debug --stack unit-test
elif [[ $TASK = 'lint' ]]; then
grunt --verbose lint
grunt --verbose --debug --stack lint
elif [[ $TASK = 'closure-compiler' ]]; then
grunt --verbose closure-compiler
grunt --verbose --debug --stack closure-compiler
elif [[ $TASK = 'data-check' ]]; then
./tools/make_manufacturer_data.sh > data/manufacturer_data.py && git diff --exit-code data/manufacturer_data.py
elif [[ $TASK = 'spellintian' ]]; then
Expand Down
29 changes: 25 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
language: python

before_cache:
- rm -f $HOME/.cache/pip/log/debug.log # erase log
- rm -f $HOME/.cache/pip/log/debug.log # erase log
Comment on lines 3 to +4
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this still needed when using Travis's built-in definitions for the cache?

Copy link
Member Author

Choose a reason for hiding this comment

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

Honestly I'm not sure. At one point caching was only available in the pro one unless you configured it yourself! I don't know if it dealt with such subtleties too, so I'm tempted to leave it given it doesn't really do any harm.


cache:
apt: true
npm: true
pip: true
directories:
- $HOME/.npm
- $HOME/.cache/pip
Comment on lines 10 to 12
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need this if we use Travis's built-in definitions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Honestly I'm not sure. At one point caching was only available in the pro one unless you configured it yourself! I don't know if it dealt with such subtleties too, so I'm tempted to leave it given it doesn't really do any harm.


before_install:
#Switch node to the latest LTS version
- if [ "$TASK" = "karma" -o "$TASK" = "lint" -o "$TASK" = "closure-compiler" ]; then nvm install lts/* && nvm use lts/*; fi

install:
- if [ "$TASK" = "nosetests" -o "$TASK" = "flake8" -o "$TASK" = "flake8-wip" ]; then pip install json-spec; fi
- if [ "$TASK" = "karma" -o "$TASK" = "lint" -o "$TASK" = "closure-compiler" ]; then npm install -g grunt-cli; fi
- if [ "$TASK" = "karma" -o "$TASK" = "lint" -o "$TASK" = "closure-compiler" ]; then npm install; fi
- if [ "$TASK" = "karma" -o "$TASK" = "lint" -o "$TASK" = "closure-compiler" ]; then npm --verbose install -g grunt-cli; fi
- if [ "$TASK" = "karma" -o "$TASK" = "lint" -o "$TASK" = "closure-compiler" ]; then grunt --version --verbose; fi
- if [ "$TASK" = "karma" -o "$TASK" = "lint" -o "$TASK" = "closure-compiler" ]; then npm --verbose install; fi
- if [ "$TASK" = "flake8" -o "$TASK" = "flake8-wip" ]; then pip install flake8; fi
# If this causes SSL errors, then Sourceforge is probably in disaster recovery mode and needing Javascript. Could switch to a specific mirror, e.g. kent.dl.sourceforge.net
- if [ "$TASK" = "pychecker" -o "$TASK" = "pychecker-wip" ]; then pip install http://sourceforge.net/projects/pychecker/files/pychecker/0.8.19/pychecker-0.8.19.tar.gz/download; fi
- if [ "$TASK" = "codespell" ]; then pip install git+https://github.com/codespell-project/codespell.git; fi

after_failure:
- if [ -f /home/travis/.npm/_logs/*-debug.log ]; then cat /home/travis/.npm/_logs/*-debug.log; fi

matrix:
fast_finish: true
include:
Expand All @@ -27,7 +38,17 @@ matrix:
- os: linux
dist: focal
arch: arm64
env: TASK="karma"
env:
- TASK="karma"
# Make Firefox headless
- MOZ_HEADLESS=1
# Mozilla doesn't currently support nightly arm64 builds, so install via apt instead
#addons:
# firefox: latest
addons:
apt:
packages:
- firefox
services:
- xvfb
- os: linux
Expand Down
7 changes: 3 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = function(grunt) {
build: {
files: [{
dest: './static/js/rdm.js',
src: './js_src/rdm.js'//TODO(dave): change this to ./js_scr/*js
src: './js_src/rdm.js'//TODO(dave): change this to ./js_src/*js
}],
options: {
mangle: true,
Expand Down Expand Up @@ -61,7 +61,7 @@ module.exports = function(grunt) {
jshint: {
dev: [
'Gruntfile.js',
'js_src/rdm.js',//TODO(dave): change this to ./js_scr/*js
'js_src/rdm.js',//TODO(dave): change this to ./js_src/*js
'unit-test-js/karma.conf.js',
'unit-test-js/tests/*js'
],
Expand All @@ -72,12 +72,11 @@ module.exports = function(grunt) {
jscs: {
src: [
'Gruntfile.js',
'js_src/rdm.js',//TODO(dave): change this to ./js_scr/*js
'js_src/rdm.js',//TODO(dave): change this to ./js_src/*js
'unit-test-js/karma.conf.js',
'unit-test-js/tests/*js'
],
options: {
verbose: true,
config: true
}
},
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rdm-app",
"version": "0.1.0",
"version": "0.1.1",
"repository": "OpenLightingProject/rdm-app",
"author": {
"name": "Open Lighting Project",
Expand All @@ -17,21 +17,21 @@
"google-closure-compiler": "^20170910.0.0",
"google-closure-library": "^20170910.0.0",
"grunt": "^1.0.0",
"grunt-bower-task": "~0.4.0",
"grunt-contrib-clean": "~0.6.0",
"grunt-bower-task": "~0.6.2",
"grunt-contrib-clean": "~2.0.1",
"grunt-contrib-copy": "~0.8.0",
"grunt-contrib-jshint": "^0.12.0",
"grunt-contrib-uglify": "~0.9.1",
"grunt-contrib-watch": "~0.6.1",
"grunt-jscs": "^1.8.0",
"grunt-karma": "^0.12.2",
"grunt-stylelint": "^0.13.0",
"karma": "^1.6.0",
"karma-chrome-launcher": "~0.1",
"karma-firefox-launcher": "~0.1",
"karma-jasmine": "~0.2.0",
"olp-javascript-style": "openlightingproject/javascript-style",
"stylelint": "^12.0.1",
"stylelint-config-recommended": "^3.0.0"
"grunt-contrib-watch": "~1.1.0",
"grunt-jscs": "^3.0.1",
"grunt-karma": "^4.0.2",
"grunt-stylelint": "^0.16.0",
"karma": "^6.4.0",
"karma-chrome-launcher": "~3.1.1",
"karma-firefox-launcher": "~2.1.2",
"karma-jasmine": "~5.1.0",
"olp-javascript-style": "git://github.com/OpenLightingProject/javascript-style",
"stylelint": "^13.8.0",
"stylelint-config-recommended": "^5.0.0"
}
}