Skip to content

Commit

Permalink
fixups on function tests post bump
Browse files Browse the repository at this point in the history
Issue: BB-615
  • Loading branch information
benzekrimaha committed Jan 10, 2025
1 parent 7d60235 commit f047a0e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
23 changes: 13 additions & 10 deletions tests/functional/lifecycle/LifecycleTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -442,6 +445,12 @@ class LifecycleBucketProcessorMock {
ncvHeap: this.ncvHeap,
lcOptions: timeOptions,
circuitBreakers: this._circuitBreakers,
supportedRules: [
'expiration',
'noncurrentVersionExpiration',
'abortIncompleteMultipartUpload',
'transitions',
],
};
}

Expand Down Expand Up @@ -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);
});

Expand Down Expand Up @@ -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,
},
},
Expand All @@ -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,
},
},
Expand Down Expand Up @@ -1790,7 +1793,7 @@ describe('lifecycle task functional tests', function dF() {
},
expected: {
objects: ['src/obj-2'],
bucketCount: 5,
bucketCount: 6,
objectCount: 1,
},
},
Expand Down Expand Up @@ -1823,7 +1826,7 @@ describe('lifecycle task functional tests', function dF() {
},
expected: {
objects: [],
bucketCount: 5,
bucketCount: 6,
objectCount: 0,
},
},
Expand Down
4 changes: 4 additions & 0 deletions tests/functional/replication/queueProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down Expand Up @@ -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',
Expand Down
14 changes: 7 additions & 7 deletions tests/unit/lifecycle/LifecycleTask.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ const lp = {
ncvHeap: new Map(),
lcOptions: timeOptions,
log: fakeLogger,
supportedRules: [
'expiration',
'noncurrentVersionExpiration',
'abortIncompleteMultipartUpload',
'transitions',
'noncurrentVersionTransition',
],
}
),
};
Expand All @@ -93,13 +100,6 @@ describe('lifecycle task helper methods', () => {

before(() => {
lct = new LifecycleTask(lp);
lct.setSupportedRules([
'expiration',
'noncurrentVersionExpiration',
'abortIncompleteMultipartUpload',
'transitions',
'noncurrentVersionTransitions',
]);
});

afterEach(() => {
Expand Down

0 comments on commit f047a0e

Please sign in to comment.