From b361eb210c7105c79f5636a48c59a7e64ac14edb Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Mon, 6 May 2019 15:50:13 -0700 Subject: [PATCH] build: only pipe to codecov if tests run on Node 10 --- .kokoro/lint.sh | 10 ++++++---- .kokoro/samples-test.sh | 16 +++++++++------- .kokoro/test.sh | 12 ++++++++++-- synth.metadata | 4 ++-- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.kokoro/lint.sh b/.kokoro/lint.sh index 7c2ea2a28..bcb750836 100755 --- a/.kokoro/lint.sh +++ b/.kokoro/lint.sh @@ -23,9 +23,11 @@ cd $(dirname $0)/.. npm install # Install and link samples -cd samples/ -npm link ../ -npm install -cd .. +if [ -f samples/package.json ]; then + cd samples/ + npm link ../ + npm install + cd .. +fi npm run lint diff --git a/.kokoro/samples-test.sh b/.kokoro/samples-test.sh index 5a81ec01f..f83f712a8 100755 --- a/.kokoro/samples-test.sh +++ b/.kokoro/samples-test.sh @@ -31,12 +31,14 @@ if [ -f .kokoro/pre-samples-test.sh ]; then set -x fi -npm install +if [ -f samples/package.json ]; then + npm install -# Install and link samples -cd samples/ -npm link ../ -npm install -cd .. + # Install and link samples + cd samples/ + npm link ../ + npm install + cd .. -npm run samples-test + npm run samples-test +fi diff --git a/.kokoro/test.sh b/.kokoro/test.sh index 4d6c3f831..f7e9fe781 100755 --- a/.kokoro/test.sh +++ b/.kokoro/test.sh @@ -22,6 +22,14 @@ cd $(dirname $0)/.. npm install npm test -./node_modules/nyc/bin/nyc.js report -bash $KOKORO_GFILE_DIR/codecov.sh +COVERAGE_NODE=10 +if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then + NYC_BIN=./node_modules/nyc/bin/nyc.js + if [ -f "$NYC_BIN" ]; then + $NYC_BIN report + fi + bash $KOKORO_GFILE_DIR/codecov.sh +else + echo "coverage is only reported for Node $COVERAGE_NODE" +fi diff --git a/synth.metadata b/synth.metadata index c763bee5e..ddc7ba676 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,11 +1,11 @@ { - "updateTime": "2019-04-02T18:07:08.916064Z", + "updateTime": "2019-05-04T11:22:40.672305Z", "sources": [ { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.2.26" + "version": "2019.5.2" } } ]