diff --git a/gulpfile.js b/gulpfile.js index 2024412a..f1a333e4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,3 +1,20 @@ +/* + * 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. + * + */ + const _gulp = require('gulp'); const help = require('gulp-help'); @@ -12,7 +29,10 @@ require('./test/gulpfile'); const root = __dirname; gulp.task('install.all', 'Install dependencies for all subdirectory packages', - ['js.core.install', 'native.core.install', 'health-check.install']); + ['js.core.install', 'native.core.install', 'health-check.install', 'internal.test.install']); + +gulp.task('install.all.windows', 'Install dependencies for all subdirectory packages for MS Windows', + ['js.core.install', 'native.core.install.windows', 'health-check.install', 'internal.test.install']); gulp.task('lint', 'Emit linting errors in source and test files', ['js.core.lint', 'native.core.lint']); @@ -30,7 +50,12 @@ gulp.task('link', 'Link local packages together after building', gulp.start('link.only'); }); -gulp.task('setup', 'One-time setup for a clean repository', ['install.all', 'link']); +gulp.task('setup', 'One-time setup for a clean repository', ['install.all'], () => { + gulp.start('link'); +}); +gulp.task('setup.windows', 'One-time setup for a clean repository for MS Windows', ['install.all.windows'], () => { + gulp.start('link'); +}); gulp.task('clean', 'Delete generated files', ['js.core.clean', 'native.core.clean']); @@ -52,4 +77,6 @@ gulp.task('test', 'Run all tests', ['build'], () => { gulp.start('test.only'); }); +gulp.task('doc.gen', 'Generate documentation', ['native.core.doc.gen']); + gulp.task('default', ['help']); diff --git a/install-nvm-windows.ps1 b/install-nvm-windows.ps1 new file mode 100644 index 00000000..709a1ec2 --- /dev/null +++ b/install-nvm-windows.ps1 @@ -0,0 +1,26 @@ +# 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. + +# We're going to store nvm-windows in the .\nvm directory. +$env:NVM_HOME = (Get-Item -Path ".\" -Verbose).FullName + "\nvm" + +# Downloading and unpacking nvm-windows +Invoke-WebRequest -Uri https://github.com/coreybutler/nvm-windows/releases/download/1.1.5/nvm-noinstall.zip -OutFile nvm-noinstall.zip +Add-Type -AssemblyName System.IO.Compression.FileSystem +[System.IO.Compression.ZipFile]::ExtractToDirectory("nvm-noinstall.zip", "nvm") + +$env:Path = $env:NVM_HOME + ";" + $env:Path +Out-File -Encoding "OEM" nvm\settings.txt +nvm root $env:NVM_HOME +"%*" | Out-File -Encoding "OEM" nvm\elevate.cmd diff --git a/kokoro.bat b/kokoro.bat new file mode 100644 index 00000000..fc5fd8b2 --- /dev/null +++ b/kokoro.bat @@ -0,0 +1,22 @@ +@rem Copyright 2017 gRPC authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. + +@echo "Starting Windows test" + +cd /d %~dp0 + +git submodule update --init +git submodule foreach --recursive git submodule update --init + +.\run-tests.bat diff --git a/merge_kokoro_logs.js b/merge_kokoro_logs.js new file mode 100644 index 00000000..d8cc98db --- /dev/null +++ b/merge_kokoro_logs.js @@ -0,0 +1,55 @@ +/* + * 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. + * + */ + +const xml2js = require('xml2js'); +const fs = require('fs'); +const path = require('path'); +const util = require('util'); +const readFile = util.promisify(fs.readFile); +const writeFile = util.promisify(fs.writeFile); +const readDir = util.promisify(fs.readdir); + +const rootDir = __dirname; + +readDir(rootDir + '/reports') + .then((dirNames) => + Promise.all(dirNames.map((dirName) => + readDir(path.resolve(rootDir, 'reports', dirName)) + .then((fileNames) => + Promise.all(fileNames.map((name) => + readFile(path.resolve(rootDir, 'reports', dirName, name)) + .then((content) => { + let parser = new xml2js.Parser(); + const parseString = util.promisify(parser.parseString.bind(parser)); + return parseString(content); + }) + )) + ) + .then((objects) => { + let merged = objects[0]; + merged.testsuites.testsuite = Array.prototype.concat.apply([], objects.map((obj) => obj.testsuites.testsuite)); + let builder = new xml2js.Builder(); + let xml = builder.buildObject(merged); + let resultName = path.resolve(rootDir, 'reports', dirName, 'sponge_log.xml'); + console.log(`Writing ${resultName}`); + return writeFile(resultName, xml); + }) + )) + ) + .catch((error) => { + console.error(error); + }); diff --git a/package.json b/package.json index f8aaf17b..05647b47 100644 --- a/package.json +++ b/package.json @@ -8,32 +8,27 @@ "name": "Google Inc." }, "license": "Apache-2.0", - "dependencies": { - "async": "^2.5.0", - "body-parser": "^1.18.0", - "execa": "^0.8.0", - "express": "^4.15.4", - "google-auth-library": "^0.11.0", - "lodash": "^4.17.4", - "mocha-jenkins-reporter": "^0.3.9", - "poisson-process": "^0.2.2" - }, "devDependencies": { "del": "^3.0.0", + "execa": "^0.8.0", "gulp": "^3.9.1", "gulp-help": "^1.6.1", + "gulp-jsdoc3": "^1.0.1", "gulp-jshint": "^2.0.4", "gulp-mocha": "^4.3.1", "gulp-sourcemaps": "^2.6.1", "gulp-tslint": "^8.1.1", "gulp-typescript": "^3.2.2", "gulp-util": "^3.0.8", + "jsdoc": "^3.3.2", "jshint": "^2.9.5", "merge2": "^1.1.0", "mocha": "^3.5.3", + "mocha-jenkins-reporter": "^0.3.9", "through2": "^2.0.3", "tslint": "^5.5.0", - "typescript": "^2.5.1" + "typescript": "^2.5.1", + "xml2js": "^0.4.19" }, "contributors": [ { diff --git a/packages/grpc-health-check/gulpfile.js b/packages/grpc-health-check/gulpfile.js index 7c66a9cd..6e41de5e 100644 --- a/packages/grpc-health-check/gulpfile.js +++ b/packages/grpc-health-check/gulpfile.js @@ -1,3 +1,20 @@ +/* + * 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. + * + */ + const _gulp = require('gulp'); const help = require('gulp-help'); const mocha = require('gulp-mocha'); diff --git a/packages/grpc-js-core/gulpfile.js b/packages/grpc-js-core/gulpfile.js index 5a787084..79592139 100644 --- a/packages/grpc-js-core/gulpfile.js +++ b/packages/grpc-js-core/gulpfile.js @@ -1,3 +1,20 @@ +/* + * 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. + * + */ + 'use strict'; const _gulp = require('gulp'); diff --git a/packages/grpc-native-core/binding.gyp b/packages/grpc-native-core/binding.gyp index 3e8153f5..861ac0af 100644 --- a/packages/grpc-native-core/binding.gyp +++ b/packages/grpc-native-core/binding.gyp @@ -207,6 +207,9 @@ 'target_name': 'boringssl', 'product_prefix': 'lib', 'type': 'static_library', + 'cflags': [ + '-Wimplicit-fallthrough=0' + ], 'dependencies': [ ], 'sources': [ diff --git a/packages/grpc-native-core/ext/completion_queue.cc b/packages/grpc-native-core/ext/completion_queue.cc index a08febbb..0cee1a75 100644 --- a/packages/grpc-native-core/ext/completion_queue.cc +++ b/packages/grpc-native-core/ext/completion_queue.cc @@ -35,7 +35,7 @@ grpc_completion_queue *queue; uv_prepare_t prepare; int pending_batches; -void drain_completion_queue(uv_prepare_t *handle) { +static void drain_completion_queue(uv_prepare_t *handle) { Nan::HandleScope scope; grpc_event event; (void)handle; @@ -53,9 +53,9 @@ void drain_completion_queue(uv_prepare_t *handle) { CompleteTag(event.tag, error_message); grpc::node::DestroyTag(event.tag); pending_batches--; - if (pending_batches == 0) { - uv_prepare_stop(&prepare); - } + } + if (pending_batches == 0) { + uv_prepare_stop(&prepare); } } while (event.type != GRPC_QUEUE_TIMEOUT); } @@ -76,5 +76,15 @@ void CompletionQueueInit(Local exports) { pending_batches = 0; } +void CompletionQueueForcePoll() { + /* This sets the prepare object to poll on the completion queue the next time + * Node polls for IO. But it doesn't increment the number of pending batches, + * so it will immediately stop polling after that unless there is an + * intervening CompletionQueueNext call */ + if (pending_batches == 0) { + uv_prepare_start(&prepare, drain_completion_queue); + } +} + } // namespace node } // namespace grpc diff --git a/packages/grpc-native-core/ext/completion_queue.h b/packages/grpc-native-core/ext/completion_queue.h index f91d5ea8..3a56c327 100644 --- a/packages/grpc-native-core/ext/completion_queue.h +++ b/packages/grpc-native-core/ext/completion_queue.h @@ -28,5 +28,7 @@ void CompletionQueueNext(); void CompletionQueueInit(v8::Local exports); +void CompletionQueueForcePoll(); + } // namespace node } // namespace grpc diff --git a/packages/grpc-native-core/ext/node_grpc.cc b/packages/grpc-native-core/ext/node_grpc.cc index 11ed0838..a0652c28 100644 --- a/packages/grpc-native-core/ext/node_grpc.cc +++ b/packages/grpc-native-core/ext/node_grpc.cc @@ -265,6 +265,10 @@ NAN_METHOD(SetLogVerbosity) { gpr_set_log_verbosity(severity); } +NAN_METHOD(ForcePoll) { + grpc::node::CompletionQueueForcePoll(); +} + void init(Local exports) { Nan::HandleScope scope; grpc_init(); @@ -306,6 +310,9 @@ void init(Local exports) { Nan::Set(exports, Nan::New("setLogVerbosity").ToLocalChecked(), Nan::GetFunction(Nan::New(SetLogVerbosity)) .ToLocalChecked()); + Nan::Set(exports, Nan::New("forcePoll").ToLocalChecked(), + Nan::GetFunction(Nan::New(ForcePoll)) + .ToLocalChecked()); } NODE_MODULE(grpc_node, init) diff --git a/packages/grpc-native-core/gulpfile.js b/packages/grpc-native-core/gulpfile.js index 7d85cf5b..8a714ee6 100644 --- a/packages/grpc-native-core/gulpfile.js +++ b/packages/grpc-native-core/gulpfile.js @@ -1,9 +1,27 @@ +/* + * 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. + * + */ + const _gulp = require('gulp'); const help = require('gulp-help'); // gulp-help monkeypatches tasks to have an additional description parameter const gulp = help(_gulp); +const jsdoc = require('gulp-jsdoc3'); const jshint = require('gulp-jshint'); const mocha = require('gulp-mocha'); const execa = require('execa'); @@ -30,7 +48,16 @@ gulp.task('native.core.install', 'Install native core dependencies', () => { {cwd: nativeCoreDir, stdio: 'inherit'}); }); -gulp.task('native.core.link.create', 'Create npm link', ['native.core.install'], () => { +gulp.task('native.core.install.windows', 'Install native core dependencies for MS Windows', () => { + return execa('npm', ['install', '--build-from-source'], + {cwd: nativeCoreDir, stdio: 'inherit'}).catch(() => +del(path.resolve(process.env.USERPROFILE, '.node-gyp', process.versions.node, 'include/node/openssl'), { force: true }).then(() => +execa('npm', ['install', '--build-from-source'], + {cwd: nativeCoreDir, stdio: 'inherit'}) + )) +}); + +gulp.task('native.core.link.create', 'Create npm link', () => { return execa('npm', ['link'], {cwd: nativeCoreDir, stdio: 'inherit'}); }); @@ -41,9 +68,15 @@ gulp.task('native.core.lint', 'Emits linting errors', () => { }); gulp.task('native.core.build', 'Build native package', () => { - return execa('node-pre-gyp', ['build'], {cwd: nativeCoreDir, stdio: 'inherit'}); + return execa('npm', ['run', 'build'], {cwd: nativeCoreDir, stdio: 'inherit'}); }); gulp.task('native.core.test', 'Run all tests', ['native.core.build'], () => { return gulp.src(`${testDir}/*.js`).pipe(mocha({reporter: 'mocha-jenkins-reporter'})); }); + +gulp.task('native.core.doc.gen', 'Generate docs', (cb) => { + var config = require('./jsdoc_conf.json'); + gulp.src([`${nativeCoreDir}/README.md`, `${nativeCoreDir}/index.js`, `${srcDir}/*.js`], {read: false}) + .pipe(jsdoc(config, cb)); +}); diff --git a/packages/grpc-native-core/jsdoc_conf.json b/packages/grpc-native-core/jsdoc_conf.json index 2d967753..92de2990 100644 --- a/packages/grpc-native-core/jsdoc_conf.json +++ b/packages/grpc-native-core/jsdoc_conf.json @@ -2,14 +2,8 @@ "tags": { "allowUnknownTags": true }, - "source": { - "include": [ "src/node/index.js", "src/node/src" ], - "includePattern": "src/node/.+\\.js(doc)?$", - "excludePattern": "(^|\\/|\\\\)_" - }, "opts": { - "package": "package.json", - "readme": "src/node/README.md" + "destination": "docs/gen/native/core" }, "plugins": ["plugins/markdown"], "templates": { diff --git a/packages/grpc-native-core/package.json b/packages/grpc-native-core/package.json index c794b9b9..4a0c220d 100644 --- a/packages/grpc-native-core/package.json +++ b/packages/grpc-native-core/package.json @@ -19,10 +19,8 @@ "lib": "src/node/src" }, "scripts": { - "lint": "node ./node_modules/jshint/bin/jshint src test index.js --exclude-path=.jshintignore", - "test": "./node_modules/.bin/mocha test && npm run-script lint", + "build": "./node_modules/.bin/node-pre-gyp build", "electron-build": "./node_modules/.bin/node-pre-gyp configure build --runtime=electron --disturl=https://atom.io/download/atom-shell", - "gen_docs": "./node_modules/.bin/jsdoc -c jsdoc_conf.json", "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha test", "install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build --library=static_library" }, @@ -37,17 +35,9 @@ "protobufjs": "^5.0.0" }, "devDependencies": { - "async": "^2.0.1", - "body-parser": "^1.15.2", "electron-mocha": "^3.1.1", - "express": "^4.14.0", - "google-auth-library": "^0.9.2", "google-protobuf": "^3.0.0", - "istanbul": "^0.4.4", - "jsdoc": "^3.3.2", - "jshint": "^2.5.0", - "minimist": "^1.1.0", - "poisson-process": "^0.2.1" + "istanbul": "^0.4.4" }, "engines": { "node": ">=4" diff --git a/packages/grpc-native-core/src/client.js b/packages/grpc-native-core/src/client.js index 4208da11..d3c39ca4 100644 --- a/packages/grpc-native-core/src/client.js +++ b/packages/grpc-native-core/src/client.js @@ -800,7 +800,10 @@ Client.prototype.waitForReady = function(deadline, callback) { self.$channel.watchConnectivityState(new_state, deadline, checkState); } }; - checkState(); + /* Force a single round of polling to ensure that the channel state is up + * to date */ + grpc.forcePoll(); + setImmediate(checkState); }; /** diff --git a/packages/grpc-native-core/templates/binding.gyp.template b/packages/grpc-native-core/templates/binding.gyp.template index a74066df..19f88683 100644 --- a/packages/grpc-native-core/templates/binding.gyp.template +++ b/packages/grpc-native-core/templates/binding.gyp.template @@ -194,6 +194,9 @@ 'target_name': '${lib.name}', 'product_prefix': 'lib', 'type': 'static_library', + 'cflags': [ + '-Wimplicit-fallthrough=0' + ], 'dependencies': [ % for dep in getattr(lib, 'deps', []): '${dep}', diff --git a/packages/grpc-native-core/templates/package.json.template b/packages/grpc-native-core/templates/package.json.template index 034eb5f4..47efb460 100644 --- a/packages/grpc-native-core/templates/package.json.template +++ b/packages/grpc-native-core/templates/package.json.template @@ -21,10 +21,8 @@ "lib": "src/node/src" }, "scripts": { - "lint": "node ./node_modules/jshint/bin/jshint src test index.js --exclude-path=.jshintignore", - "test": "./node_modules/.bin/mocha test && npm run-script lint", + "build": "./node_modules/.bin/node-pre-gyp build", "electron-build": "./node_modules/.bin/node-pre-gyp configure build --runtime=electron --disturl=https://atom.io/download/atom-shell", - "gen_docs": "./node_modules/.bin/jsdoc -c jsdoc_conf.json", "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha test", "install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build --library=static_library" }, @@ -39,19 +37,9 @@ "protobufjs": "^5.0.0" }, "devDependencies": { - "async": "^2.0.1", - "body-parser": "^1.15.2", "electron-mocha": "^3.1.1", - "express": "^4.14.0", - "google-auth-library": "^0.9.2", "google-protobuf": "^3.0.0", - "istanbul": "^0.4.4", - "jsdoc": "^3.3.2", - "jshint": "^2.5.0", - "minimist": "^1.1.0", - "mocha": "^3.0.2", - "mocha-jenkins-reporter": "^0.2.3", - "poisson-process": "^0.2.1" + "istanbul": "^0.4.4" }, "engines": { "node": ">=4" diff --git a/run-tests.bat b/run-tests.bat new file mode 100644 index 00000000..207efed2 --- /dev/null +++ b/run-tests.bat @@ -0,0 +1,46 @@ +@rem Copyright 2017 gRPC authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. + +SET ROOT=%~dp0 +cd /d %~dp0 + +PowerShell -Command .\install-nvm-windows.ps1 + +SET NVM_HOME=%ROOT%nvm +SET NVM_SYMLINK=%ROOT%nvm\nodejs +SET PATH=%NVM_HOME%;%NVM_SYMLINK%;%PATH% + +nvm version + +nvm install 8.5.0 +nvm use 8.5.0 + +call npm install || goto :error + +for %%v in (4.8.4 6.11.3 7.9.0 8.5.0) do ( + nvm install %%v + nvm use %%v + node -e "console.log(process.versions)" + + call .\node_modules\.bin\gulp clean.all || goto :error + call .\node_modules\.bin\gulp setup.windows || goto :error + call .\node_modules\.bin\gulp native.test || goto :error +) + +if %errorlevel% neq 0 exit /b %errorlevel% + +goto :EOF + +:error +exit /b 1 diff --git a/run-tests.sh b/run-tests.sh index 180517a2..c1a76889 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -30,12 +30,12 @@ if [ ! -n "$node_versions" ] ; then fi set +ex +nvm install 8 nvm install lts/* nvm use lts/* set -ex npm install --unsafe-perm -./node_modules/.bin/gulp setup mkdir -p reports @@ -43,7 +43,6 @@ mkdir -p reports for version in ${node_versions} do - cd $ROOT # Install and setup node for the version we want. set +ex echo "Switching to node version $version" @@ -55,16 +54,18 @@ do # Install dependencies and link packages together. ./node_modules/.bin/gulp clean.all - ./node_modules/.bin/gulp link + ./node_modules/.bin/gulp setup # Rebuild libraries and run tests. JUNIT_REPORT_PATH="reports/node$version/" JUNIT_REPORT_STACK=1 ./node_modules/.bin/gulp native.test || FAILED="true" - cd "reports/node$version" - for file in * ; do - mv $file $(echo $file | sed 's/\(.*\)\.xml/\1_sponge_log.xml/') - done done +set +ex +nvm use 8 +set -ex + +node merge_kokoro_logs.js + if [ "$FAILED" != "" ] then exit 1 diff --git a/setup.sh b/setup.sh index b6ecf6d0..896def2a 100755 --- a/setup.sh +++ b/setup.sh @@ -1,3 +1,18 @@ +#!/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. + if [ -z $NODE_H2 ]; then echo "\$NODE_H2 must point to a node binary" exit 1 diff --git a/test/gulpfile.js b/test/gulpfile.js index b66b6e01..469f8d23 100644 --- a/test/gulpfile.js +++ b/test/gulpfile.js @@ -1,3 +1,20 @@ +/* + * 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. + * + */ + const _gulp = require('gulp'); const help = require('gulp-help'); const mocha = require('gulp-mocha'); @@ -15,6 +32,10 @@ gulp.task('internal.test.clean.links', 'Delete npm links', () => { return del(path.resolve(testDir, 'node_modules/grpc')); }); +gulp.task('internal.test.install', 'Install test dependencies', () => { + return execa('npm', ['install'], {cwd: testDir, stdio: 'inherit'}); +}); + gulp.task('internal.test.clean.all', 'Delete all files created by tasks', ['internal.test.clean.links']); diff --git a/test/kokoro/linux.cfg b/test/kokoro/linux.cfg index 99a4e8ce..c6b2c88f 100644 --- a/test/kokoro/linux.cfg +++ b/test/kokoro/linux.cfg @@ -19,6 +19,6 @@ build_file: "grpc-node/kokoro.sh" timeout_mins: 60 action { define_artifacts { - regex: "github/grpc-node/reports/**" + regex: "github/grpc-node/reports/**/sponge_log.xml" } } diff --git a/test/kokoro/macos.cfg b/test/kokoro/macos.cfg index 99a4e8ce..c6b2c88f 100644 --- a/test/kokoro/macos.cfg +++ b/test/kokoro/macos.cfg @@ -19,6 +19,6 @@ build_file: "grpc-node/kokoro.sh" timeout_mins: 60 action { define_artifacts { - regex: "github/grpc-node/reports/**" + regex: "github/grpc-node/reports/**/sponge_log.xml" } } diff --git a/test/kokoro/windows.cfg b/test/kokoro/windows.cfg new file mode 100644 index 00000000..e4a4524b --- /dev/null +++ b/test/kokoro/windows.cfg @@ -0,0 +1,19 @@ +# 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. + +# Config file for Kokoro (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc-node/kokoro.bat" +timeout_mins: 60 diff --git a/test/package.json b/test/package.json new file mode 100644 index 00000000..e987314c --- /dev/null +++ b/test/package.json @@ -0,0 +1,25 @@ +{ + "name": "grpc-node-test", + "version": "0.1.0", + "description": "Dummy package for the grpc-node repository tests", + "private": true, + "keywords": [], + "author": { + "name": "Google Inc." + }, + "license": "Apache-2.0", + "contributors": [ + { + "name": "Google Inc." + } + ], + "dependencies": { + "async": "^2.0.1", + "body-parser": "^1.15.2", + "express": "^4.14.0", + "google-auth-library": "^0.9.2", + "lodash": "^4.17.4", + "minimist": "^1.1.0", + "poisson-process": "^0.2.1" + } +}