Skip to content

Commit 26b0362

Browse files
CLDSRV-720: Add back file test null compat matrix
- Skip Restore tests for file v1 cf: CLDSRV-721
1 parent 4ed1bc2 commit 26b0362

4 files changed

Lines changed: 31 additions & 5 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,10 @@ jobs:
395395
strategy:
396396
matrix:
397397
include:
398-
- job-name: file-ft-tests
398+
- enable-null-compat: ''
399+
job-name: file-ft-tests
400+
- enable-null-compat: 'true'
401+
job-name: file-ft-tests-null-compat
399402
name: ${{ matrix.job-name }}
400403
runs-on: ubuntu-24.04
401404
needs: build
@@ -405,6 +408,7 @@ jobs:
405408
CLOUDSERVER_IMAGE: ghcr.io/${{ github.repository }}:${{ github.sha }}
406409
MONGODB_IMAGE: ghcr.io/${{ github.repository }}/ci-mongodb:${{ github.sha }}
407410
MPU_TESTING: "yes"
411+
ENABLE_NULL_VERSION_COMPAT_MODE: "${{ matrix.enable-null-compat }}"
408412
JOB_NAME: ${{ matrix.job-name }}
409413
steps:
410414
- name: Checkout

tests/functional/aws-node-sdk/test/object/mpuVersion.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const BucketUtility = require('../../lib/utility/bucket-util');
66
const metadata = require('../../../../../lib/metadata/wrapper');
77
const { DummyRequestLogger } = require('../../../../unit/helpers');
88
const checkError = require('../../lib/utility/checkError');
9-
const { getMetadata, fakeMetadataArchive } = require('../utils/init');
9+
const { getMetadata, fakeMetadataArchive, isNullKeyMetadataV1 } = require('../utils/init');
1010

1111
const log = new DummyRequestLogger();
1212

@@ -96,7 +96,11 @@ function checkObjMdAndUpdate(objMDBefore, objMDAfter, props) {
9696
});
9797
}
9898

99-
describe('MPU with x-scal-s3-version-id header', () => {
99+
// TODO: CLDSRV-721 RING 10 Support ObjectRestore (cold storage) with MD v1
100+
// The whole test suite is skipped as bad versionId breaks after each bucket cleanup
101+
const describeSkipNullMdV1 = isNullKeyMetadataV1 ? describe.skip : describe;
102+
103+
describeSkipNullMdV1('MPU with x-scal-s3-version-id header', () => {
100104
withV4(sigCfg => {
101105
let bucketUtil;
102106
let s3;

tests/functional/aws-node-sdk/test/object/putVersion.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const BucketUtility = require('../../lib/utility/bucket-util');
66
const metadata = require('../../../../../lib/metadata/wrapper');
77
const { DummyRequestLogger } = require('../../../../unit/helpers');
88
const checkError = require('../../lib/utility/checkError');
9-
const { getMetadata, fakeMetadataArchive } = require('../utils/init');
9+
const { getMetadata, fakeMetadataArchive, isNullKeyMetadataV1 } = require('../utils/init');
1010

1111
const log = new DummyRequestLogger();
1212

@@ -47,7 +47,11 @@ function checkObjMdAndUpdate(objMDBefore, objMDAfter, props) {
4747
});
4848
}
4949

50-
describe('PUT object with x-scal-s3-version-id header', () => {
50+
// TODO: CLDSRV-721 RING 10 Support ObjectRestore (cold storage) with MD v1
51+
// The whole test suite is skipped as bad versionId breaks after each bucket cleanup
52+
const describeSkipNullMdV1 = isNullKeyMetadataV1 ? describe.skip : describe;
53+
54+
describeSkipNullMdV1('PUT object with x-scal-s3-version-id header', () => {
5155
withV4(sigCfg => {
5256
let bucketUtil;
5357
let s3;

tests/functional/aws-node-sdk/test/utils/init.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ const log = new DummyRequestLogger();
77
const nonVersionedObjId =
88
versionIdUtils.getInfVid(config.replicationGroupId);
99

10+
const isMetadataOrFile = ['file', 'scality'].includes(config.backends.metadata);
11+
/**
12+
* With null version compat mode the null key should look like
13+
* 'object1putversion\u000099999999999999999999RG001 '
14+
* Without it for BucketFile backends it looks like
15+
* 'object1putversion\x00'
16+
*
17+
* The later case does not support ObjectRestore and needs some tests to be skipped.
18+
*
19+
* TODO: CLDSRV-721 RING 10 Support ObjectRestore (cold storage) with MD v1
20+
*/
21+
const isNullKeyMetadataV1 = isMetadataOrFile && !config.nullVersionCompatMode;
22+
1023
function decodeVersionId(versionId) {
1124
let decodedVersionId;
1225
if (versionId) {
@@ -87,6 +100,7 @@ function fakeMetadataArchive(bucketName, objectName, versionId, archive, cb) {
87100
}
88101

89102
module.exports = {
103+
isNullKeyMetadataV1,
90104
initMetadata,
91105
getMetadata,
92106
fakeMetadataArchive,

0 commit comments

Comments
 (0)