Skip to content

Commit

Permalink
feat:changes to update backup sample
Browse files Browse the repository at this point in the history
  • Loading branch information
asthamohta committed Jan 4, 2022
1 parent f200a1c commit 069c74c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 18 deletions.
1 change: 0 additions & 1 deletion samples/backups-copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ function main(
// Instantiates a client
const spanner = new Spanner({
projectId: projectId,
apiEndpoint: 'staging-wrenchworks.sandbox.googleapis.com',
});

async function spannerCopyBackup() {
Expand Down
2 changes: 0 additions & 2 deletions samples/backups-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ async function updateBackup(instanceId, backupId, projectId) {
// Creates a client
const spanner = new Spanner({
projectId: projectId,
apiEndpoint: 'staging-wrenchworks.sandbox.googleapis.com',
});

// Gets a reference to a Cloud Spanner instance and backup
Expand Down Expand Up @@ -61,4 +60,3 @@ async function updateBackup(instanceId, backupId, projectId) {
}

module.exports.updateBackup = updateBackup;
//updateBackup('test-cross-region', 'backup123', 'appdev-soda-spanner-staging');
1 change: 1 addition & 0 deletions system-test/spanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const GAX_OPTIONS: CallOptions = {
};

const CURRENT_TIME = Math.round(Date.now() / 1000).toString();

describe('Spanner', () => {
const envInstanceName = process.env.SPANNERTEST_INSTANCE;
// True if a new instance has been created for this test run, false if reusing an existing instance
Expand Down
15 changes: 0 additions & 15 deletions test/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1457,12 +1457,6 @@ describe('Instance', () => {
},
];

const COPY_BACKUPS = [
{
expireTime: new PreciseDate(1000),
},
];

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const REQUEST_RESPONSE_ARGS: any = [null, BACKUPS, null, {}];

Expand Down Expand Up @@ -1635,7 +1629,6 @@ describe('Instance', () => {

describe('backup', () => {
const BACKUP_NAME = 'backup-name';
const COPY_BACKUP_NAME = 'copy-backup-name';

it('should throw if a backup ID is not provided', () => {
assert.throws(() => {
Expand All @@ -1649,14 +1642,6 @@ describe('Instance', () => {
assert.strictEqual(backup.calledWith_[0], instance);
assert.strictEqual(backup.calledWith_[1], BACKUP_NAME);
});

it('should return an instance of Copy Backup', () => {
const copy_backup = instance.copy_backup(COPY_BACKUP_NAME, BACKUP_NAME) as {} as FakeBackup;
assert(copy_backup instanceof FakeBackup);
assert.strictEqual(copy_backup.calledWith_[0], instance);
assert.strictEqual(copy_backup.calledWith_[1], COPY_BACKUP_NAME);
assert.strictEqual(copy_backup.calledWith_[2], BACKUP_NAME);
});
});

describe('getBackupOperations', () => {
Expand Down

0 comments on commit 069c74c

Please sign in to comment.