From 77405c27fbd8e5485d3c2a629bbec8296d740e56 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 21 Oct 2016 14:31:46 -0700 Subject: [PATCH 1/5] exclude mason_packages from coverage reporting - refs #117 --- .travis.yml | 15 +++++++-------- scripts/test.sh | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 08fcbeef5..9f3bca0d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,15 +52,14 @@ env: before_install: - export COVERAGE=${COVERAGE:-false} +- export PYTHONUSERBASE=$(pwd)/.local +- mkdir -p ${PYTHONUSERBASE} - if [[ ${COVERAGE} == true ]]; then - brew update; - brew install pyenv; - eval "$(pyenv init -)"; - pyenv install 2.7.6; - pyenv global 2.7.6; - pyenv rehash; - pip install cpp-coveralls; - pyenv rehash; + if [[ $(uname -s) == 'Linux' ]]; then + pip install --user cpp-coveralls; + else + easy_install --user cpp-coveralls; + fi; fi; - ./scripts/install_node.sh diff --git a/scripts/test.sh b/scripts/test.sh index f82017218..ec0f0b8cd 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -9,5 +9,5 @@ nvm use ${NODE_VERSION} npm test if [[ ${COVERAGE} == true ]]; then - cpp-coveralls --exclude node_modules --exclude tests --build-root build --gcov-options '\-lp' --exclude doc --exclude build/Debug/obj/gen + ${PYTHONUSERBASE}/bin/cpp-coveralls --exclude node_modules --exclude mason_packages --exclude tests --build-root build --gcov-options '\-lp' --exclude doc --exclude build/Debug/obj/gen fi From 2ab01b68ce7c446252417f3540bdc3e32f44b7f7 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 21 Oct 2016 14:39:56 -0700 Subject: [PATCH 2/5] simplify nvm usage --- .travis.yml | 2 +- scripts/install.sh | 3 --- scripts/install_node.sh | 18 +++++++++++++----- scripts/test.sh | 3 --- scripts/travis_publish.sh | 2 -- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9f3bca0d0..9edbe0580 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,7 +61,7 @@ before_install: easy_install --user cpp-coveralls; fi; fi; -- ./scripts/install_node.sh +- ./scripts/install_node.sh ${NODE_VERSION} install: - ./scripts/install.sh diff --git a/scripts/install.sh b/scripts/install.sh index 67999b9d8..021d9018f 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -5,9 +5,6 @@ set -o pipefail source ./scripts/install_mason.sh -source ~/.nvm/nvm.sh -nvm use ${NODE_VERSION} - if [[ ${COVERAGE} == true ]]; then npm install --build-from-source --debug --clang; else diff --git a/scripts/install_node.sh b/scripts/install_node.sh index 6ed19a800..6fb7632f8 100755 --- a/scripts/install_node.sh +++ b/scripts/install_node.sh @@ -3,14 +3,22 @@ set -e set -o pipefail -if [ ! -d ~/.nvm ]; then - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.28.0/install.sh | bash +if [[ ${1:-false} == 'false' ]]; then + echo "Error: pass node version as first argument" + exit 1 fi -source ~/.nvm/nvm.sh +NODE_VERSION=$1 -nvm install ${NODE_VERSION} -nvm alias default ${NODE_VERSION} +# if an existing nvm is already installed we need to unload it +nvm unload || true +# here we set up the node version on the fly based on the matrix value. +# This is done manually so that the build works the same on OS X +rm -rf ./__nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ./__nvm +source ./__nvm/nvm.sh +nvm install ${NODE_VERSION} +nvm use ${NODE_VERSION} node --version npm --version +which node \ No newline at end of file diff --git a/scripts/test.sh b/scripts/test.sh index ec0f0b8cd..149894d3b 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -3,9 +3,6 @@ set -e set -o pipefail -source ~/.nvm/nvm.sh -nvm use ${NODE_VERSION} - npm test if [[ ${COVERAGE} == true ]]; then diff --git a/scripts/travis_publish.sh b/scripts/travis_publish.sh index 8d618b1c8..5c70a704b 100755 --- a/scripts/travis_publish.sh +++ b/scripts/travis_publish.sh @@ -14,8 +14,6 @@ COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n') PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") if [[ ${TRAVIS_TAG} == v${PACKAGE_JSON_VERSION} ]] || test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE" && [[ ${COVERAGE} == false ]]; then - source ~/.nvm/nvm.sh - nvm use $NODE_VERSION npm install aws-sdk From d50b4cfa905de428e3b2660ce487ae32bd5b9322 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 21 Oct 2016 14:41:04 -0700 Subject: [PATCH 3/5] nest sudo:false --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9edbe0580..60064e7f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,4 @@ -# Prevent Travis from exporting CXX after matrix env -language: c - -sudo: false +language: generic matrix: include: @@ -13,15 +10,19 @@ matrix: - os: linux compiler: clang env: CXX=clang++-3.5 NODE_VERSION=5 + sudo: false - os: linux compiler: clang env: CXX=clang++-3.5 NODE_VERSION=4 + sudo: false - os: linux compiler: clang env: CXX=clang++-3.5 NODE_VERSION=0.12 + sudo: false - os: linux compiler: clang env: CXX=clang++-3.5 NODE_VERSION=0.10 + sudo: false # OS X - os: osx osx_image: xcode7 From 8eed7501058c8a2de91940aaca9cc04a2b2f5cc9 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 21 Oct 2016 14:43:29 -0700 Subject: [PATCH 4/5] gah nvm --- scripts/install_node.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install_node.sh b/scripts/install_node.sh index 6fb7632f8..679b1fc46 100755 --- a/scripts/install_node.sh +++ b/scripts/install_node.sh @@ -16,9 +16,11 @@ nvm unload || true # here we set up the node version on the fly based on the matrix value. # This is done manually so that the build works the same on OS X rm -rf ./__nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ./__nvm +set +e +set +u source ./__nvm/nvm.sh nvm install ${NODE_VERSION} nvm use ${NODE_VERSION} node --version npm --version -which node \ No newline at end of file +which node From 02b473356de0720ab97d1c55ab826a7222976115 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 21 Oct 2016 15:04:07 -0700 Subject: [PATCH 5/5] need to source 'install_node' --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 60064e7f0..658d0a29c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,7 +62,7 @@ before_install: easy_install --user cpp-coveralls; fi; fi; -- ./scripts/install_node.sh ${NODE_VERSION} +- source ./scripts/install_node.sh ${NODE_VERSION} install: - ./scripts/install.sh