From 588fc14a5e9f9622312bf26d919b56c5a93d042e Mon Sep 17 00:00:00 2001 From: KillianG Date: Wed, 16 Oct 2024 23:30:55 +0200 Subject: [PATCH] Refactor debug log in ReplicateObject.js and update tests for check source replication --- .../functional/replication/queueProcessor.js | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/tests/functional/replication/queueProcessor.js b/tests/functional/replication/queueProcessor.js index 001869de6..eafbd497f 100644 --- a/tests/functional/replication/queueProcessor.js +++ b/tests/functional/replication/queueProcessor.js @@ -752,8 +752,9 @@ function sendCopyLocationAction(s3mock, queueProcessor, resultsCb) { } /* eslint-enable max-len */ +/* eslint-disable mocha/no-exclusive-tests */ -describe('queue processor functional tests with mocking', () => { +describe.only('queue processor functional tests with mocking', () => { let queueProcessorSF; let queueProcessorAzure; let replicationStatusProcessor; @@ -990,7 +991,7 @@ describe('queue processor functional tests with mocking', () => { }); }); - describe('error paths', function errorPaths() { + describe.only('error paths', function errorPaths() { this.timeout(20000); // give more time to leave room for retry // delays and timeout @@ -1016,7 +1017,7 @@ describe('queue processor functional tests with mocking', () => { }); }); - describe('source S3 errors', () => { + describe.only('source S3 errors', () => { [errors.AccessDenied, errors.ObjNotFound].forEach(error => { it(`replication should skip on ${error.code} ` + `(${error.message}) from source S3 on getObject`, done => { @@ -1032,23 +1033,6 @@ describe('queue processor functional tests with mocking', () => { }); }); - it('should fail if unable to get metadata', done => { - s3mock.setParam('nbParts', 2); - s3mock.installBackbeatErrorResponder('source.s3.getMetadata', - errors.ObjNotFound, - { once: true }); - async.parallel([ - done => { - s3mock.onPutSourceMd = done; - }, - done => queueProcessorSF.processReplicationEntry( - s3mock.getParam('kafkaEntry'), err => { - s3mock.log.error('error>>>>>>>>>>>>>>>>', err); - done(); - }), - ], done); - }); - it(`copy location should skip on ${error.code} ` + `(${error.message}) from source S3 on getObject`, done => { s3mock.installS3ErrorResponder('source.s3.getObject', @@ -1075,6 +1059,23 @@ describe('queue processor functional tests with mocking', () => { }); }); + it.only('should fail if unable to get metadata', done => { + s3mock.setParam('nbParts', 2); + s3mock.installBackbeatErrorResponder('source.s3.getMetadata', + {}, + { once: true }); + async.parallel([ + done => { + s3mock.onPutSourceMd = done; + }, + done => queueProcessorSF.processReplicationEntry( + s3mock.getParam('kafkaEntry'), err => { + s3mock.log.error('error>>>>>>>>>>>>>>>>', err); + done(); + }), + ], done); + }); + it('should fail if replication is disabled in bucket replication ' + 'configuration', done => { s3mock.setParam('replicationEnabled', false);