Skip to content

Commit

Permalink
Refactor debug log in ReplicateObject.js and update tests for check s…
Browse files Browse the repository at this point in the history
…ource replication
  • Loading branch information
KillianG committed Oct 16, 2024
1 parent 4264a48 commit 588fc14
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions tests/functional/replication/queueProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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

Expand All @@ -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 => {
Expand All @@ -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',
Expand All @@ -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);
Expand Down

0 comments on commit 588fc14

Please sign in to comment.