Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix e2e tests #284

Merged
merged 1 commit into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .kokoro/e2e-tests/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export NVM_DIR="$HOME/.nvm"
nvm install 10

export NODE_ENV=development
export E2E_TESTS=true # test the deployed app
export E2E_TESTS=true # test the deployed app, used by repo-tools.getRequest()

# Register post-test cleanup
export GAE_VERSION=${BOOKSHELF_DIRECTORY:0:1}-${DATA_BACKEND}
Expand All @@ -54,21 +54,23 @@ function cleanup {
trap cleanup EXIT

# Configure gcloud
# Export the project as repo-tools e2e tests rely on it:
# `https://${opts.version}-dot-${opts.project}.appspot.com`.
export GCLOUD_PROJECT=nodejs-getting-started-tests
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

# Install Node dependencies
yarn global add @google-cloud/nodejs-repo-tools
npm i -g @google-cloud/nodejs-repo-tools
cd github/nodejs-getting-started/${BOOKSHELF_DIRECTORY}

# Copy secrets
cp ${KOKORO_GFILE_DIR}/secrets-config.json config.json
cp $GOOGLE_APPLICATION_CREDENTIALS key.json

# Install dependencies (for running the tests, not the apps themselves)
yarn install
npm install

# Deploy a single step
gcloud app deploy --version $GAE_VERSION --no-promote # nodejs-repo-tools doesn't support specifying versions, so deploy manually
Expand Down
1 change: 1 addition & 0 deletions 2-structured-data/test/_test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ module.exports = {
url: `http://localhost:${PORT}`,
version: process.env.GAE_VERSION || TESTNAME,
msg: `Bookshelf`,
project: process.env.GCLOUD_PROJECT, // needed for e2e URL
};
1 change: 1 addition & 0 deletions 3-binary-data/test/_test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ module.exports = {
url: `http://localhost:${PORT}`,
version: process.env.GAE_VERSION || TESTNAME,
msg: `Bookshelf`,
project: process.env.GCLOUD_PROJECT, // needed for e2e URL
};
1 change: 1 addition & 0 deletions 4-auth/test/_test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ module.exports = {
url: `http://localhost:${PORT}`,
version: process.env.GAE_VERSION || TESTNAME,
msg: `Bookshelf`,
project: process.env.GCLOUD_PROJECT, // needed for e2e URL
};
1 change: 1 addition & 0 deletions 5-logging/test/_test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ module.exports = {
url: `http://localhost:${PORT}`,
version: process.env.GAE_VERSION || TESTNAME,
msg: `Bookshelf`,
project: process.env.GCLOUD_PROJECT, // needed for e2e URL
};
1 change: 1 addition & 0 deletions 6-pubsub/test/_test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ module.exports = {
PORT: PORT,
TOPIC_NAME: `book-process-queue-${TESTNAME}`,
},
project: process.env.GCLOUD_PROJECT, // needed for e2e URL
};
1 change: 1 addition & 0 deletions 7-gce/test/_test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ module.exports = {
SUBSCRIPTION_NAME: `shared-worker-subscription-${TESTNAME}`,
TOPIC_NAME: `book-process-queue-${TESTNAME}`,
},
project: process.env.GCLOUD_PROJECT, // needed for e2e URL
};