From b4c45631a8a4984ad2a1ede4d5e6aa47d00a6b9c Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 8 Feb 2019 14:10:01 -0800 Subject: [PATCH 1/2] build: test using @grpc/grpc-js in CI --- .../continuous/node8/system-test-grpcjs.cfg | 7 ++++ .../presubmit/node8/system-test-grpcjs.cfg | 7 ++++ .kokoro/system-test-grpcjs.sh | 39 +++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 .kokoro/continuous/node8/system-test-grpcjs.cfg create mode 100644 .kokoro/presubmit/node8/system-test-grpcjs.cfg create mode 100755 .kokoro/system-test-grpcjs.sh diff --git a/.kokoro/continuous/node8/system-test-grpcjs.cfg b/.kokoro/continuous/node8/system-test-grpcjs.cfg new file mode 100644 index 000000000..ae6834e5a --- /dev/null +++ b/.kokoro/continuous/node8/system-test-grpcjs.cfg @@ -0,0 +1,7 @@ +# Download resources for system tests (service account key, etc.) +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-datastore/.kokoro/system-test-grpcjs.sh" +} diff --git a/.kokoro/presubmit/node8/system-test-grpcjs.cfg b/.kokoro/presubmit/node8/system-test-grpcjs.cfg new file mode 100644 index 000000000..ae6834e5a --- /dev/null +++ b/.kokoro/presubmit/node8/system-test-grpcjs.cfg @@ -0,0 +1,7 @@ +# Download resources for system tests (service account key, etc.) +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-datastore/.kokoro/system-test-grpcjs.sh" +} diff --git a/.kokoro/system-test-grpcjs.sh b/.kokoro/system-test-grpcjs.sh new file mode 100755 index 000000000..0b7e66efb --- /dev/null +++ b/.kokoro/system-test-grpcjs.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Copyright 2018 Google LLC +# +# 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 +# +# https://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. + +set -xeo pipefail + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +# Setup service account credentials. +export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json +export GCLOUD_PROJECT=long-door-651 + +cd $(dirname $0)/.. + +# Run a pre-test hook, if a pre-system-test.sh is in the project +if [ -f .kokoro/pre-system-test.sh ]; then + set +x + . .kokoro/pre-system-test.sh + set -x +fi + +# Test system-test with @grpc/grpc-js, requires node>=8.13.0 +export GOOGLE_CLOUD_USE_GRPC_JS=1 + +npm install + +npm run system-test From 74da20c5eaea2c079c3a81a69af288810a096b2c Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 8 Feb 2019 14:21:22 -0800 Subject: [PATCH 2/2] simplify configs --- .../continuous/node8/system-test-grpcjs.cfg | 7 +++- .../presubmit/node8/system-test-grpcjs.cfg | 7 +++- .kokoro/system-test-grpcjs.sh | 39 ------------------- 3 files changed, 12 insertions(+), 41 deletions(-) delete mode 100755 .kokoro/system-test-grpcjs.sh diff --git a/.kokoro/continuous/node8/system-test-grpcjs.cfg b/.kokoro/continuous/node8/system-test-grpcjs.cfg index ae6834e5a..ec20ad77e 100644 --- a/.kokoro/continuous/node8/system-test-grpcjs.cfg +++ b/.kokoro/continuous/node8/system-test-grpcjs.cfg @@ -3,5 +3,10 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-datastore/.kokoro/system-test-grpcjs.sh" + value: "github/nodejs-datastore/.kokoro/system-test.sh" +} + +env_vars: { + key: "GOOGLE_CLOUD_USE_GRPC_JS" + value: "1" } diff --git a/.kokoro/presubmit/node8/system-test-grpcjs.cfg b/.kokoro/presubmit/node8/system-test-grpcjs.cfg index ae6834e5a..ec20ad77e 100644 --- a/.kokoro/presubmit/node8/system-test-grpcjs.cfg +++ b/.kokoro/presubmit/node8/system-test-grpcjs.cfg @@ -3,5 +3,10 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-datastore/.kokoro/system-test-grpcjs.sh" + value: "github/nodejs-datastore/.kokoro/system-test.sh" +} + +env_vars: { + key: "GOOGLE_CLOUD_USE_GRPC_JS" + value: "1" } diff --git a/.kokoro/system-test-grpcjs.sh b/.kokoro/system-test-grpcjs.sh deleted file mode 100755 index 0b7e66efb..000000000 --- a/.kokoro/system-test-grpcjs.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -# Copyright 2018 Google LLC -# -# 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 -# -# https://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. - -set -xeo pipefail - -export NPM_CONFIG_PREFIX=/home/node/.npm-global - -# Setup service account credentials. -export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json -export GCLOUD_PROJECT=long-door-651 - -cd $(dirname $0)/.. - -# Run a pre-test hook, if a pre-system-test.sh is in the project -if [ -f .kokoro/pre-system-test.sh ]; then - set +x - . .kokoro/pre-system-test.sh - set -x -fi - -# Test system-test with @grpc/grpc-js, requires node>=8.13.0 -export GOOGLE_CLOUD_USE_GRPC_JS=1 - -npm install - -npm run system-test