Fix Delete Versions Tests Race condition (#1760)

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
Daniel Valdivia
2022-03-23 21:47:51 -07:00
committed by GitHub
parent bb22a1d62a
commit d673473d5e
6 changed files with 41 additions and 25 deletions

View File

@@ -238,9 +238,9 @@ const AddTenant = ({
const kesReplicas = fields.encryption.replicas;
if (addSending) {
const tolerationValues = tolerations.filter(
(toleration) => toleration.key.trim() !== ""
);
const tolerationValues = tolerations.filter(
(toleration) => toleration.key.trim() !== ""
);
const poolName = generatePoolName([]);

View File

@@ -46,9 +46,10 @@ import {
ADD_TENANT_SET_KEY_PAIR_VALUE,
ADD_TENANT_SET_TOLERATION_VALUE,
ADD_TENANT_ADD_NEW_TOLERATION,
LabelKeyPair, ADD_TENANT_REMOVE_TOLERATION_ROW,
LabelKeyPair,
ADD_TENANT_REMOVE_TOLERATION_ROW,
} from "./types";
import {ITolerationModel} from "../../../common/types";
import { ITolerationModel } from "../../../common/types";
// Basic actions
export const setWizardPage = (page: number) => {
@@ -299,23 +300,26 @@ export const setKeyValuePairs = (newArray: LabelKeyPair[]) => {
};
};
export const setTolerationInfo = (index: number, tolerationValue: ITolerationModel) => {
export const setTolerationInfo = (
index: number,
tolerationValue: ITolerationModel
) => {
return {
type: ADD_TENANT_SET_TOLERATION_VALUE,
index,
toleration: tolerationValue,
}
};
};
export const addNewToleration = () => {
return {
type: ADD_TENANT_ADD_NEW_TOLERATION,
}
};
};
export const removeToleration = (index: number) => {
return {
type: ADD_TENANT_REMOVE_TOLERATION_ROW,
index
}
index,
};
};

View File

@@ -996,8 +996,6 @@ export function tenantsReducer(
(_, index) => index !== action.index
);
console.log("action", action.index, cleanTolerationArray)
return {
...state,
createTenant: {

View File

@@ -74,7 +74,8 @@ export const ADD_TENANT_SET_KEY_PAIR_VALUE = "ADD_TENANT/SET_KEY_PAIR_VALUE";
export const ADD_TENANT_SET_TOLERATION_VALUE =
"ADD_TENANT/SET_TOLERATION_VALUE";
export const ADD_TENANT_ADD_NEW_TOLERATION = "ADD_TENANT/ADD_NEW_TOLERATION";
export const ADD_TENANT_REMOVE_TOLERATION_ROW = "ADD_TENANT/REMOVE_TOLERATION_ROW";
export const ADD_TENANT_REMOVE_TOLERATION_ROW =
"ADD_TENANT/REMOVE_TOLERATION_ROW";
// Tenant Details
export const TENANT_DETAILS_SET_LOADING = "TENANT_DETAILS/SET_LOADING";

View File

@@ -31,15 +31,23 @@ test
// Create a bucket
await functions.setUpBucket(t, "bucketdelete3");
await functions.setVersioned(t, "bucketdelete3");
})("All versions of an object can be deleted from a bucket", async (t) => {
const testBucketBrowseButton = testBucketBrowseButtonFor("bucketdelete3");
await t
.useRole(roles.bucketReadWrite)
.navigateTo("http://localhost:9090/buckets")
.click(testBucketBrowseButton)
.click(testBucketBrowseButtonFor("bucketdelete3"))
// Upload object to bucket
.setFilesToUpload(elements.uploadInput, "../uploads/test.txt")
.wait(1000)
.navigateTo("http://localhost:9090/buckets")
.click(testBucketBrowseButtonFor("bucketdelete3"))
// Upload object to bucket
.setFilesToUpload(elements.uploadInput, "../uploads/test.txt")
.wait(1000);
})("All versions of an object can be deleted from a bucket", async (t) => {
await t
.useRole(roles.bucketReadWrite)
.navigateTo("http://localhost:9090/buckets")
.click(testBucketBrowseButtonFor("bucketdelete3"))
.click(
"div.ReactVirtualized__Grid.ReactVirtualized__Table__Grid > div > div:nth-child(1)"
)

View File

@@ -29,16 +29,18 @@ test
// Create a bucket
await functions.setUpBucket(t, "bucketobjecttags");
await functions.setVersioned(t, "bucketobjecttags");
})("Tags can be created and deleted", async (t) => {
const testBucketBrowseButton =
testBucketBrowseButtonFor("bucketobjecttags");
await t
.useRole(roles.bucketObjectTags)
.navigateTo("http://localhost:9090/buckets")
.click(testBucketBrowseButton)
.click(testBucketBrowseButtonFor("bucketobjecttags"))
// Upload object to bucket
.setFilesToUpload(elements.uploadInput, "../uploads/test.txt")
.wait(1000)
.wait(1000);
})("Tags can be created and deleted", async (t) => {
await t
.useRole(roles.bucketObjectTags)
.navigateTo("http://localhost:9090/buckets")
.click(testBucketBrowseButtonFor("bucketobjecttags"))
.click(
"div.ReactVirtualized__Grid.ReactVirtualized__Table__Grid > div > div:nth-child(1)"
)
@@ -65,15 +67,18 @@ test
// Create a bucket
await functions.setUpBucket(t, "bucketcannottag");
await functions.setVersioned(t, "bucketcannottag");
})("User should not be able to create tag", async (t) => {
const testBucketBrowseButton = testBucketBrowseButtonFor("bucketcannottag");
await t
.useRole(roles.bucketCannotTag)
.navigateTo("http://localhost:9090/buckets")
.click(testBucketBrowseButton)
.click(testBucketBrowseButtonFor("bucketcannottag"))
// Upload object to bucket
.setFilesToUpload(elements.uploadInput, "../uploads/test.txt")
.wait(1000)
.wait(1000);
})("User should not be able to create tag", async (t) => {
await t
.useRole(roles.bucketCannotTag)
.navigateTo("http://localhost:9090/buckets")
.click(testBucketBrowseButtonFor("bucketcannottag"))
.click(
"div.ReactVirtualized__Grid.ReactVirtualized__Table__Grid > div > div:nth-child(1)"
)