GCETestMachine

GCETestMachine

Interacts with the Google Compute Engine to interact with machines to create testing environments.

Constructor

new GCETestMachine(opts)

Source:
Parameters:
Name Type Description
opts TestMachineOptions

options to configure the test machine.

Methods

createInstance() → {Promise}

Source:

Creates a new Google Compute Engine machine for testing.

Returns:

resolves when the machine has been created.

Type
Promise

destroyInstance() → {Promise}

Source:

Destroys the Google Compute Engine machine used for testing.

Returns:

resolves when the machine has been destroyed.

Type
Promise

getInstances() → {Promise.<Array>}

Source:

Fetches all running Google Compute Engine machines.

Returns:

resolves to the current running machines. Each includes { id, name, zone, creationTimestamp }.

Type
Promise.<Array>

salt() → {String}

Source:

Creates a random alphabetical string to generate unique machine names.

Returns:

a random alphabetical string.

Type
String

ssh(command) → {Promise}

Source:
To Do:
  • Fix 'manual' SSH.

Runs an SSH connection to the current Coogle Compute Engine instance.

Parameters:
Name Type Description
command String

a command to execute on the remote machine. If not provided, an interactive SSH session is started.

Throws:

if the SSH command doesn't return within the set timeout.

Type
TimeoutError
Returns:

resolves when the SSH connection terminates.

Type
Promise