diff --git a/.travis.yml b/.travis.yml index 4bb86a87..94bb48a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ language: node_js node_js: + - "4" + - "5" - "6" - "7" - "8" diff --git a/packages/grpc-js-core/gulpfile.js b/packages/grpc-js-core/gulpfile.js index e6826242..18fb9e4c 100644 --- a/packages/grpc-js-core/gulpfile.js +++ b/packages/grpc-js-core/gulpfile.js @@ -1,3 +1,5 @@ +'use strict'; + const _gulp = require('gulp'); const help = require('gulp-help'); @@ -58,10 +60,12 @@ function makeCompileFn(globs) { const copyGlob = globs.copy || '!(**/*)'; return () => { const tsProject = typescript.createProject(tsconfigPath, tsDevOptions)(); - const { dts, js } = gulp.src(transpileGlob, { base: jsCoreDir }) + const data = gulp.src(transpileGlob, { base: jsCoreDir }) .pipe(sourcemaps.init()) .pipe(tsProject) .on('error', onError); + const dts = data.dts; + const js = data.js; const jsmap = js.pipe(sourcemaps.write('.', { includeContent: false, sourceRoot: '..' diff --git a/run-tests.sh b/run-tests.sh index c05b0179..41f7b6b7 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -14,29 +14,32 @@ # limitations under the License. # Install NVM +ROOT=`pwd` +cd ~ +export NVM_DIR=`pwd`/.nvm curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.4/install.sh | bash # Load NVM -. ~/.nvm/nvm.sh +. $NVM_DIR/nvm.sh -set -e -repo_root=$(dirname $0) -cd $repo_root +set -ex +cd $ROOT -if [ "x$node_versions" = "x" ] ; then - node_versions="6 7 8" +if [ ! -n "$node_versions" ] ; then + node_versions="4 5 6 7 8" fi # TODO(mlumish): Add electron tests for version in ${node_versions} do - cd $repo_root + cd $ROOT # Install and setup node for the version we want. - set +e + set +ex + echo "Switching to node version $version" nvm install $version nvm use $version - set -e + set -ex # Install dependencies and link packages together. npm install diff --git a/test-grpc-submodule.sh b/test-grpc-submodule.sh new file mode 100755 index 00000000..35c3f3b0 --- /dev/null +++ b/test-grpc-submodule.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# Copyright 2017 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This script updates the gRPC submodule to a given reference and run tests + +cd packages/grpc-native-core/deps/grpc/ + +# PR references are needed to test PRs from grpc/grpc +git fetch --tags --progress https://github.com/grpc/grpc.git +refs/pull/*:refs/remotes/origin/pr/* +git checkout $@ +git submodule update --init +cd ../../../.. + +packages/grpc-native-core/tools/buildgen/generate_projects.sh + +./run-tests.sh