From a42781053d7eaea64686dc31512e29aef0bf1305 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Tue, 12 Jun 2018 16:07:19 -0400 Subject: [PATCH] Migrate tests to Kokoro (#652) Migrate tests to Kokoro Move existing CircleCI tests to Kokoro. Add semistandard dev-dependency Update appengine/pubsub dependencies Skip pubsub Kokoro tests --- .kokoro/appengine-datastore.cfg | 10 ---- .kokoro/appengine/analytics-flex.cfg | 13 +++++ .kokoro/appengine/analytics-standard.cfg | 13 +++++ .kokoro/appengine/build.sh | 53 +++++++++++++++++++ .kokoro/appengine/common.cfg | 22 ++++++++ .kokoro/appengine/datastore-flex.cfg | 13 +++++ .kokoro/appengine/datastore-standard.cfg | 13 +++++ .kokoro/appengine/default-yml/build.sh | 53 +++++++++++++++++++ .kokoro/appengine/default-yml/common.cfg | 22 ++++++++ .../default-yml/hello-world-flex.cfg | 13 +++++ .../default-yml/hello-world-standard.cfg | 13 +++++ .../appengine/default-yml/metadata-flex.cfg | 13 +++++ .../default-yml/metadata-standard.cfg | 13 +++++ .../appengine/default-yml/storage-flex.cfg | 13 +++++ .../default-yml/storage-standard.cfg | 13 +++++ .kokoro/appengine/endpoints-flex.cfg | 13 +++++ .kokoro/appengine/endpoints-standard.cfg | 13 +++++ .kokoro/appengine/errorreporting-flex.cfg | 13 +++++ .kokoro/appengine/errorreporting-standard.cfg | 13 +++++ .kokoro/appengine/mailjet-flex.cfg | 13 +++++ .kokoro/appengine/mailjet-standard.cfg | 13 +++++ .kokoro/appengine/pubsub-flex.cfg | 19 +++++++ .kokoro/appengine/pubsub-standard.cfg | 19 +++++++ .kokoro/appengine/static-files-flex.cfg | 13 +++++ .kokoro/appengine/static-files-standard.cfg | 13 +++++ .kokoro/auth.cfg | 13 +++++ ...e-datastore.sh => build-with-appengine.sh} | 8 +-- .kokoro/build.sh | 34 ++++++++++++ .kokoro/cloudtasks.cfg | 13 +++++ .kokoro/common.cfg | 3 ++ .kokoro/debugger.cfg | 13 +++++ .kokoro/error-reporting.cfg | 13 +++++ .kokoro/functions/common.cfg | 13 +++++ .../{ => functions}/functions-helloworld.cfg | 0 .../{ => functions}/functions-helloworld.sh | 0 .kokoro/iot-manager.cfg | 13 +++++ .kokoro/kms.cfg | 13 +++++ .kokoro/prediction.cfg | 13 +++++ .kokoro/skip.sh | 20 +++++++ .kokoro/storage-transfer.cfg | 13 +++++ .kokoro/trace.cfg | 13 +++++ appengine/errorreporting/package.json | 1 + appengine/mailjet/package.json | 3 +- appengine/pubsub/package.json | 8 +-- cloudtasks/package.json | 3 +- debugger/package.json | 3 +- error-reporting/package.json | 1 + iot/manager/package.json | 1 + prediction/package.json | 3 +- storage-transfer/package.json | 1 + trace/package.json | 3 +- 51 files changed, 631 insertions(+), 23 deletions(-) delete mode 100644 .kokoro/appengine-datastore.cfg create mode 100644 .kokoro/appengine/analytics-flex.cfg create mode 100644 .kokoro/appengine/analytics-standard.cfg create mode 100755 .kokoro/appengine/build.sh create mode 100644 .kokoro/appengine/common.cfg create mode 100644 .kokoro/appengine/datastore-flex.cfg create mode 100644 .kokoro/appengine/datastore-standard.cfg create mode 100755 .kokoro/appengine/default-yml/build.sh create mode 100644 .kokoro/appengine/default-yml/common.cfg create mode 100644 .kokoro/appengine/default-yml/hello-world-flex.cfg create mode 100644 .kokoro/appengine/default-yml/hello-world-standard.cfg create mode 100644 .kokoro/appengine/default-yml/metadata-flex.cfg create mode 100644 .kokoro/appengine/default-yml/metadata-standard.cfg create mode 100644 .kokoro/appengine/default-yml/storage-flex.cfg create mode 100644 .kokoro/appengine/default-yml/storage-standard.cfg create mode 100644 .kokoro/appengine/endpoints-flex.cfg create mode 100644 .kokoro/appengine/endpoints-standard.cfg create mode 100644 .kokoro/appengine/errorreporting-flex.cfg create mode 100644 .kokoro/appengine/errorreporting-standard.cfg create mode 100644 .kokoro/appengine/mailjet-flex.cfg create mode 100644 .kokoro/appengine/mailjet-standard.cfg create mode 100644 .kokoro/appengine/pubsub-flex.cfg create mode 100644 .kokoro/appengine/pubsub-standard.cfg create mode 100644 .kokoro/appengine/static-files-flex.cfg create mode 100644 .kokoro/appengine/static-files-standard.cfg create mode 100644 .kokoro/auth.cfg rename .kokoro/{appengine-datastore.sh => build-with-appengine.sh} (82%) create mode 100755 .kokoro/build.sh create mode 100644 .kokoro/cloudtasks.cfg create mode 100644 .kokoro/debugger.cfg create mode 100644 .kokoro/error-reporting.cfg create mode 100644 .kokoro/functions/common.cfg rename .kokoro/{ => functions}/functions-helloworld.cfg (100%) rename .kokoro/{ => functions}/functions-helloworld.sh (100%) create mode 100644 .kokoro/iot-manager.cfg create mode 100644 .kokoro/kms.cfg create mode 100644 .kokoro/prediction.cfg create mode 100755 .kokoro/skip.sh create mode 100644 .kokoro/storage-transfer.cfg create mode 100644 .kokoro/trace.cfg diff --git a/.kokoro/appengine-datastore.cfg b/.kokoro/appengine-datastore.cfg deleted file mode 100644 index 0effa5eb3f..0000000000 --- a/.kokoro/appengine-datastore.cfg +++ /dev/null @@ -1,10 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download secrets from Cloud Storage. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/nodejs-docs-samples" - -# Tell the trampoline which build file to use. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-docs-samples/.kokoro/appengine-datastore.sh" -} diff --git a/.kokoro/appengine/analytics-flex.cfg b/.kokoro/appengine/analytics-flex.cfg new file mode 100644 index 0000000000..c0dbb2d68d --- /dev/null +++ b/.kokoro/appengine/analytics-flex.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "flexible" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "analytics" +} \ No newline at end of file diff --git a/.kokoro/appengine/analytics-standard.cfg b/.kokoro/appengine/analytics-standard.cfg new file mode 100644 index 0000000000..e0a0213d88 --- /dev/null +++ b/.kokoro/appengine/analytics-standard.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "standard" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "analytics" +} \ No newline at end of file diff --git a/.kokoro/appengine/build.sh b/.kokoro/appengine/build.sh new file mode 100755 index 0000000000..c8ea019aa0 --- /dev/null +++ b/.kokoro/appengine/build.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# Copyright 2018 Google Inc. +# +# 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. + +export GCLOUD_PROJECT=nodejs-docs-samples-tests + +export NODE_ENV=development +export GAE_VERSION=appengine-${PROJECT}-${APPENGINE_ENVIRONMENT} + +# Register post-test cleanup +function cleanup { + gcloud app versions delete $GAE_VERSION --quiet + if [ -e "worker.yaml" ]; then + gcloud app versions delete ${GAE_VERSION}-worker --quiet + fi +} +trap cleanup EXIT +set -e; + +cd github/nodejs-docs-samples/appengine/${PROJECT} + +# Install dependencies +npm install + +# Configure gcloud +export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/secrets-key.json +gcloud auth activate-service-account --key-file "$GOOGLE_APPLICATION_CREDENTIALS" +gcloud config set project $GCLOUD_PROJECT + + +# Deploy the app +gcloud app deploy app.${APPENGINE_ENVIRONMENT}.yaml --version $GAE_VERSION --no-promote --quiet +if [ -e "worker.yaml" ]; then + gcloud app deploy worker.yaml --version ${GAE_VERSION} --no-promote --quiet +fi + + +# Test the deployed app +npm test + +exit $? \ No newline at end of file diff --git a/.kokoro/appengine/common.cfg b/.kokoro/appengine/common.cfg new file mode 100644 index 0000000000..322e6fd289 --- /dev/null +++ b/.kokoro/appengine/common.cfg @@ -0,0 +1,22 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Download secrets from Cloud Storage. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/nodejs-docs-samples" + +# All builds use the trampoline script to run in docker. +build_file: "nodejs-docs-samples/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-docs-samples/nodejs" +} + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-docs-samples/.kokoro/appengine/build.sh" +} diff --git a/.kokoro/appengine/datastore-flex.cfg b/.kokoro/appengine/datastore-flex.cfg new file mode 100644 index 0000000000..f367441197 --- /dev/null +++ b/.kokoro/appengine/datastore-flex.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "flexible" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "datastore" +} \ No newline at end of file diff --git a/.kokoro/appengine/datastore-standard.cfg b/.kokoro/appengine/datastore-standard.cfg new file mode 100644 index 0000000000..8a86af2c0f --- /dev/null +++ b/.kokoro/appengine/datastore-standard.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "standard" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "datastore" +} \ No newline at end of file diff --git a/.kokoro/appengine/default-yml/build.sh b/.kokoro/appengine/default-yml/build.sh new file mode 100755 index 0000000000..a848a2fc3d --- /dev/null +++ b/.kokoro/appengine/default-yml/build.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# Copyright 2018 Google Inc. +# +# 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. + +export GCLOUD_PROJECT=nodejs-docs-samples-tests + +export NODE_ENV=development +export GAE_VERSION=appengine-${PROJECT}-${APPENGINE_ENVIRONMENT} + +# Register post-test cleanup +function cleanup { + gcloud app versions delete $GAE_VERSION --quiet + if [ -e "worker.yaml" ]; then + gcloud app versions delete ${GAE_VERSION}-worker --quiet + fi +} +trap cleanup EXIT +set -e; + +cd github/nodejs-docs-samples/appengine/${PROJECT}/${APPENGINE_ENVIRONMENT} + +# Install dependencies +npm install + +# Configure gcloud +export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/secrets-key.json +gcloud auth activate-service-account --key-file "$GOOGLE_APPLICATION_CREDENTIALS" +gcloud config set project $GCLOUD_PROJECT + + +# Deploy the app +gcloud app deploy --version $GAE_VERSION --no-promote --quiet +if [ -e "worker.yaml" ]; then + gcloud app deploy worker.yaml --version ${GAE_VERSION} --no-promote --quiet +fi + + +# Test the deployed app +npm test + +exit $? \ No newline at end of file diff --git a/.kokoro/appengine/default-yml/common.cfg b/.kokoro/appengine/default-yml/common.cfg new file mode 100644 index 0000000000..cc5dd25d22 --- /dev/null +++ b/.kokoro/appengine/default-yml/common.cfg @@ -0,0 +1,22 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Download secrets from Cloud Storage. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/nodejs-docs-samples" + +# All builds use the trampoline script to run in docker. +build_file: "nodejs-docs-samples/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-docs-samples/nodejs" +} + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-docs-samples/.kokoro/appengine/default-yml/build.sh" +} diff --git a/.kokoro/appengine/default-yml/hello-world-flex.cfg b/.kokoro/appengine/default-yml/hello-world-flex.cfg new file mode 100644 index 0000000000..e5b9ac20f2 --- /dev/null +++ b/.kokoro/appengine/default-yml/hello-world-flex.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "flexible" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "hello-worl" +} \ No newline at end of file diff --git a/.kokoro/appengine/default-yml/hello-world-standard.cfg b/.kokoro/appengine/default-yml/hello-world-standard.cfg new file mode 100644 index 0000000000..acfab90640 --- /dev/null +++ b/.kokoro/appengine/default-yml/hello-world-standard.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "standard" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "hello-worl" +} \ No newline at end of file diff --git a/.kokoro/appengine/default-yml/metadata-flex.cfg b/.kokoro/appengine/default-yml/metadata-flex.cfg new file mode 100644 index 0000000000..bed9a2b004 --- /dev/null +++ b/.kokoro/appengine/default-yml/metadata-flex.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "flexible" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "metadata" +} \ No newline at end of file diff --git a/.kokoro/appengine/default-yml/metadata-standard.cfg b/.kokoro/appengine/default-yml/metadata-standard.cfg new file mode 100644 index 0000000000..1bb0a9ce02 --- /dev/null +++ b/.kokoro/appengine/default-yml/metadata-standard.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "standard" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "metadata" +} \ No newline at end of file diff --git a/.kokoro/appengine/default-yml/storage-flex.cfg b/.kokoro/appengine/default-yml/storage-flex.cfg new file mode 100644 index 0000000000..221725dcde --- /dev/null +++ b/.kokoro/appengine/default-yml/storage-flex.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "flexible" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "storage" +} \ No newline at end of file diff --git a/.kokoro/appengine/default-yml/storage-standard.cfg b/.kokoro/appengine/default-yml/storage-standard.cfg new file mode 100644 index 0000000000..d3b231f922 --- /dev/null +++ b/.kokoro/appengine/default-yml/storage-standard.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "standard" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "storage" +} \ No newline at end of file diff --git a/.kokoro/appengine/endpoints-flex.cfg b/.kokoro/appengine/endpoints-flex.cfg new file mode 100644 index 0000000000..7fe63c9985 --- /dev/null +++ b/.kokoro/appengine/endpoints-flex.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "flexible" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "endpoints" +} \ No newline at end of file diff --git a/.kokoro/appengine/endpoints-standard.cfg b/.kokoro/appengine/endpoints-standard.cfg new file mode 100644 index 0000000000..a7b534b5ec --- /dev/null +++ b/.kokoro/appengine/endpoints-standard.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "standard" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "endpoints" +} \ No newline at end of file diff --git a/.kokoro/appengine/errorreporting-flex.cfg b/.kokoro/appengine/errorreporting-flex.cfg new file mode 100644 index 0000000000..9d7da2f74c --- /dev/null +++ b/.kokoro/appengine/errorreporting-flex.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "flexible" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "errorreporting" +} \ No newline at end of file diff --git a/.kokoro/appengine/errorreporting-standard.cfg b/.kokoro/appengine/errorreporting-standard.cfg new file mode 100644 index 0000000000..5692e22f84 --- /dev/null +++ b/.kokoro/appengine/errorreporting-standard.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "standard" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "errorreporting" +} \ No newline at end of file diff --git a/.kokoro/appengine/mailjet-flex.cfg b/.kokoro/appengine/mailjet-flex.cfg new file mode 100644 index 0000000000..d03ee4db7d --- /dev/null +++ b/.kokoro/appengine/mailjet-flex.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "flexible" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "mailjet" +} \ No newline at end of file diff --git a/.kokoro/appengine/mailjet-standard.cfg b/.kokoro/appengine/mailjet-standard.cfg new file mode 100644 index 0000000000..9bb252fb93 --- /dev/null +++ b/.kokoro/appengine/mailjet-standard.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "standard" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "mailjet" +} \ No newline at end of file diff --git a/.kokoro/appengine/pubsub-flex.cfg b/.kokoro/appengine/pubsub-flex.cfg new file mode 100644 index 0000000000..ec1184323a --- /dev/null +++ b/.kokoro/appengine/pubsub-flex.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "flexible" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "pubsub" +} + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-docs-samples/.kokoro/skip.sh" +} diff --git a/.kokoro/appengine/pubsub-standard.cfg b/.kokoro/appengine/pubsub-standard.cfg new file mode 100644 index 0000000000..5144eb301c --- /dev/null +++ b/.kokoro/appengine/pubsub-standard.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "standard" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "pubsub" +} + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-docs-samples/.kokoro/skip.sh" +} diff --git a/.kokoro/appengine/static-files-flex.cfg b/.kokoro/appengine/static-files-flex.cfg new file mode 100644 index 0000000000..e0ea871d3e --- /dev/null +++ b/.kokoro/appengine/static-files-flex.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "flexible" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "static-files" +} \ No newline at end of file diff --git a/.kokoro/appengine/static-files-standard.cfg b/.kokoro/appengine/static-files-standard.cfg new file mode 100644 index 0000000000..8f8f2bd042 --- /dev/null +++ b/.kokoro/appengine/static-files-standard.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set GAE environment +env_vars: { + key: "APPENGINE_ENVIRONMENT" + value: "standard" +} + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "static-files" +} \ No newline at end of file diff --git a/.kokoro/auth.cfg b/.kokoro/auth.cfg new file mode 100644 index 0000000000..46c454bd8e --- /dev/null +++ b/.kokoro/auth.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "auth" +} + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-docs-samples/.kokoro/build.sh" +} diff --git a/.kokoro/appengine-datastore.sh b/.kokoro/build-with-appengine.sh similarity index 82% rename from .kokoro/appengine-datastore.sh rename to .kokoro/build-with-appengine.sh index 1ff527c60c..adde55e726 100755 --- a/.kokoro/appengine-datastore.sh +++ b/.kokoro/build-with-appengine.sh @@ -17,7 +17,7 @@ export GCLOUD_PROJECT=nodejs-docs-samples-tests export NODE_ENV=development -export GAE_VERSION=appengine-datastore-flexible +export GAE_VERSION=doc-sample-${PROJECT}-flex # Register post-test cleanup function cleanup { @@ -29,7 +29,7 @@ function cleanup { trap cleanup EXIT set -e; -cd github/nodejs-docs-samples/appengine/datastore +cd github/nodejs-docs-samples/${PROJECT} # Install dependencies npm install @@ -41,9 +41,9 @@ gcloud config set project $GCLOUD_PROJECT # Deploy the app -gcloud app deploy app.flexible.yaml --version $GAE_VERSION --no-promote --quiet +gcloud app deploy --version $GAE_VERSION --no-promote --quiet if [ -e "worker.yaml" ]; then - gcloud app deploy worker.yaml --version ${GAE_VERSION}-worker --no-promote --quiet + gcloud app deploy worker.yaml --version ${GAE_VERSION} --no-promote --quiet fi diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 0000000000..857803241a --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Copyright 2018 Google Inc. +# +# 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. + +export GCLOUD_PROJECT=nodejs-docs-samples-tests + +export NODE_ENV=development + +cd github/nodejs-docs-samples/${PROJECT} + +# Install dependencies +npm install + +# Configure gcloud +export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/secrets-key.json +gcloud auth activate-service-account --key-file "$GOOGLE_APPLICATION_CREDENTIALS" +gcloud config set project $GCLOUD_PROJECT + +# Test the deployed app +npm test + +exit $? \ No newline at end of file diff --git a/.kokoro/cloudtasks.cfg b/.kokoro/cloudtasks.cfg new file mode 100644 index 0000000000..4432e3e3d8 --- /dev/null +++ b/.kokoro/cloudtasks.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "cloudtasks" +} + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-docs-samples/.kokoro/build.sh" +} diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg index 881f2f9de4..8ca89d179a 100644 --- a/.kokoro/common.cfg +++ b/.kokoro/common.cfg @@ -3,6 +3,9 @@ # Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" +# Download secrets from Cloud Storage. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/nodejs-docs-samples" + # All builds use the trampoline script to run in docker. build_file: "nodejs-docs-samples/.kokoro/trampoline.sh" diff --git a/.kokoro/debugger.cfg b/.kokoro/debugger.cfg new file mode 100644 index 0000000000..8669b70c08 --- /dev/null +++ b/.kokoro/debugger.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "debugger" +} + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-docs-samples/.kokoro/build-with-appengine.sh" +} diff --git a/.kokoro/error-reporting.cfg b/.kokoro/error-reporting.cfg new file mode 100644 index 0000000000..ad6ba1f194 --- /dev/null +++ b/.kokoro/error-reporting.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "error-reporting" +} + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-docs-samples/.kokoro/build.sh" +} diff --git a/.kokoro/functions/common.cfg b/.kokoro/functions/common.cfg new file mode 100644 index 0000000000..881f2f9de4 --- /dev/null +++ b/.kokoro/functions/common.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# All builds use the trampoline script to run in docker. +build_file: "nodejs-docs-samples/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-docs-samples/nodejs" +} \ No newline at end of file diff --git a/.kokoro/functions-helloworld.cfg b/.kokoro/functions/functions-helloworld.cfg similarity index 100% rename from .kokoro/functions-helloworld.cfg rename to .kokoro/functions/functions-helloworld.cfg diff --git a/.kokoro/functions-helloworld.sh b/.kokoro/functions/functions-helloworld.sh similarity index 100% rename from .kokoro/functions-helloworld.sh rename to .kokoro/functions/functions-helloworld.sh diff --git a/.kokoro/iot-manager.cfg b/.kokoro/iot-manager.cfg new file mode 100644 index 0000000000..805c80eb7d --- /dev/null +++ b/.kokoro/iot-manager.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "iot/manager" +} + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-docs-samples/.kokoro/build.sh" +} diff --git a/.kokoro/kms.cfg b/.kokoro/kms.cfg new file mode 100644 index 0000000000..0ad6657964 --- /dev/null +++ b/.kokoro/kms.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "kms" +} + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-docs-samples/.kokoro/build.sh" +} diff --git a/.kokoro/prediction.cfg b/.kokoro/prediction.cfg new file mode 100644 index 0000000000..795535a5db --- /dev/null +++ b/.kokoro/prediction.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "prediction" +} + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-docs-samples/.kokoro/build.sh" +} diff --git a/.kokoro/skip.sh b/.kokoro/skip.sh new file mode 100755 index 0000000000..8f02d7d463 --- /dev/null +++ b/.kokoro/skip.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Copyright 2018 Google Inc. +# +# 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. + +# TODO(franzih): Do not use this build script. +# Skip this test for now. + +exit 0 \ No newline at end of file diff --git a/.kokoro/storage-transfer.cfg b/.kokoro/storage-transfer.cfg new file mode 100644 index 0000000000..0edb02ad32 --- /dev/null +++ b/.kokoro/storage-transfer.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "storage-transfer" +} + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-docs-samples/.kokoro/build.sh" +} diff --git a/.kokoro/trace.cfg b/.kokoro/trace.cfg new file mode 100644 index 0000000000..ea78f93ad3 --- /dev/null +++ b/.kokoro/trace.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Set the folder in which the tests are run +env_vars: { + key: "PROJECT" + value: "trace" +} + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-docs-samples/.kokoro/build-with-appengine.sh" +} diff --git a/appengine/errorreporting/package.json b/appengine/errorreporting/package.json index 7344c7c3cb..5232234fe7 100644 --- a/appengine/errorreporting/package.json +++ b/appengine/errorreporting/package.json @@ -28,6 +28,7 @@ "@google-cloud/nodejs-repo-tools": "2.2.1", "ava": "0.25.0", "proxyquire": "2.0.0", + "semistandard": "^12.0.1", "sinon": "4.4.2" }, "cloud-repo-tools": { diff --git a/appengine/mailjet/package.json b/appengine/mailjet/package.json index a090038fa4..71bef28540 100644 --- a/appengine/mailjet/package.json +++ b/appengine/mailjet/package.json @@ -26,7 +26,8 @@ "node-mailjet": "3.2.1" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "2.2.1" + "@google-cloud/nodejs-repo-tools": "2.2.1", + "semistandard": "^12.0.1" }, "cloud-repo-tools": { "test": { diff --git a/appengine/pubsub/package.json b/appengine/pubsub/package.json index e943eafe3d..e7e9ccc12d 100644 --- a/appengine/pubsub/package.json +++ b/appengine/pubsub/package.json @@ -13,14 +13,14 @@ "test": "repo-tools test app && ava -T 30s */*.test.js" }, "dependencies": { - "@google-cloud/pubsub": "0.16.4", + "@google-cloud/pubsub": "^0.16.5", "body-parser": "1.18.2", - "express": "4.16.2", - "pug": "2.0.1", + "express": "^4.16.3", + "pug": "^2.0.1", "safe-buffer": "5.1.1" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "2.2.1", + "@google-cloud/nodejs-repo-tools": "^2.3.0", "ava": "0.25.0", "uuid": "3.2.1" }, diff --git a/cloudtasks/package.json b/cloudtasks/package.json index 925e114176..5fd26dc7c9 100644 --- a/cloudtasks/package.json +++ b/cloudtasks/package.json @@ -20,7 +20,8 @@ }, "devDependencies": { "@google-cloud/nodejs-repo-tools": "2.2.1", - "ava": "0.25.0" + "ava": "0.25.0", + "semistandard": "^12.0.1" }, "cloud-repo-tools": { "requiresKeyFile": true, diff --git a/debugger/package.json b/debugger/package.json index 3304642851..a8420b9d16 100644 --- a/debugger/package.json +++ b/debugger/package.json @@ -26,7 +26,8 @@ "express": "4.16.2" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "2.2.1" + "@google-cloud/nodejs-repo-tools": "2.2.1", + "semistandard": "^12.0.1" }, "cloud-repo-tools": { "test": { diff --git a/error-reporting/package.json b/error-reporting/package.json index cdab72ae13..3ba330372a 100644 --- a/error-reporting/package.json +++ b/error-reporting/package.json @@ -29,6 +29,7 @@ "@google-cloud/nodejs-repo-tools": "2.2.1", "ava": "0.25.0", "proxyquire": "2.0.0", + "semistandard": "^12.0.1", "sinon": "4.4.2" }, "cloud-repo-tools": { diff --git a/iot/manager/package.json b/iot/manager/package.json index f228a8ce9b..c0c63653e7 100644 --- a/iot/manager/package.json +++ b/iot/manager/package.json @@ -25,6 +25,7 @@ "devDependencies": { "@google-cloud/nodejs-repo-tools": "1.4.17", "ava": "0.22.0", + "semistandard": "^12.0.1", "uuid": "3.1.0" }, "cloud-repo-tools": { diff --git a/prediction/package.json b/prediction/package.json index 9f988064bd..8192d9df81 100644 --- a/prediction/package.json +++ b/prediction/package.json @@ -21,7 +21,8 @@ }, "devDependencies": { "@google-cloud/nodejs-repo-tools": "1.4.17", - "ava": "0.21.0" + "ava": "0.21.0", + "semistandard": "^12.0.1" }, "cloud-repo-tools": { "requiresKeyFile": true, diff --git a/storage-transfer/package.json b/storage-transfer/package.json index a18727d395..939c62d998 100644 --- a/storage-transfer/package.json +++ b/storage-transfer/package.json @@ -29,6 +29,7 @@ "@google-cloud/nodejs-repo-tools": "2.2.5", "ava": "0.25.0", "proxyquire": "2.0.1", + "semistandard": "^12.0.1", "sinon": "4.4.8", "uuid": "3.2.1" }, diff --git a/trace/package.json b/trace/package.json index 01a275cf20..77655c00bc 100644 --- a/trace/package.json +++ b/trace/package.json @@ -26,7 +26,8 @@ "got": "8.2.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "2.2.1" + "@google-cloud/nodejs-repo-tools": "2.2.1", + "semistandard": "^12.0.1" }, "cloud-repo-tools": { "test": {