From 29491c818f16cad4cb09980acce1541eed506102 Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Mon, 25 Sep 2023 12:34:10 +0200 Subject: [PATCH] minor change --- .../seqera/wave/api/SubmitContainerTokenRequest.java | 11 +++++++++++ .../wave/api/SubmitContainerTokenRequestTest.groovy | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/wave-api/src/main/java/io/seqera/wave/api/SubmitContainerTokenRequest.java b/wave-api/src/main/java/io/seqera/wave/api/SubmitContainerTokenRequest.java index 915a54f..d4ba1b4 100644 --- a/wave-api/src/main/java/io/seqera/wave/api/SubmitContainerTokenRequest.java +++ b/wave-api/src/main/java/io/seqera/wave/api/SubmitContainerTokenRequest.java @@ -109,6 +109,11 @@ public class SubmitContainerTokenRequest implements Cloneable { */ public String format; + /** + * When {@code true} build requests are carried out in dry-run mode. + * Id of workflow in tower + */ + public Boolean dryRun; /** * Id of workflow in tower */ @@ -248,6 +253,11 @@ public SubmitContainerTokenRequest withFormat(String value) { return this; } + public SubmitContainerTokenRequest withDryRun(Boolean dryRun) { + this.dryRun = dryRun; + return this; + } + public boolean formatSingularity() { return "sif".equals(format); } @@ -272,6 +282,7 @@ public String toString() { ", freeze=" + freeze + ", buildContext=" + buildContext + ", type=" + format + + ", dryRun=" + dryRun + ", towerWorkflowId=" + towerWorkflowId + '}'; } diff --git a/wave-api/src/test/groovy/io/seqera/wave/api/SubmitContainerTokenRequestTest.groovy b/wave-api/src/test/groovy/io/seqera/wave/api/SubmitContainerTokenRequestTest.groovy index 2f8fcf4..b526912 100644 --- a/wave-api/src/test/groovy/io/seqera/wave/api/SubmitContainerTokenRequestTest.groovy +++ b/wave-api/src/test/groovy/io/seqera/wave/api/SubmitContainerTokenRequestTest.groovy @@ -38,6 +38,7 @@ class SubmitContainerTokenRequestTest extends Specification { fingerprint: 'a14', freeze: true, format: 'sif', + dryRun: false, towerWorkflowId: 'id123' ) @@ -60,7 +61,10 @@ class SubmitContainerTokenRequestTest extends Specification { copy.fingerprint == req.fingerprint copy.freeze == req.freeze copy.format == req.format + copy.dryRun == req.dryRun copy.towerWorkflowId == req.towerWorkflowId + and: + copy.formatSingularity() when: def other = req.copyWith( @@ -78,6 +82,7 @@ class SubmitContainerTokenRequestTest extends Specification { cacheRepository: 'b12', timestamp: 'b13', fingerprint: 'b14', + dryRun: false, freeze: false, format: 'foo', towerWorkflowId: 'id123' @@ -99,7 +104,10 @@ class SubmitContainerTokenRequestTest extends Specification { other.fingerprint == 'b14' other.freeze == false other.format == 'foo' + other.dryRun == false other.towerWorkflowId == 'id123' + and: + !other.formatSingularity() } } \ No newline at end of file