From f047a0e3acc61d499ccb3864ff661d4780a54709 Mon Sep 17 00:00:00 2001 From: Maha Benzekri Date: Fri, 10 Jan 2025 09:14:12 +0100 Subject: [PATCH] fixups on function tests post bump Issue: BB-615 --- tests/functional/lifecycle/LifecycleTask.js | 23 +++++++++++-------- .../functional/replication/queueProcessor.js | 4 ++++ tests/unit/lifecycle/LifecycleTask.spec.js | 14 +++++------ 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/tests/functional/lifecycle/LifecycleTask.js b/tests/functional/lifecycle/LifecycleTask.js index fbb860e3b..c4755b809 100644 --- a/tests/functional/lifecycle/LifecycleTask.js +++ b/tests/functional/lifecycle/LifecycleTask.js @@ -63,12 +63,15 @@ const backbeatMetadataProxyMock = { // current date const CURRENT = new Date(); CURRENT.setDate(CURRENT.getDate() - 2); +CURRENT.setUTCHours(0, 0, 0, 0); // 5 days prior to currentDate const PAST = new Date(CURRENT); PAST.setDate(PAST.getDate() - 5); +PAST.setUTCHours(0, 0, 0, 0); // 5 days after currentDate const FUTURE = new Date(CURRENT); FUTURE.setDate(FUTURE.getDate() + 5); +FUTURE.setUTCHours(0, 0, 0, 0); const OWNER = 'testOwner'; const ncd = 'NoncurrentDays'; @@ -442,6 +445,12 @@ class LifecycleBucketProcessorMock { ncvHeap: this.ncvHeap, lcOptions: timeOptions, circuitBreakers: this._circuitBreakers, + supportedRules: [ + 'expiration', + 'noncurrentVersionExpiration', + 'abortIncompleteMultipartUpload', + 'transitions', + ], }; } @@ -503,12 +512,6 @@ describe('lifecycle task functional tests', function dF() { lcp = new LifecycleBucketProcessorMock(); s3 = new S3(s3config); lcTask = new LifecycleTask(lcp); - lcTask.setSupportedRules([ - 'expiration', - 'noncurrentVersionExpiration', - 'abortIncompleteMultipartUpload', - 'transitions', - ]); s3Helper = new S3Helper(s3); }); @@ -1650,7 +1653,7 @@ describe('lifecycle task functional tests', function dF() { }, expected: { objects: Array(7).fill('test/obj-1'), - bucketCount: 5, + bucketCount: 6, objectCount: 7, }, }, @@ -1676,7 +1679,7 @@ describe('lifecycle task functional tests', function dF() { }, expected: { objects: Array(2).fill('src/obj-2'), - bucketCount: 5, + bucketCount: 6, objectCount: 2, }, }, @@ -1790,7 +1793,7 @@ describe('lifecycle task functional tests', function dF() { }, expected: { objects: ['src/obj-2'], - bucketCount: 5, + bucketCount: 6, objectCount: 1, }, }, @@ -1823,7 +1826,7 @@ describe('lifecycle task functional tests', function dF() { }, expected: { objects: [], - bucketCount: 5, + bucketCount: 6, objectCount: 0, }, }, diff --git a/tests/functional/replication/queueProcessor.js b/tests/functional/replication/queueProcessor.js index 8156d874e..011796685 100644 --- a/tests/functional/replication/queueProcessor.js +++ b/tests/functional/replication/queueProcessor.js @@ -604,10 +604,12 @@ class S3Mock extends TestConfigurator { status: 'PENDING', dataStoreVersionId: '', }], + dataStoreVersionId: '', content: replicatedContent, destination: this.getParam('source.md.replicationInfo.destination'), storageClass: 'sf,toazure', role: this.getParam('source.md.replicationInfo.role'), + storageType: '', }); assert.strictEqual(parsedMd['owner-id'], this.getParam('target.canonicalId')); @@ -661,6 +663,8 @@ class S3Mock extends TestConfigurator { status: 'PENDING', dataStoreVersionId: '', }], + dataStoreVersionId: '', + storageType: '', content: this.getParam('source.md.replicationInfo.content'), destination: this.getParam('source.md.replicationInfo.destination'), storageClass: 'sf,toazure', diff --git a/tests/unit/lifecycle/LifecycleTask.spec.js b/tests/unit/lifecycle/LifecycleTask.spec.js index 824f8c2e5..82e50be0e 100644 --- a/tests/unit/lifecycle/LifecycleTask.spec.js +++ b/tests/unit/lifecycle/LifecycleTask.spec.js @@ -84,6 +84,13 @@ const lp = { ncvHeap: new Map(), lcOptions: timeOptions, log: fakeLogger, + supportedRules: [ + 'expiration', + 'noncurrentVersionExpiration', + 'abortIncompleteMultipartUpload', + 'transitions', + 'noncurrentVersionTransition', + ], } ), }; @@ -93,13 +100,6 @@ describe('lifecycle task helper methods', () => { before(() => { lct = new LifecycleTask(lp); - lct.setSupportedRules([ - 'expiration', - 'noncurrentVersionExpiration', - 'abortIncompleteMultipartUpload', - 'transitions', - 'noncurrentVersionTransitions', - ]); }); afterEach(() => {