Make permission tests compatible with minio-js v8 (#3323)

Fixes #3322
This commit is contained in:
Kaan Kabalak
2024-05-01 02:45:09 -07:00
committed by GitHub
parent fe534ab4e6
commit 037b02e268
4 changed files with 520 additions and 371 deletions

View File

@@ -220,7 +220,7 @@ jobs:
working-directory: ./
continue-on-error: false
run: |
yarn add minio@7.1.3
yarn add minio
- uses: actions/cache@v3
name: Console Binary Cache
@@ -239,7 +239,7 @@ jobs:
(CONSOLE_SUBPATH=/console/subpath ./console server ) & (make test-initialize-minio-nginx)
- name: Install TestCafe
run: npm install testcafe@3.0.0
run: npm install testcafe@3.5.0
- name: Run TestCafe Tests
run: npx testcafe "chrome:headless" web-app/tests/subpath-nginx/ -q --skip-js-errors -c 3
@@ -269,7 +269,7 @@ jobs:
working-directory: ./
continue-on-error: false
run: |
yarn add minio@7.1.3
yarn add minio
- uses: actions/cache@v3
name: Console Binary Cache
@@ -288,7 +288,7 @@ jobs:
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
run: npm install testcafe@3.5.0
- name: Run TestCafe Tests
run: npx testcafe "chrome:headless" web-app/tests/permissions-1/ -q --skip-js-errors -c 3
@@ -317,7 +317,7 @@ jobs:
working-directory: ./
continue-on-error: false
run: |
yarn add minio@7.1.3
yarn add minio
- uses: actions/cache@v3
name: Console Binary Cache
with:
@@ -335,7 +335,7 @@ jobs:
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
run: npm install testcafe@3.5.0
- name: Run TestCafe Tests
run: npx testcafe "chrome:headless" web-app/tests/permissions-2/ -q --skip-js-errors -c 3
@@ -364,7 +364,7 @@ jobs:
working-directory: ./
continue-on-error: false
run: |
yarn add minio@7.1.3
yarn add minio
- uses: actions/cache@v3
name: Console Binary Cache
with:
@@ -382,7 +382,7 @@ jobs:
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
run: npm install testcafe@3.5.0
- name: Run TestCafe Tests
run: npx testcafe "chrome:headless" web-app/tests/permissions-3/ -q --skip-js-errors -c 3
@@ -411,7 +411,7 @@ jobs:
working-directory: ./
continue-on-error: false
run: |
yarn add minio@7.1.3
yarn add minio
- uses: actions/cache@v3
name: Console Binary Cache
with:
@@ -429,7 +429,7 @@ jobs:
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
run: npm install testcafe@3.5.0
- name: Run TestCafe Tests
timeout-minutes: 10
@@ -454,7 +454,7 @@ jobs:
working-directory: ./
continue-on-error: false
run: |
yarn add minio@7.1.3
yarn add minio
- uses: actions/cache@v3
name: Console Binary Cache
with:
@@ -472,7 +472,7 @@ jobs:
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
run: npm install testcafe@3.5.0
- name: Run TestCafe Tests
timeout-minutes: 5
@@ -497,7 +497,7 @@ jobs:
working-directory: ./
continue-on-error: false
run: |
yarn add minio@7.1.3
yarn add minio
- uses: actions/cache@v3
name: Console Binary Cache
with:
@@ -515,7 +515,7 @@ jobs:
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
run: npm install testcafe@3.5.0
- name: Run TestCafe Tests
timeout-minutes: 5
@@ -540,7 +540,7 @@ jobs:
working-directory: ./
continue-on-error: false
run: |
yarn add minio@7.1.3
yarn add minio
- uses: actions/cache@v3
name: Console Binary Cache
with:
@@ -557,7 +557,7 @@ jobs:
run: |
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
run: npm install testcafe@3.5.0
- name: Run TestCafe Tests
timeout-minutes: 5
@@ -582,7 +582,7 @@ jobs:
working-directory: ./
continue-on-error: false
run: |
yarn add minio@7.1.3
yarn add minio
- uses: actions/cache@v3
name: Console Binary Cache
with:
@@ -600,7 +600,7 @@ jobs:
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
run: npm install testcafe@3.5.0
- name: Run TestCafe Tests
timeout-minutes: 5
@@ -625,7 +625,7 @@ jobs:
working-directory: ./
continue-on-error: false
run: |
yarn add minio@7.1.3
yarn add minio
- uses: actions/cache@v3
name: Console Binary Cache
with:
@@ -643,7 +643,7 @@ jobs:
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
run: npm install testcafe@3.5.0
- name: Run TestCafe Tests
run: npx testcafe "chrome:headless" web-app/tests/permissions-A/ --skip-js-errors -c 3
@@ -671,7 +671,7 @@ jobs:
working-directory: ./
continue-on-error: false
run: |
yarn add minio@7.1.3
yarn add minio
- uses: actions/cache@v3
name: Console Binary Cache
with:
@@ -689,7 +689,7 @@ jobs:
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
run: npm install testcafe@3.5.0
- name: Run TestCafe Tests
run: npx testcafe "chrome:headless" web-app/tests/permissions-B/ --skip-js-errors -c 3

View File

@@ -63,7 +63,6 @@
"@playwright/test": "^1.43.0",
"@types/lodash": "^4.17.0",
"@types/luxon": "^3.4.2",
"@types/minio": "7.1.1",
"@types/node": "18.16.0",
"@types/react": "18.2.75",
"@types/react-copy-to-clipboard": "^5.0.5",
@@ -77,13 +76,13 @@
"@types/webpack-env": "^1.18.2",
"babel-plugin-istanbul": "^6.1.1",
"customize-cra": "^1.0.0",
"minio": "^7.1.3",
"minio": "^8.0.0",
"nyc": "^15.1.0",
"prettier": "3.2.5",
"react-app-rewire-hot-loader": "^2.0.1",
"react-app-rewired": "^2.2.1",
"react-scripts": "5.0.1",
"testcafe": "^2.6.2",
"testcafe": "3.5.0",
"ts-prune": "^0.10.3",
"typescript": "^4.4.3"
},

View File

@@ -33,13 +33,8 @@ export const setUpNamedBucket = (t, name) => {
accessKey: "minioadmin",
secretKey: "minioadmin",
});
return new Promise((resolve, reject) => {
minioClient.makeBucket(name, "us-east-1", (err) => {
if (err) {
console.log(err);
}
resolve("done: " + err);
});
return minioClient.makeBucket(name, "us-east-1").catch((err) => {
console.log(err);
});
};
@@ -48,7 +43,7 @@ export const uploadObjectToBucket = (t, modifier, objectName, objectPath) => {
return uploadNamedObjectToBucket(t, bucketName, objectName, objectPath);
};
export const uploadNamedObjectToBucket = (
export const uploadNamedObjectToBucket = async (
t,
modifier,
objectName,
@@ -62,14 +57,11 @@ export const uploadNamedObjectToBucket = (
accessKey: "minioadmin",
secretKey: "minioadmin",
});
return new Promise((resolve, reject) => {
minioClient.fPutObject(bucketName, objectName, objectPath, {}, (err) => {
if (err) {
console.log(err);
}
resolve("done");
return minioClient
.fPutObject(bucketName, objectName, objectPath, {})
.catch((err) => {
console.log(err);
});
});
};
export const setVersioned = (t, modifier) => {
@@ -139,9 +131,11 @@ export const cleanUpNamedBucketAndUploads = (t, bucket) => {
var stream = minioClient.listObjects(bucket, "", true);
let proms = [];
let proms: any[] = [];
stream.on("data", function (obj) {
proms.push(minioClient.removeObject(bucket, obj.name));
if (obj.name) {
proms.push(minioClient.removeObject(bucket, obj.name));
}
});
stream.on("end", () => {

File diff suppressed because it is too large Load Diff