Skip to content

Commit

Permalink
fix 641: remove vm after test (#644)
Browse files Browse the repository at this point in the history
Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com>
  • Loading branch information
wutonggg and sofisl committed Sep 2, 2022
1 parent dd647e5 commit 7f32711
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/google-cloud-asset/samples/test/sample.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ describe('quickstart sample tests', () => {
await bucket.create();
await bigquery.createDataset(datasetId, options);
await bigquery.dataset(datasetId).exists();
// [vm] = await zone.vm(vmName, {os: 'ubuntu'});

const [response] = await instancesClient.insert({
instanceResource: {
Expand Down Expand Up @@ -107,6 +106,22 @@ describe('quickstart sample tests', () => {
after(async () => {
await bucket.delete();
await bigquery.dataset(datasetId).delete({force: true}).catch(console.warn);
const [response] = await instancesClient.delete({
instance: instanceName,
project: projectId,
zone,
});
let operation = response.latestResponse;
const operationsClient = new compute.ZoneOperationsClient();

// Wait for the delete operation to complete.
while (operation.status !== 'DONE') {
[operation] = await operationsClient.wait({
operation: operation.name,
project: projectId,
zone: operation.zone.split('/').pop(),
});
}
});

it('should export assets to specified path', async () => {
Expand Down

0 comments on commit 7f32711

Please sign in to comment.