Skip to content

Commit

Permalink
Delete unused tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ace-n committed Nov 14, 2022
1 parent 7cc5779 commit d4151f9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 85 deletions.
49 changes: 0 additions & 49 deletions compute/test/createStartInstance.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,24 +127,6 @@ describe('create start instance tests', () => {
);
});

it('should create instance from public image', async () => {
const projectId = await instancesClient.getProjectId();
let output;
try {
output = execSync(
`node instances/create-start-instance/createInstanceFromPublicImage ${projectId} ${zone} ${instanceName}`
);
} catch (err) {
if (err.message.includes('already exists')) {
return;
}
throw err;
}
assert.match(output, /Instance created./);

execSync(`node deleteInstance ${projectId} ${zone} ${instanceName}`);
});

it('should create instance from snapshot', async () => {
const projectId = await instancesClient.getProjectId();

Expand Down Expand Up @@ -176,37 +158,6 @@ describe('create start instance tests', () => {
await deleteDisk(projectId, zone, diskName);
});

it('should create instance with snapshotted data disk', async () => {
const projectId = await instancesClient.getProjectId();

const [newestDebian] = await imagesClient.getFromFamily({
project: 'debian-cloud',
family: 'debian-10',
});

await createDisk(projectId, zone, diskName, newestDebian.selfLink);
await createDiskSnapshot(projectId, zone, diskName, snapshotName);

const diskSnapshotLink = `projects/${projectId}/global/snapshots/${snapshotName}`;

let output;
try {
output = execSync(
`node instances/create-start-instance/createInstanceWithSnapshottedDataDisk ${projectId} ${zone} ${instanceName} ${diskSnapshotLink}`
);
} catch (err) {
if (err.message.includes('already exists')) {
return;
}
throw err;
}
assert.match(output, /Instance created./);
execSync(`node deleteInstance ${projectId} ${zone} ${instanceName}`);

await deleteDiskSnapshot(projectId, snapshotName);
await deleteDisk(projectId, zone, diskName);
});

it('should create instance from custom image', async () => {
const projectId = await instancesClient.getProjectId();

Expand Down
25 changes: 0 additions & 25 deletions compute/test/creatingManagingWindows.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,11 @@ const {assert} = require('chai');
const {generateTestId, getStaleVMInstances, deleteInstance} = require('./util');

const instancesClient = new compute.InstancesClient();
const firewallsClient = new compute.FirewallsClient();
const routesClient = new compute.RoutesClient();
const globalOperationsClient = new compute.GlobalOperationsClient();

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

const deleteFirewallRule = async (projectId, firewallRule) => {
const [response] = await firewallsClient.delete({
project: projectId,
firewall: firewallRule,
});
let operation = response.latestResponse;

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

const deleteRoute = async (projectId, routeName) => {
const [response] = await routesClient.delete({
project: projectId,
Expand All @@ -64,7 +47,6 @@ const deleteRoute = async (projectId, routeName) => {

describe('creating managing windows instances tests', () => {
const instanceName = generateTestId();
const firewallRuleName = generateTestId();
const networkName = 'global/networks/default-compute';
const subnetworkName = 'regions/europe-central2/subnetworks/default-compute';
const routeName = generateTestId();
Expand Down Expand Up @@ -101,20 +83,13 @@ describe('creating managing windows instances tests', () => {

assert.match(output, /Instance created./);

const outputFirewall = execSync(
`node instances/windows/creating-managing-windows-instances/createFirewallRuleForWindowsActivationHost ${projectId} ${firewallRuleName} ${networkName}`
);

assert.match(outputFirewall, /Firewall rule created./);

const outputRoute = execSync(
`node instances/windows/creating-managing-windows-instances/createRouteToWindowsActivationHost ${projectId} ${routeName} ${networkName}`
);

assert.match(outputRoute, /Route created./);

await deleteRoute(projectId, routeName);
await deleteFirewallRule(projectId, firewallRuleName);
execSync(`node deleteInstance ${projectId} ${zone} ${instanceName}`);
});
});
11 changes: 0 additions & 11 deletions compute/test/disks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,6 @@ describe('disks tests', () => {
await deleteDisk(projectId, zone, diskName);
});

it('should create empty disk', async () => {
const projectId = await instancesClient.getProjectId();

const output = execSync(
`node disks/createEmptyDisk ${projectId} ${zone} ${diskName} ${diskType} 10`
);
assert.match(output, /Disk created./);

await deleteDisk(projectId, zone, diskName);
});

it('should set autodelete field', async () => {
const projectId = await instancesClient.getProjectId();

Expand Down

0 comments on commit d4151f9

Please sign in to comment.