Skip to content

Commit 337a753

Browse files
cleanup tests
ISSUE: CLDSRVCLT-2
1 parent 5be9d7b commit 337a753

File tree

8 files changed

+7
-14
lines changed

8 files changed

+7
-14
lines changed

tests/testApis.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ describe('CloudServer API Tests', () => {
5050
});
5151

5252
it('should test GetSingleObject', async () => {
53-
// S3VAULT=mem S3METADATA=scality S3DATA=mem
5453
const getInput: GetObjectInput = {
5554
Bucket: testConfig.bucketName,
5655
Key: testConfig.objectKey,
@@ -76,7 +75,6 @@ describe('CloudServer API Tests', () => {
7675
});
7776

7877
it('should test BatchDelete', async () => {
79-
// S3VAULT=mem S3METADATA=scality S3DATA=mem
8078
const locations: BatchDeleteLocation[] = [
8179
{
8280
dataStoreName: "mem",

tests/testErrorHandling.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ describe('CloudServer test error handling', () => {
1616
});
1717

1818
it('should test xml parsing', async () => {
19-
// Run CloudServer with : S3VAULT=mem S3METADATA=mem S3DATA=mem REMOTE_MANAGEMENT_DISABLE=true yarn start
20-
// Needs to tamper with Cloudserver response manually to return an html error..
2119
try {
2220
const getInput: GetObjectInput = {
2321
Bucket: testConfig.bucketName,
@@ -35,6 +33,7 @@ describe('CloudServer test error handling', () => {
3533

3634
it.skip('should test html parsing', async () => {
3735
// Run CloudServer with : S3VAULT=mem S3METADATA=mem S3DATA=mem REMOTE_MANAGEMENT_DISABLE=true yarn start
36+
// Needs to tamper with Cloudserver response manually to return an html error
3837
try {
3938
const deleteInput: MultipleBackendDeleteObjectInput = {
4039
Bucket: 'testConfig.bucketName',

tests/testIndexesApis.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ describe('CloudServer Indexes API Tests', () => {
1818
});
1919

2020
it('should test PutBucketIndexes', async () => {
21-
// S3VAULT=mem S3METADATA=mongodb S3DATA=mem
2221
const indexData = JSON.stringify([
2322
{
2423
name: "testIndex1",
@@ -38,7 +37,6 @@ describe('CloudServer Indexes API Tests', () => {
3837
});
3938

4039
it('should test GetBucketIndexes', async () => {
41-
// S3VAULT=mem S3METADATA=mongodb S3DATA=mem
4240
const getBucketIndexesInput: GetBucketIndexesInput = {
4341
Bucket: testConfig.bucketName,
4442
};

tests/testLifecycleApis.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ describe('CloudServer Lifecycle API Tests', () => {
2020
});
2121

2222
it('should test ListLifecycleCurrents', async () => {
23-
// Run Cloudserver with : S3VAULT=mem S3METADATA=mongodb S3DATA=mem REMOTE_MANAGEMENT_DISABLE=true yarn start
2423
const listInput: ListLifecycleCurrentsInput = {
2524
Bucket: testConfig.bucketName,
2625
MaxKeys: 1,

tests/testMetadataApis.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ describe('CloudServer Metadata API Tests', () => {
1818
});
1919

2020
it('should test GetMetadata API', async () => {
21-
// Run Cloudserver with : S3VAULT=mem S3METADATA=mongodb S3DATA=mem REMOTE_MANAGEMENT_DISABLE=true yarn start
2221
const getMetadataInput: GetMetadataInput = {
2322
Bucket: testConfig.bucketName,
2423
Key: testConfig.objectKey,
@@ -29,14 +28,14 @@ describe('CloudServer Metadata API Tests', () => {
2928
});
3029

3130
it('should test PutMetadata API', async () => {
32-
// S3VAULT=mem S3METADATA=scality S3DATA=mem
3331
const metadataObj = {
3432
"content-length": 1000,
3533
"content-type": "text/plain",
3634
"x-amz-meta-custom": "test-valuee",
3735
"last-modified": new Date().toISOString(),
3836
"etag": "\"d41d8cd98f00b204e9800998ecf8427e\"",
39-
"x-amz-version-id": "null"
37+
"x-amz-version-id": "null",
38+
"replicationInfo": {}
4039
};
4140

4241
const metadataString = JSON.stringify(metadataObj);
@@ -55,7 +54,6 @@ describe('CloudServer Metadata API Tests', () => {
5554

5655

5756
it('should test GetBucketMetadata API', async () => {
58-
// S3VAULT=mem S3METADATA=scality S3DATA=mem
5957
const getBucketMetadataInput: GetBucketMetadataInput = {
6058
Bucket: testConfig.bucketName,
6159
};

tests/testMultipleBackendApis.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
184184
}
185185
});
186186

187-
it('should test MultipleBackendMPU API', async () => {
187+
it.skip('should test MultipleBackendMPU API', async () => {
188188
const initiateMPUInput: MultipleBackendInitiateMPUInput = {
189189
Bucket: testConfig.bucketName,
190190
Key: `${testConfig.objectKey}-mpu`,

tests/testRaftApis.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ describe('CloudServer Raft API Tests', () => {
107107
logRes.log.on('data', (record: any) => {
108108
logStats.nbLogRecordsRead += 1;
109109
if (record.entries) {
110-
record.entries.forEach((entry: any) => {
110+
record.entries.forEach((_entry: any) => {
111111
logStats.nbLogEntriesRead += 1;
112112
});
113113
}

tests/testSetup.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import https from 'https';
2+
import assert from 'assert';
23
import { CloudserverClient, CloudserverClientConfig } from '../src/index';
34
import { S3Client, PutObjectCommand, CreateBucketCommand, PutBucketVersioningCommand } from '@aws-sdk/client-s3';
45
import { AwsCredentialIdentity, AwsCredentialIdentityProvider } from '@aws-sdk/types';
@@ -71,7 +72,7 @@ async function initBucketForTests() {
7172
});
7273
await s3client.send(putObjectCommand);
7374
} catch (error: any) {
74-
console.log('S3 operation failed:', error);
75+
assert.fail(`Failed to initialize bucket for tests: ${error}`);
7576
}
7677
}
7778

0 commit comments

Comments
 (0)