Skip to content

Commit 57627e3

Browse files
committed
add @exclusive tag to prevent cluster-mutating tests from running in parallel
Issue: ZENKO-5228
1 parent ff61430 commit 57627e3

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

tests/ctst/common/hooks.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,21 @@ const noParallelRun = atMostOnePicklePerTag([
3636
...replicationLockTags
3737
]);
3838

39-
setParallelCanAssign(noParallelRun);
39+
const EXCLUSIVE_TAG = '@Exclusive';
40+
41+
function hasTag(pickle: { tags: readonly { name: string }[] }, tagName: string): boolean {
42+
return pickle.tags.some(t => t.name === tagName);
43+
}
44+
45+
setParallelCanAssign((pickle, runningPickles) => {
46+
if (runningPickles.some(p => hasTag(p, EXCLUSIVE_TAG))) {
47+
return false;
48+
}
49+
if (hasTag(pickle, EXCLUSIVE_TAG)) {
50+
return runningPickles.length === 0;
51+
}
52+
return noParallelRun(pickle, runningPickles);
53+
});
4054

4155
Before(async function (this: Zenko, scenario: ITestCaseHookParameter) {
4256
this.resetSaved();

tests/ctst/features/azureArchive.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Feature: Azure Archive
4545
@Flaky
4646
@AzureArchive
4747
@ColdStorage
48+
@Exclusive
4849
Scenario Outline: Create, read, update and delete azure archive location
4950
Given an azure archive location "<locationName>"
5051
And a "<versioningConfiguration>" bucket
@@ -257,6 +258,7 @@ Feature: Azure Archive
257258
@Flaky
258259
@AzureArchive
259260
@ColdStorage
261+
@Exclusive
260262
Scenario Outline: Pause and resume archiving to azure (PutObject after pause)
261263
Given a "<versioningConfiguration>" bucket
262264
And a transition workflow to "e2e-azure-archive" location

tests/ctst/features/bucketWebsite.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Feature: Bucket Websites
33
@2.6.0
44
@PreMerge
55
@BucketWebsite
6+
@Exclusive
67
Scenario Outline: Bucket Website CRUD
78
# The scenario should test that we can put a bucket website configuration on a bucket
89
# send an index.html

tests/ctst/features/pra.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Feature: PRA operations
55
@Dmf
66
@PRA
77
@ColdStorage
8+
@Exclusive
89
Scenario Outline: PRA (nominal case)
910
# Prepare objects in the primary site
1011
Given a "<versioningConfiguration>" bucket

0 commit comments

Comments
 (0)