From 574a2c7fda26c22b4487186b59c3493210d7a245 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 16 Sep 2017 02:28:53 +0200 Subject: [PATCH 1/6] Adding support for Node 4 and 5. --- packages/grpc-js-core/gulpfile.js | 6 ++++-- run-tests.sh | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/grpc-js-core/gulpfile.js b/packages/grpc-js-core/gulpfile.js index cdf046ee..4ce7ced9 100644 --- a/packages/grpc-js-core/gulpfile.js +++ b/packages/grpc-js-core/gulpfile.js @@ -31,7 +31,7 @@ const files = !util.env.file ? [] : Array.isArray(util.env.file) ? util.env.file : [util.env.file]; // If --dev is passed, override certain ts config options -let tsDevOptions = {}; +var tsDevOptions = {}; if (util.env.dev) { tsDevOptions = { allowUnreachableCode: true, @@ -58,10 +58,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(jsCoreDir, { includeContent: false, sourceRoot: path.resolve(jsCoreDir, '..') diff --git a/run-tests.sh b/run-tests.sh index 2fce4dd4..ace62284 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -22,8 +22,8 @@ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.4/install.sh | b set -e cd $(dirname $0) -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 From 463e6ea93a2e8e32b960e16d940dfe230566950a Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 16 Sep 2017 02:31:07 +0200 Subject: [PATCH 2/6] Adding also 4 and 5 on Travis. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) 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" From 5680ac7d334d75ce2600821c04d61f7c70991340 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 16 Sep 2017 02:38:08 +0200 Subject: [PATCH 3/6] Adding debug message. --- run-tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/run-tests.sh b/run-tests.sh index ace62284..5c375036 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -32,6 +32,7 @@ for version in ${node_versions} do # Install and setup node for the version we want. set +e + echo "Switching to node version $version" nvm install $version nvm use $version set -e From c733b451dbbe7720c1624af986814950f05859ef Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Mon, 18 Sep 2017 22:03:36 +0200 Subject: [PATCH 4/6] Addressing comments. --- packages/grpc-js-core/gulpfile.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/grpc-js-core/gulpfile.js b/packages/grpc-js-core/gulpfile.js index bfcdcad7..c8b8f70f 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'); @@ -31,7 +33,7 @@ const files = !util.env.file ? [] : Array.isArray(util.env.file) ? util.env.file : [util.env.file]; // If --dev is passed, override certain ts config options -var tsDevOptions = {}; +let tsDevOptions = {}; if (util.env.dev) { tsDevOptions = { allowUnreachableCode: true, @@ -62,8 +64,8 @@ function makeCompileFn(globs) { .pipe(sourcemaps.init()) .pipe(tsProject) .on('error', onError); - const dts = data.dts - const js = data.js + const dts = data.dts; + const js = data.js; const jsmap = js.pipe(sourcemaps.write('.', { includeContent: false, sourceRoot: '..' From 371eeb32f0bf3d8743fad809b5b71bdc4ad0fca6 Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Mon, 18 Sep 2017 14:38:24 -0700 Subject: [PATCH 5/6] Add script to update gRPC submodule and run tests --- test-grpc-submodule.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 test-grpc-submodule.sh 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 From 1a7eee11eed187c374d1c6d113caec09b5881661 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Mon, 18 Sep 2017 22:37:14 +0200 Subject: [PATCH 6/6] Trying to fix nvm and npm breakages. --- run-tests.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/run-tests.sh b/run-tests.sh index 5c375036..530a5231 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -14,13 +14,16 @@ # 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 -cd $(dirname $0) +set -ex +cd $ROOT if [ ! -n "$node_versions" ] ; then node_versions="4 5 6 7 8" @@ -30,12 +33,13 @@ fi for version in ${node_versions} do + git clean -f -d -x # 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