summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2022-03-07 21:24:15 +0100
committerJon Marius Venstad <venstad@gmail.com>2022-03-07 21:24:15 +0100
commitb0ab0dbaec9d19ecef0d274b513fd700f9752c6f (patch)
tree950e298218b77e95f703b04734589906a2fc084b
parent328f395cdaf51ebd590becbe779cfb01c29c0a81 (diff)
Add a resubmit helper, fix salt and some other minor tests code bugs
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentContext.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentContext.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentContext.java
index 21cc69369d8..7c2009255cb 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentContext.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentContext.java
@@ -255,6 +255,11 @@ public class DeploymentContext {
}
/** Submit given application package for deployment */
+ public DeploymentContext resubmit(ApplicationPackage applicationPackage) {
+ return submit(applicationPackage, Optional.of(defaultSourceRevision), salt.get());
+ }
+
+ /** Submit given application package for deployment */
public DeploymentContext submit(ApplicationPackage applicationPackage) {
return submit(applicationPackage, Optional.of(defaultSourceRevision));
}
@@ -266,7 +271,7 @@ public class DeploymentContext {
/** Submit given application package for deployment */
public DeploymentContext submit(ApplicationPackage applicationPackage, Optional<SourceRevision> sourceRevision) {
- return submit(applicationPackage, sourceRevision, salt.getAndIncrement());
+ return submit(applicationPackage, sourceRevision, salt.incrementAndGet());
}
/** Submit given application package for deployment */
@@ -597,8 +602,9 @@ public class DeploymentContext {
runner.advance(currentRun(job));
assertTrue(jobs.run(id).get().hasEnded());
assertFalse(jobs.run(id).get().hasFailed());
- assertEquals(job.type().isProduction(), instance().deployments().containsKey(zone));
- assertTrue(configServer().nodeRepository().list(zone, NodeFilter.all().applications(TesterId.of(id.application()).id())).isEmpty());
+ Instance instance = tester.application(TenantAndApplicationId.from(instanceId)).require(id.application().instance());
+ assertEquals(job.type().isProduction(), instance.deployments().containsKey(zone));
+ assertTrue(configServer().nodeRepository().list(zone, NodeFilter.all().applications(TesterId.of(instance.id()).id())).isEmpty());
}
private JobId jobId(JobType type) {