Skip to content

Commit

Permalink
docs(samples): add usage samples to show handling of LRO response Ope…
Browse files Browse the repository at this point in the history
…ration (#519)

* improvements: add samples

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* test: add tests for the samples

* fix: merge conflict

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* cleanup: rearrange region tags

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix: replace beforeEach with before

* fix: failing test cases

* cleanup: rearrange code lines

* test: fix the timeout and race issues in tests

* cleanup: rename fn

* fix: mocha test definition

* cleanup: change console log

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix: failing test due package

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix: linting errors

* fix: add netowkr as arg

* lint: fix test js

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* test: add ci network to test

* cleanup: ammend as per PR comments

* cleanup: remove unused dep

* fix: test case

* doc: add explanation to the test util file

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* doc: fix typos

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* lint: fix errors

* fix: move after block

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and ahrarmonsur committed Nov 17, 2022
1 parent 98156f7 commit e887920
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions container/snippets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
"*.js"
],
"scripts": {
"test": "mocha system-test --timeout 10000"
"test": "mocha system-test --timeout 1000000"
},
"dependencies": {
"@google-cloud/container": "^2.6.0"
"@google-cloud/container": "^2.6.0",
"uuid": "^8.3.2"
},
"devDependencies": {
"chai": "^4.2.0",
Expand Down
5 changes: 3 additions & 2 deletions container/snippets/quickstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

'use strict';

// [START gke_list_cluster]
async function main() {
// [START container_quickstart]
const container = require('@google-cloud/container');
Expand All @@ -30,11 +31,11 @@ async function main() {
};

const [response] = await client.listClusters(request);
console.log('Clusters:');
console.log(response);
console.log('Clusters: ', response);
}
quickstart();
// [END container_quickstart]
}

main().catch(console.error);
// [END gke_list_cluster]
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const cp = require('child_process');

const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

describe('container samples', () => {
describe('container samples - quickstart', () => {
it('should run the quickstart', async () => {
const stdout = execSync('node quickstart');
assert.match(stdout, /Clusters:/);
Expand Down

0 comments on commit e887920

Please sign in to comment.