Skip to content

Commit 0c5caa9

Browse files
committed
Improved behavior of dependency.
Cancel old queue when it is resubmitted. Execution that have IGNORED dependencies are no longer waiting.
1 parent baa9a75 commit 0c5caa9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

source/src/main/java/org/cerberus/core/crud/service/impl/TestCaseExecutionQueueDepService.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ public AnswerItem<Integer> insertFromTestCaseDep(long queueId, String env, Strin
8989
&& !queueToInsert.isEmpty()) {
9090
status = TestCaseExecutionQueueDep.STATUS_IGNORED;
9191
comment = "The corresponding test Case does not exist in the context of the campaign execution";
92+
} else {
93+
// nbInserted is not incremented if Dependency is IGNORED. We count only the blocking dependencies.
94+
nbInserted++;
9295
}
93-
nbInserted++;
9496
TestCaseExecutionQueueDep newDep = TestCaseExecutionQueueDep.builder()
9597
.comment(comment)
9698
.depTest(testCaseDep.getDependencyTest())

source/src/main/java/org/cerberus/core/crud/service/impl/TestCaseExecutionQueueService.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public AnswerItem<TestCaseExecutionQueue> create(TestCaseExecutionQueue object,
198198
long insertedQueueId = ret.getItem().getId();
199199
// Adding dependencies
200200
AnswerItem<Integer> retDep = testCaseExecutionQueueDepService.insertFromTestCaseDep(insertedQueueId, object.getEnvironment(), object.getCountry(),
201-
object.getTag(), object.getTest(), object.getTestCase(), queueToInsert);
201+
object.getTag(), object.getTest(), object.getTestCase(), queueToInsert);
202202
LOG.debug("Dep inserted : " + retDep.getItem());
203203
if (retDep.getItem() < 1) {
204204
// In case there are no dependencies, we release the execution moving to targetState State
@@ -220,6 +220,8 @@ public AnswerItem<TestCaseExecutionQueue> create(TestCaseExecutionQueue object,
220220
// Adding dependencies
221221
AnswerItem<Integer> retDep = testCaseExecutionQueueDepService.insertFromExeQueueIdDep(insertedQueueId, exeQueueId);
222222
LOG.debug("Dep inserted from old entries : " + retDep.getItem());
223+
// Move Original Queue entry to CANCELLED
224+
this.updateToCancelled(exeQueueId, "Cancelled because duplicated to new Queue entry " + insertedQueueId);
223225
}
224226
}
225227
}

0 commit comments

Comments
 (0)