diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2022-02-28 11:36:05 +0100 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2022-02-28 11:36:05 +0100 |
commit | 1d4c6345559c83859a4b62c28e157140135db5b9 (patch) | |
tree | c55ea6edf502bbf2a85f5e0974447759000a8ce1 /controller-server | |
parent | 1ee5e436ee3e26186eb153b54ca456af3098d8d5 (diff) |
Ignore source versions for system tests
Diffstat (limited to 'controller-server')
6 files changed, 17 insertions, 23 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java index 7e810037804..bdb40f20c1d 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java @@ -211,7 +211,7 @@ public class DeploymentStatus { Versions versions = Versions.from(change, application, firstProductionJobWithDeployment.flatMap(this::deploymentFor), systemVersion); if (step.completedAt(change, firstProductionJobWithDeployment).isEmpty()) - jobs.merge(job, List.of(new Job(versions, step.readyAt(change), change)), DeploymentStatus::union); + jobs.merge(job, List.of(new Job(job.type(), versions, step.readyAt(change), change)), DeploymentStatus::union); }); return Collections.unmodifiableMap(jobs); } @@ -313,7 +313,8 @@ public class DeploymentStatus { List<Change> changes = changes(job, step, change); if (changes.isEmpty()) return; for (Change partial : changes) { - toRun.add(new Job(Versions.from(partial, application, deployment, systemVersion), + toRun.add(new Job(job.type(), + Versions.from(partial, application, deployment, systemVersion), step.readyAt(partial, Optional.of(job)), partial)); // Assume first partial change is applied before the second. @@ -433,7 +434,8 @@ public class DeploymentStatus { declaredTest(job.application(), testType).ifPresent(testJob -> { for (Job productionJob : versionsList) if (allJobs.successOn(productionJob.versions()).get(testJob).isEmpty()) - testJobs.merge(testJob, List.of(new Job(productionJob.versions(), + testJobs.merge(testJob, List.of(new Job(testJob.type(), + productionJob.versions(), jobSteps().get(testJob).readyAt(productionJob.change), productionJob.change)), DeploymentStatus::union); @@ -449,7 +451,8 @@ public class DeploymentStatus { && testJobs.get(test).stream().anyMatch(testJob -> testJob.versions().equals(productionJob.versions())))) { JobId testJob = firstDeclaredOrElseImplicitTest(testType); testJobs.merge(testJob, - List.of(new Job(productionJob.versions(), + List.of(new Job(testJob.type(), + productionJob.versions(), jobSteps.get(testJob).readyAt(productionJob.change), productionJob.change)), DeploymentStatus::union); @@ -873,8 +876,8 @@ public class DeploymentStatus { private final Optional<Instant> readyAt; private final Change change; - public Job(Versions versions, Optional<Instant> readyAt, Change change) { - this.versions = versions; + public Job(JobType type, Versions versions, Optional<Instant> readyAt, Change change) { + this.versions = type == systemTest ? versions.withoutSources() : versions; this.readyAt = readyAt; this.change = change; } diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java index 55b9dea7869..20fa539c820 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java @@ -199,7 +199,7 @@ public class DeploymentTrigger { DeploymentStatus status = jobs.deploymentStatus(application); Versions versions = Versions.from(instance.change(), application, status.deploymentFor(job), controller.readSystemVersion()); - DeploymentStatus.Job toTrigger = new DeploymentStatus.Job(versions, Optional.of(controller.clock().instant()), instance.change()); + DeploymentStatus.Job toTrigger = new DeploymentStatus.Job(job.type(), versions, Optional.of(controller.clock().instant()), instance.change()); Map<JobId, List<DeploymentStatus.Job>> jobs = status.testJobs(Map.of(job, List.of(toTrigger))); if (jobs.isEmpty() || ! requireTests) jobs = Map.of(job, List.of(toTrigger)); diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/Versions.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/Versions.java index 1e183d44377..ff88549fb7c 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/Versions.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/Versions.java @@ -37,6 +37,11 @@ public class Versions { this.sourceApplication = requireNonNull(sourceApplication); } + /** A copy of this, without source versions. */ + public Versions withoutSources() { + return new Versions(targetPlatform, targetApplication, Optional.empty(), Optional.empty()); + } + /** Target platform version for this */ public Version targetPlatform() { return targetPlatform; diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java index 070782e5888..8830475fd16 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java @@ -285,7 +285,7 @@ public class DeploymentTriggerTest { assertEquals(revision4, app.deploymentStatus().outstandingChange(InstanceName.defaultName()).application()); // The third revision fails, and the fourth is chosen to replace it. - app.triggerJobs().jobAborted(systemTest).jobAborted(stagingTest).timeOutConvergence(systemTest); + app.triggerJobs().jobAborted(stagingTest).timeOutConvergence(systemTest); tester.outstandingChangeDeployer().run(); tester.outstandingChangeDeployer().run(); assertEquals(revision4, app.instance().change().application()); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-overview-2.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-overview-2.json index 55b3a8b388f..e26da5c8118 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-overview-2.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-overview-2.json @@ -144,13 +144,6 @@ "compileVersion": "6.1.0", "sourceUrl": "repository1/tree/commit1", "commit": "commit1" - }, - "sourcePlatform": "6.1.0", - "sourceApplication": { - "build": 2, - "compileVersion": "6.1.0", - "sourceUrl": "repository1/tree/commit1", - "commit": "commit1" } }, "steps": [ @@ -209,13 +202,6 @@ "compileVersion": "6.1.0", "sourceUrl": "repository1/tree/commit1", "commit": "commit1" - }, - "sourcePlatform": "6.1.0", - "sourceApplication": { - "build": 1, - "compileVersion": "6.1.0", - "sourceUrl": "repository1/tree/commit1", - "commit": "commit1" } }, "steps": [ diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/responses/root.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/responses/root.json index c5286d4a04b..211aa57d8ed 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/responses/root.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/responses/root.json @@ -194,7 +194,7 @@ { "name": "system-test", "coolingDownUntil": "(ignore)", - "pending": "platform" + "pending": "application" }, { "name": "staging-test", |