-
Notifications
You must be signed in to change notification settings - Fork 2k
functions/billing: Node 8 + system tests #1361
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
13e194c
functions/billing: node 8 + system tests
c7bfd32
Fix tabs/spaces
5eda42e
Merge branch 'master' into gcf-billing-node8
fhinkel c8c2a03
Merge branch 'master' into gcf-billing-node8
fe605ec
Remove BASE_URL env var
ef78cbf
Merge branch 'gcf-billing-node8' of https://github.com/GoogleCloudPla…
db5f593
Use default Kokoro image
f66cc39
Handle linux's ungraceful timeouts
29f1524
DEBUG project id issue
36ddfe2
Revert "DEBUG project id issue"
4dd308a
Put asserts before FF process await
874767f
Merge branch 'master' into gcf-billing-node8
fhinkel 5a163f1
Actually cat secret files
6d4a43b
Merge branch 'gcf-billing-node8' of https://github.com/GoogleCloudPla…
fb430a6
Fix syntax typo
b3c3ebb
Use different ports + actual function URLs
f301856
Merge branch 'master' into gcf-billing-node8
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| # Set the folder in which the tests are run | ||
| env_vars: { | ||
| key: "PROJECT" | ||
| value: "functions/billing" | ||
| } | ||
|
|
||
| # Set the test command to run (only for functions/billing) | ||
| env_vars: { | ||
| key: "TEST_CMD" | ||
| value: "compute-test" | ||
| } | ||
|
|
||
| # Configure the docker image for kokoro-trampoline. | ||
| env_vars: { | ||
| key: "TRAMPOLINE_IMAGE" | ||
| value: "gcr.io/cloud-devrel-kokoro-resources/node:8-user" | ||
| } | ||
|
|
||
| # Tell the trampoline which build file to use. | ||
| env_vars: { | ||
| key: "TRAMPOLINE_BUILD_FILE" | ||
| value: "github/nodejs-docs-samples/.kokoro/functions/functions-billing.sh" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Copyright 2019, 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 | ||
| # | ||
| # 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=cdpe-functions-billing-test | ||
| export GCP_PROJECT=$GCLOUD_PROJECT | ||
| export GOOGLE_CLOUD_PROJECT=$GCLOUD_PROJECT | ||
|
|
||
| export GCF_REGION=us-central1 | ||
| export NODE_ENV=development | ||
|
|
||
| # Configure GCF variables | ||
| export BASE_URL="http://localhost:8010/${GCLOUD_PROJECT}/${GCF_REGION}" | ||
|
|
||
| # Configure Slack variables | ||
| export BOT_ACCESS_TOKEN=${KOKORO_GFILE_DIR}/secrets-slack-bot-access-token.txt | ||
| export CHANNEL=${KOKORO_GFILE_DIR}/secrets-slack-channel-id.txt | ||
| export BILLING_ACCOUNT=${KOKORO_GFILE_DIR}/secrets-billing-account-id.txt | ||
|
|
||
| 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 | ||
|
|
||
| npm run ${TEST_CMD} | ||
|
|
||
| exit $? | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,8 @@ | |
| "node": ">=8.0.0" | ||
| }, | ||
| "scripts": { | ||
| "test": "mocha test/*.test.js --timeout=20000" | ||
| "compute-test": "mocha test/periodic.test.js --timeout=600000", | ||
| "test": "mocha test/index.test.js --timeout=5000" | ||
| }, | ||
| "author": "Ace Nassri <[email protected]>", | ||
| "license": "Apache-2.0", | ||
|
|
@@ -17,9 +18,14 @@ | |
| "slack": "^11.0.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@google-cloud/functions-framework": "^1.1.1", | ||
| "@google-cloud/nodejs-repo-tools": "^3.3.0", | ||
| "child-process-promise": "^2.2.1", | ||
| "mocha": "^6.0.0", | ||
| "promise-retry": "^1.1.1", | ||
| "proxyquire": "^2.1.0", | ||
| "sinon": "^7.0.0" | ||
| "request": "^2.88.0", | ||
| "requestretry": "^4.0.0", | ||
| "sinon": "^7.3.2" | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this env variable being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it's used elsewhere - I was mainly adding it to save us the trouble if future samples start relying on it.