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: Wait for instances to get created in all samples #1149

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
5 changes: 3 additions & 2 deletions samples/test/app-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const appProfileSnippets = require('./app-profile.js');
const instance = bigtable.instance(INSTANCE_ID);

describe.skip('App Profile Snippets', () => {
before(() => {
instance.create({
before(async () => {
const [, operation] = await instance.create({
clusters: [
{
name: CLUSTER_ID,
Expand All @@ -39,6 +39,7 @@ describe.skip('App Profile Snippets', () => {
],
type: 'DEVELOPMENT',
});
await operation.promise();
});

after(() => {
Expand Down
3 changes: 2 additions & 1 deletion samples/test/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const instance = bigtable.instance(INSTANCE_ID);
describe.skip('Cluster Snippets', () => {
before(async () => {
try {
await instance.create({
const [, operation] = await instance.create({
clusters: [
{
name: CLUSTER_ID,
Expand All @@ -39,6 +39,7 @@ describe.skip('Cluster Snippets', () => {
],
type: 'DEVELOPMENT',
});
await operation.promise();
} catch (err) {
// Handle the error.
}
Expand Down
3 changes: 2 additions & 1 deletion samples/test/family.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const instance = bigtable.instance(INSTANCE_ID);
describe.skip('Family Snippets', () => {
before(async () => {
try {
await instance.create({
const [, operation] = await instance.create({
clusters: [
{
name: CLUSTER_ID,
Expand All @@ -41,6 +41,7 @@ describe.skip('Family Snippets', () => {
],
type: 'DEVELOPMENT',
});
await operation.promise();
await instance.createTable(TABLE_ID);
} catch (err) {
//
Expand Down
3 changes: 2 additions & 1 deletion samples/test/instances.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const instance = bigtable.instance(instanceId);

describe('instances', () => {
before(async () => {
await instance.create({
const [, operation] = await instance.create({
clusters: [
{
id: clusterId,
Expand All @@ -38,6 +38,7 @@ describe('instances', () => {
},
],
});
await operation.promise();
});

after(() => instance.delete());
Expand Down
3 changes: 2 additions & 1 deletion samples/test/row.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const instance = bigtable.instance(INSTANCE_ID);
describe.skip('Row Snippets', () => {
before(async () => {
try {
await instance.create({
const [, operation] = await instance.create({
clusters: [
{
name: CLUSTER_ID,
Expand All @@ -40,6 +40,7 @@ describe.skip('Row Snippets', () => {
],
type: 'DEVELOPMENT',
});
await operation.promise();
await instance.createTable(TABLE_ID);
} catch (err) {
// Handle the error.
Expand Down
3 changes: 2 additions & 1 deletion samples/test/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const instance = bigtable.instance(INSTANCE_ID);
describe.skip('Table Snippets', () => {
before(async () => {
try {
await instance.create({
const [, operation] = await instance.create({
clusters: [
{
name: CLUSTER_ID,
Expand All @@ -40,6 +40,7 @@ describe.skip('Table Snippets', () => {
],
type: 'DEVELOPMENT',
});
await operation.promise();
} catch (err) {
// Handle the error.
}
Expand Down