Skip to content

Commit ffb4756

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

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
@@ -32,7 +32,21 @@ const noParallelRun = atMostOnePicklePerTag([
3232
...replicationLockTags
3333
]);
3434

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

3751
Before(async function (this: Zenko, scenario: ITestCaseHookParameter) {
3852
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
@@ -256,6 +257,7 @@ Feature: Azure Archive
256257
@PreMerge
257258
@Flaky
258259
@AzureArchive
260+
@Exclusive
259261
Scenario Outline: Pause and resume archiving to azure (PutObject after pause)
260262
Given a "<versioningConfiguration>" bucket
261263
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)