diff --git a/src/backups.js b/src/backups.js index 9331e9a19..ca9a4d8b1 100644 --- a/src/backups.js +++ b/src/backups.js @@ -240,8 +240,6 @@ function sync(backupConfig, backupId, dataDir, callback) { } else if (task.operation === 'removedir') { safe.fs.writeFileSync(paths.BACKUP_RESULT_FILE, 'Removing directory ' + task.path); api(backupConfig.provider).removeDir(backupConfig, backupFilePath, iteratorCallback); - } else if (task.operation === 'mkdir') { // unused - safe.fs.writeFileSync(paths.BACKUP_RESULT_FILE, 'Adding directory ' + task.path); } }, 10 /* concurrency */, function (error) { if (error) return callback(new BackupsError(BackupsError.EXTERNAL_ERROR, error.message)); diff --git a/src/syncer.js b/src/syncer.js index ee8a0826c..5c23f1331 100644 --- a/src/syncer.js +++ b/src/syncer.js @@ -78,7 +78,6 @@ function sync(dir, taskProcessor, concurrency, callback) { function traverse(relpath) { var entries = readTree(path.join(dir, relpath)); - // addQueue.push({ operation: 'mkdir', path: relpath }); for (var i = 0; i < entries.length; i++) { var entryPath = path.join(relpath, entries[i].name); var entryStat = entries[i].stat; diff --git a/src/test/backups-test.js b/src/test/backups-test.js index c0bc2dd1b..086e099e6 100644 --- a/src/test/backups-test.js +++ b/src/test/backups-test.js @@ -100,7 +100,7 @@ describe('backups', function () { }; it('succeeds without backups', function (done) { - backups.cleanup(done); + backups.cleanup({ username: 'test' }, done); }); it('succeeds with box backups, keeps latest', function (done) { @@ -112,7 +112,7 @@ describe('backups', function () { }, function (error) { expect(error).to.not.be.ok(); - backups.cleanup(function (error) { + backups.cleanup({ username: 'test' }, function (error) { expect(error).to.not.be.ok(); backupdb.getByTypePaged(backupdb.BACKUP_TYPE_BOX, 1, 1000, function (error, result) { @@ -133,7 +133,7 @@ describe('backups', function () { }); it('does not remove expired backups if only one left', function (done) { - backups.cleanup(function (error) { + backups.cleanup({ username: 'test' }, function (error) { expect(error).to.not.be.ok(); backupdb.getByTypePaged(backupdb.BACKUP_TYPE_BOX, 1, 1000, function (error, result) { @@ -158,7 +158,7 @@ describe('backups', function () { // wait for expiration setTimeout(function () { - backups.cleanup(function (error) { + backups.cleanup({ username: 'test' }, function (error) { expect(error).to.not.be.ok(); backupdb.getByTypePaged(backupdb.BACKUP_TYPE_APP, 1, 1000, function (error, result) { diff --git a/src/test/storage-test.js b/src/test/storage-test.js index 54c56069c..beda5eb27 100644 --- a/src/test/storage-test.js +++ b/src/test/storage-test.js @@ -17,6 +17,7 @@ var async = require('async'), MockS3 = require('mock-aws-s3'), os = require('os'), path = require('path'), + progress = require('../progress.js'), readdirp = require('readdirp'), rimraf = require('rimraf'), s3 = require('../storage/s3.js'), @@ -303,6 +304,8 @@ describe('Storage', function () { it('can copy backup', function (done) { // will be verified after removing the first and restoring from the copy + progress.set(progress.BACKUP, 10, 'Testing'); + s3.copy(gBackupConfig, gBackupId_1, gBackupId_2, done); });