Skip to content

Commit

Permalink
CI: Javascript unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
aarranz committed Apr 23, 2018
1 parent f899e5b commit e03ed6b
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 6 deletions.
21 changes: 19 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,25 @@ python:
- "3.4"
- "3.5"
- "3.6"

matrix:
include:
- node_js: "lts/*"
python: ~
addons:
chrome: stable
firefox: latest-esr
env: TEST_SUITE=js_unittests

before_install:
- . src/ci_scripts/travis_before_install.sh

before_script:
- . src/ci_scripts/travis_before_script.sh

script:
- src/ci_scripts/travis.sh sqlite3 django$DJANGO_VERSION unittest

branches:
only:
- develop
only:
- develop
14 changes: 10 additions & 4 deletions src/GruntFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,11 @@ module.exports = function (grunt) {
styledelements: {
options: {
coverageReporter: {
type : 'html',
dir : 'build/coverage/styledelements'
reporters: [
{type: 'html', dir: 'build/coverage/styledelements', subdir: 'html'},
{type: 'cobertura', dir: 'build/coverage/styledelements', subdir: 'xml'},
{type: 'lcov', dir: 'build/coverage/styledelements', subdir: 'lcov'},
]
},
files: dependencies.concat(styledElementsFiles).concat(['js_tests/styledelements/*Spec.js']),
preprocessors: {
Expand All @@ -174,8 +177,11 @@ module.exports = function (grunt) {
wirecloud: {
options: {
coverageReporter: {
type : 'html',
dir : 'build/coverage/wirecloud'
reporters: [
{type: 'html', dir: 'build/coverage/wirecloud', subdir: 'html'},
{type: 'cobertura', dir: 'build/coverage/wirecloud', subdir: 'xml'},
{type: 'lcov', dir: 'build/coverage/wirecloud', subdir: 'lcov'},
]
},
files: dependencies.concat(styledElementsFiles).concat(wc_dependencies).concat(WirecloudFiles).concat(['js_tests/wirecloud/**/*Spec.js']),
preprocessors: {
Expand Down
7 changes: 7 additions & 0 deletions src/ci_scripts/travis.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/usr/bin/env bash

if [ "${TEST_SUITE}" == "js_unittests" ]; then
cd $TRAVIS_BUILD_DIR/src
grunt ci
exit
fi


export WC_INSTANCE_NAME=test_instance
[ -n "${IP_ADDR}" ] || IP_ADDR="localhost"

Expand Down
5 changes: 5 additions & 0 deletions src/ci_scripts/travis_before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if [ "${TEST_SUITE}" == "js_unittests" ]; then
cd $TRAVIS_BUILD_DIR/src
npm install grunt-cli -g
cd $TRAVIS_BUILD_DIR
fi
5 changes: 5 additions & 0 deletions src/ci_scripts/travis_before_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if [ "${TEST_SUITE}" == "js_unittests" ]; then
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
sleep 3 # give xvfb some time to start
fi

0 comments on commit e03ed6b

Please sign in to comment.