updated mocha-cov dependency to be custom fork that provides valuable information to coveralls, added engine info to package.json, disable styles for codeship, switched to code based pattern that is very specific since the entire es-js repo is stored withing a src directory on codeship
This commit is contained in:
@ -1,16 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#####
|
||||
# Start or stop a group for travis
|
||||
# Start a group of log output
|
||||
#####
|
||||
function group {
|
||||
re='start:'
|
||||
|
||||
if [[ $1 =~ $re ]]; then
|
||||
echo -e "\n\033[4m\033[1m$1\033[0m\033[0m"
|
||||
if [[ $CI_NAME = "codeship" ]]; then
|
||||
style='..'
|
||||
reset='..'
|
||||
else
|
||||
echo -e "-- $1 --\n"
|
||||
style='\x1b[1m\x1b[37m\x1b[4m'
|
||||
reset='\x1b[24m\x1b[39m\x1b[22m'
|
||||
fi
|
||||
|
||||
echo -en "\n\n${style}${1}${reset}\n"
|
||||
}
|
||||
|
||||
#####
|
||||
@ -29,10 +33,8 @@ function call {
|
||||
|
||||
function ensure_grunt {
|
||||
if [[ ! -x "`which grunt`" ]]; then
|
||||
group "start:install_grunt"
|
||||
echo "installing grunt-cli"
|
||||
group "installing grunt"
|
||||
call npm install --silent -g grunt-cli
|
||||
group "end:install_grunt"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -59,7 +61,7 @@ function manage_es {
|
||||
local SNAPSHOTS="$ROOT/.snapshots"
|
||||
local PIDS="$ROOT/.snapshots/pids"
|
||||
|
||||
group "start:$DO es"
|
||||
group "${DO}ing es"
|
||||
|
||||
if [ ! -d "$PIDS" ]; then
|
||||
call mkdir -p $PIDS
|
||||
@ -158,5 +160,4 @@ function manage_es {
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
group "end:$DO es"
|
||||
}
|
||||
@ -29,9 +29,9 @@ else
|
||||
fi
|
||||
|
||||
if [[ "$NODE_UNIT" != "0" ]]; then
|
||||
group "start:unit_tests"
|
||||
group "running unit tests"
|
||||
if [[ -n "$JENKINS" ]]; then
|
||||
$MOCHA test/unit/test_*.js --reporter $MOCHA_REPORTER 2> test/junit-node-unit.xml
|
||||
$MOCHA test/unit/tests/*.js --reporter $MOCHA_REPORTER 2> test/junit-node-unit.xml
|
||||
if [ "$?" -gt "0" ]; then
|
||||
echo "non-zero exit code: $RESULT"
|
||||
cat test/junit-node-unit.xml
|
||||
@ -39,15 +39,13 @@ if [[ "$NODE_UNIT" != "0" ]]; then
|
||||
else
|
||||
_grunt jshint mochacov:unit
|
||||
fi
|
||||
group "end:unit_tests"
|
||||
fi
|
||||
|
||||
if [[ "$NODE_INTEGRATION" != "0" ]]; then
|
||||
group "start:generate tests"
|
||||
group "generating tests"
|
||||
call node scripts/generate --no-api
|
||||
group "end:generate tests"
|
||||
|
||||
group "start:integration tests"
|
||||
group "running integration tests"
|
||||
if [[ -n "$JENKINS" ]]; then
|
||||
# convert TESTING_BRANCH into BRANCH_SUFFIX
|
||||
if [[ $TESTING_BRANCH = 'master' ]]; then
|
||||
@ -75,18 +73,15 @@ if [[ "$NODE_INTEGRATION" != "0" ]]; then
|
||||
_grunt mochacov:integration_$TESTING_BRANCH
|
||||
manage_es stop $TESTING_BRANCH $ES_RELEASE
|
||||
fi
|
||||
group "end:integration tests"
|
||||
fi
|
||||
|
||||
if [[ "$BROWSER_UNIT" == "1" ]]; then
|
||||
group "start:browser tests"
|
||||
group "running browser tests"
|
||||
_grunt browser_clients:build run:browser_test_server saucelabs-mocha
|
||||
group "end:browser tests"
|
||||
fi
|
||||
|
||||
if [[ "$COVERAGE" == "1" ]]; then
|
||||
group "start:ship coverage"
|
||||
group "shipping coverage"
|
||||
ensure_grunt
|
||||
grunt mochacov:ship_coverage
|
||||
group "stop:ship coverage"
|
||||
fi
|
||||
|
||||
@ -1,18 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source $HOME/.nvm/nvm.sh
|
||||
|
||||
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
source $HERE/_utils.sh
|
||||
source $HOME/.nvm/nvm.sh
|
||||
|
||||
case $1 in
|
||||
setup)
|
||||
group "start: installing nvm 0.10"
|
||||
group "installing nvm 0.10"
|
||||
nvm install 0.10
|
||||
group "end: installing nvm 0.10"
|
||||
|
||||
group "start: installing nvm 0.8"
|
||||
group "installing nvm 0.8"
|
||||
nvm install 0.8
|
||||
group "end: installing nvm 0.8"
|
||||
|
||||
manage_es install master
|
||||
manage_es install 0.90
|
||||
@ -20,27 +19,21 @@ case $1 in
|
||||
npm install
|
||||
;;
|
||||
run)
|
||||
# test in node 0.8
|
||||
group "start: test node 0.8"
|
||||
group "test node 0.8"
|
||||
nvm use 0.8
|
||||
echo "rebuilding npm deps"
|
||||
npm rebuild &> /dev/null
|
||||
npm --silent rebuild
|
||||
call ES_BRANCH=master ./scripts/ci.sh
|
||||
call ES_BRANCH=0.90 ./scripts/ci.sh
|
||||
group "end: test node 0.8"
|
||||
|
||||
# test in node 0.10
|
||||
group "start: test node 0.10"
|
||||
group "test node 0.10"
|
||||
nvm use 0.10
|
||||
echo "rebuilding npm deps"
|
||||
npm rebuild &> /dev/null
|
||||
npm --silent rebuild
|
||||
call ES_BRANCH=master COVERAGE=1 ./scripts/ci.sh
|
||||
call ES_BRANCH=0.90 ./scripts/ci.sh
|
||||
group "end: test node 0.10"
|
||||
|
||||
# browser tests (node version irrelevant)
|
||||
group "start: test browsers"
|
||||
group "test browsers"
|
||||
call NODE_UNIT=0 NODE_INTEGRATION=0 BROWSER_UNIT=1 ./scripts/ci.sh
|
||||
group "end: test browsers"
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user