diff --git a/.circleci/config.yml b/.circleci/config.yml index 8af6a4d04..da54155fc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -68,8 +68,6 @@ jobs: environment: NPM_CONFIG_PREFIX: /home/node/.npm-global - run: npm test - - run: node_modules/.bin/codecov - node8: docker: - image: 'node:8' diff --git a/.circleci/npm-install-retry.js b/.circleci/npm-install-retry.js index ae3220d73..3240aa2cb 100755 --- a/.circleci/npm-install-retry.js +++ b/.circleci/npm-install-retry.js @@ -6,7 +6,7 @@ let spawn = require('child_process').spawn; //USE: ./index.js [... NPM ARGS] // -let timeout = process.argv[2] || 60000; +let timeout = process.argv[2] || process.env.NPM_INSTALL_TIMEOUT || 60000; let attempts = process.argv[3] || 3; let args = process.argv.slice(4); if (args.length === 0) { diff --git a/.kokoro/pre-system-test.sh b/.kokoro/pre-system-test.sh index d07326093..00fafdf17 100755 --- a/.kokoro/pre-system-test.sh +++ b/.kokoro/pre-system-test.sh @@ -18,3 +18,6 @@ # system test key export GCN_STORAGE_2ND_PROJECT_ID=gcloud-node-whitelist-ci-tests export GCN_STORAGE_2ND_PROJECT_KEY=${KOKORO_GFILE_DIR}/no-whitelist-key.json + +export GOOGLE_CLOUD_KMS_KEY_ASIA="projects/long-door-651/locations/asia/keyRings/test-key-asia/cryptoKeys/test-key-asia" +export GOOGLE_CLOUD_KMS_KEY_US="projects/long-door-651/locations/us/keyRings/test-key-us/cryptoKeys/test-key-us" diff --git a/.kokoro/presubmit/node8/samples-test.cfg b/.kokoro/presubmit/node8/samples-test.cfg new file mode 100644 index 000000000..7757bbb5b --- /dev/null +++ b/.kokoro/presubmit/node8/samples-test.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-storage/.kokoro/samples-test.sh" +} diff --git a/.kokoro/presubmit/node8/system-test.cfg b/.kokoro/presubmit/node8/system-test.cfg new file mode 100644 index 000000000..57fbd1f3f --- /dev/null +++ b/.kokoro/presubmit/node8/system-test.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-storage/.kokoro/system-test.sh" +} diff --git a/.kokoro/samples-test.sh b/.kokoro/samples-test.sh index 76edbbbb2..5a81ec01f 100755 --- a/.kokoro/samples-test.sh +++ b/.kokoro/samples-test.sh @@ -24,6 +24,13 @@ export GCLOUD_PROJECT=long-door-651 cd $(dirname $0)/.. +# Run a pre-test hook, if a pre-samples-test.sh is in the project +if [ -f .kokoro/pre-samples-test.sh ]; then + set +x + . .kokoro/pre-samples-test.sh + set -x +fi + npm install # Install and link samples diff --git a/.kokoro/system-test.sh b/.kokoro/system-test.sh index a954b7942..fd8f0b638 100755 --- a/.kokoro/system-test.sh +++ b/.kokoro/system-test.sh @@ -26,7 +26,9 @@ 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 npm install diff --git a/.kokoro/test.bat b/.kokoro/test.bat index a8534ba80..d60473666 100644 --- a/.kokoro/test.bat +++ b/.kokoro/test.bat @@ -17,6 +17,8 @@ cd /d %~dp0 cd .. +call npm install -g npm@5 || goto :error + call npm install || goto :error call npm run test || goto :error diff --git a/.kokoro/test.sh b/.kokoro/test.sh index 51f29589b..eb25b89b9 100755 --- a/.kokoro/test.sh +++ b/.kokoro/test.sh @@ -22,4 +22,5 @@ cd $(dirname $0)/.. npm install npm test -node_modules/.bin/codecov + +bash $KOKORO_GFILE_DIR/codecov.sh diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 000000000..5724ea947 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com