diff options
Diffstat (limited to 'controller-api')
6 files changed, 113 insertions, 285 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java index c5d3fd1374f..bb97349e5dd 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java @@ -61,6 +61,7 @@ public class Node { private final boolean wantToRetire; private final boolean wantToDeprovision; private final boolean wantToRebuild; + private final boolean down; private final Optional<TenantName> reservedTo; private final Optional<ApplicationId> exclusiveTo; private final Map<String, String> reports; @@ -79,7 +80,7 @@ public class Node { long restartGeneration, long wantedRestartGeneration, long rebootGeneration, long wantedRebootGeneration, int cost, int failCount, Optional<String> flavor, String clusterId, ClusterType clusterType, String group, boolean retired, boolean wantToRetire, boolean wantToDeprovision, - boolean wantToRebuild, Optional<TenantName> reservedTo, Optional<ApplicationId> exclusiveTo, + boolean wantToRebuild, boolean down, Optional<TenantName> reservedTo, Optional<ApplicationId> exclusiveTo, DockerImage wantedDockerImage, DockerImage currentDockerImage, Map<String, String> reports, List<Event> history, Set<String> ipAddresses, Set<String> additionalIpAddresses, Set<String> additionalHostnames, Optional<String> switchHostname, @@ -117,6 +118,7 @@ public class Node { this.wantedDockerImage = Objects.requireNonNull(wantedDockerImage, "wantedDockerImage must be non-null"); this.currentDockerImage = Objects.requireNonNull(currentDockerImage, "currentDockerImage must be non-null"); this.wantToRebuild = wantToRebuild; + this.down = down; this.reports = Map.copyOf(Objects.requireNonNull(reports, "reports must be non-null")); this.history = List.copyOf(Objects.requireNonNull(history, "history must be non-null")); this.ipAddresses = Set.copyOf(Objects.requireNonNull(ipAddresses, "ipAddresses must be non-null")); @@ -280,6 +282,11 @@ public class Node { return wantToRebuild; } + /** Whether this node is currently down */ + public boolean down() { + return down; + } + /** The tenant this has been reserved to, if any */ public Optional<TenantName> reservedTo() { return reservedTo; } @@ -467,6 +474,7 @@ public class Node { private boolean wantToRetire = false; private boolean wantToDeprovision = false; private boolean wantToRebuild = false; + private boolean down = false; private Optional<TenantName> reservedTo = Optional.empty(); private Optional<ApplicationId> exclusiveTo = Optional.empty(); private Map<String, String> reports = Map.of(); @@ -512,6 +520,7 @@ public class Node { this.wantToRetire = node.wantToRetire; this.wantToDeprovision = node.wantToDeprovision; this.wantToRebuild = node.wantToRebuild; + this.down = node.down; this.reservedTo = node.reservedTo; this.exclusiveTo = node.exclusiveTo; this.reports = node.reports; @@ -687,6 +696,11 @@ public class Node { return this; } + public Builder down(boolean down) { + this.down = down; + return this; + } + public Builder reservedTo(TenantName tenant) { this.reservedTo = Optional.of(tenant); return this; @@ -742,7 +756,7 @@ public class Node { currentOsVersion, wantedOsVersion, currentFirmwareCheck, wantedFirmwareCheck, serviceState, suspendedSince, restartGeneration, wantedRestartGeneration, rebootGeneration, wantedRebootGeneration, cost, failCount, flavor, clusterId, clusterType, group, retired, - wantToRetire, wantToDeprovision, wantToRebuild, reservedTo, exclusiveTo, wantedDockerImage, + wantToRetire, wantToDeprovision, wantToRebuild, down, reservedTo, exclusiveTo, wantedDockerImage, currentDockerImage, reports, history, ipAddresses, additionalIpAddresses, additionalHostnames, switchHostname, modelName, environment); } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java index 4505fe3ceb5..9e14c4ae8dd 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java @@ -3,214 +3,40 @@ package com.yahoo.vespa.hosted.controller.api.integration.deployment; import com.yahoo.config.provision.Environment; import com.yahoo.config.provision.RegionName; -import com.yahoo.config.provision.SystemName; import com.yahoo.config.provision.zone.ZoneId; import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneRegistry; -import java.util.Arrays; import java.util.Comparator; import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; import static ai.vespa.validation.Validation.require; +import static com.yahoo.config.provision.Environment.dev; +import static com.yahoo.config.provision.Environment.perf; import static com.yahoo.config.provision.Environment.prod; import static com.yahoo.config.provision.Environment.staging; import static com.yahoo.config.provision.Environment.test; -import static com.yahoo.config.provision.SystemName.Public; -import static com.yahoo.config.provision.SystemName.PublicCd; -import static com.yahoo.config.provision.SystemName.cd; -import static com.yahoo.config.provision.SystemName.main; - -/** Job types that exist in the build system */ +import static java.util.Comparator.naturalOrder; +import static java.util.stream.Collectors.toUnmodifiableList; + +/** + * Specification for a deployment and/or test job to run: what zone, and whether it is a production test. + * + * @author jonmv + */ public final class JobType implements Comparable<JobType> { -// | enum name ------------| job name ------------------| Zone in main system ---------------------------------------| Zone in CD system ------------------------------------------- - public static final JobType systemTest = of("system-test", - Map.of(main , ZoneId.from("test", "us-east-1"), - cd , ZoneId.from("test", "cd-us-west-1"), - PublicCd, ZoneId.from("test", "aws-us-east-1c"), - Public , ZoneId.from("test", "aws-us-east-1c"))); - - public static final JobType stagingTest = of("staging-test", - Map.of(main , ZoneId.from("staging", "us-east-3"), - cd , ZoneId.from("staging", "cd-us-west-1"), - PublicCd, ZoneId.from("staging", "aws-us-east-1c"), - Public , ZoneId.from("staging", "aws-us-east-1c"))); - - public static final JobType productionUsEast3 = prod("us-east-3"); - - public static final JobType testUsEast3 = test("us-east-3"); - - public static final JobType productionUsWest1 = prod("us-west-1"); - - public static final JobType testUsWest1 = test("us-west-1"); - - public static final JobType productionUsCentral1 = prod("us-central-1"); - - public static final JobType testUsCentral1 = test("us-central-1"); - - public static final JobType productionApNortheast1 = prod("ap-northeast-1"); - - public static final JobType testApNortheast1 = test("ap-northeast-1"); - - public static final JobType productionApNortheast2 = prod("ap-northeast-2"); - - public static final JobType testApNortheast2 = test("ap-northeast-2"); - - public static final JobType productionApSoutheast1 = prod("ap-southeast-1"); - - public static final JobType testApSoutheast1 = test("ap-southeast-1"); - - public static final JobType productionEuWest1 = prod("eu-west-1"); - - public static final JobType testEuWest1 = test("eu-west-1"); - - public static final JobType productionAwsUsEast1a= prod("aws-us-east-1a"); - - public static final JobType testAwsUsEast1a = test("aws-us-east-1a"); - - public static final JobType productionAwsUsEast1c= prod("aws-us-east-1c"); - - public static final JobType testAwsUsEast1c = test("aws-us-east-1c"); - - public static final JobType productionAwsApNortheast1a= prod("aws-ap-northeast-1a"); - - public static final JobType testAwsApNortheast1a = test("aws-ap-northeast-1a"); - - public static final JobType productionAwsEuWest1a= prod("aws-eu-west-1a"); - - public static final JobType testAwsEuWest1a = test("aws-eu-west-1a"); - - public static final JobType productionAwsUsWest2a= prod("aws-us-west-2a"); - - public static final JobType testAwsUsWest2a = test("aws-us-west-2a"); - - public static final JobType productionAwsUsEast1b= prod("aws-us-east-1b"); - - public static final JobType testAwsUsEast1b = test("aws-us-east-1b"); - - public static final JobType devUsEast1 = dev("us-east-1"); - - public static final JobType devAwsUsEast2a = dev("aws-us-east-2a"); - - public static final JobType productionCdAwsUsEast1a = prod("cd-aws-us-east-1a"); - - public static final JobType testCdAwsUsEast1a = test("cd-aws-us-east-1a"); - - public static final JobType productionCdUsCentral1 = prod("cd-us-central-1"); - - public static final JobType testCdUsCentral1 = test("cd-us-central-1"); - - public static final JobType productionCdUsCentral2 = prod("cd-us-central-2"); - - public static final JobType testCdUsCentral2 = test("cd-us-central-2"); - - public static final JobType productionCdUsEast1= prod("cd-us-east-1"); - - public static final JobType testCdUsEast1 = test("cd-us-east-1"); - - public static final JobType productionCdUsWest1= prod("cd-us-west-1"); - - public static final JobType testCdUsWest1 = test("cd-us-west-1"); - - public static final JobType devCdUsCentral1 = dev("cd-us-central-1"); - - public static final JobType devCdUsWest1 = dev("cd-us-west-1"); - - public static final JobType devAwsUsEast1c = dev("aws-us-east-1c"); - - public static final JobType perfAwsUsEast1c = perf("aws-us-east-1c"); - - public static final JobType perfUsEast3 = perf("us-east-3"); - - private static final JobType[] values = new JobType[] { - systemTest, - stagingTest, - productionUsEast3, - testUsEast3, - productionUsWest1, - testUsWest1, - productionUsCentral1, - testUsCentral1, - productionApNortheast1, - testApNortheast1, - productionApNortheast2, - testApNortheast2, - productionApSoutheast1, - testApSoutheast1, - productionEuWest1, - testEuWest1, - productionAwsUsEast1a, - testAwsUsEast1a, - productionAwsUsEast1c, - testAwsUsEast1c, - productionAwsApNortheast1a, - testAwsApNortheast1a, - productionAwsEuWest1a, - testAwsEuWest1a, - productionAwsUsWest2a, - testAwsUsWest2a, - productionAwsUsEast1b, - testAwsUsEast1b, - devUsEast1, - devAwsUsEast2a, - productionCdAwsUsEast1a, - testCdAwsUsEast1a, - productionCdUsCentral1, - testCdUsCentral1, - productionCdUsCentral2, - testCdUsCentral2, - productionCdUsEast1, - testCdUsEast1, - productionCdUsWest1, - testCdUsWest1, - devCdUsCentral1, - devCdUsWest1, - devAwsUsEast1c, - perfAwsUsEast1c, - perfUsEast3 - }; private final String jobName; - final Map<SystemName, ZoneId> zones; + private final ZoneId zone; private final boolean isProductionTest; - private JobType(String jobName, Map<SystemName, ZoneId> zones, boolean isProductionTest) { - if (zones.values().stream().map(ZoneId::environment).distinct().count() > 1) - throw new IllegalArgumentException("All zones of a job must be in the same environment"); - + private JobType(String jobName, ZoneId zone, boolean isProductionTest) { this.jobName = jobName; - this.zones = zones; + this.zone = zone; this.isProductionTest = isProductionTest; } - private static JobType of(String jobName, Map<SystemName, ZoneId> zones, boolean isProductionTest) { - return new JobType(jobName, zones, isProductionTest); - } - - private static JobType of(String jobName, Map<SystemName, ZoneId> zones) { - return of(jobName, zones, false); - } - - public String jobName() { return jobName; } - - /** Returns the zone for this job in the given system. */ - public ZoneId zone() { - throw new UnsupportedOperationException(); - } - - /** Returns the zone for this job in the given system, or throws if this job does not have a zone */ - public ZoneId zone(SystemName system) { - if ( ! zones.containsKey(system)) - throw new IllegalArgumentException(this + " does not have any zones in " + system); - - return zones.get(system); - } - /** A system test in a test zone, or throws if no test zones are present.. */ public static JobType systemTest(ZoneRegistry zones) { return testIn(test, zones); @@ -227,25 +53,46 @@ public final class JobType implements Comparable<JobType> { } /** A deployment to the given dev region. */ + public static JobType dev(RegionName region) { + return deploymentTo(ZoneId.from(dev, region)); + } + + /** A deployment to the given dev region. */ public static JobType dev(String region) { return deploymentTo(ZoneId.from("dev", region)); } /** A deployment to the given perf region. */ + public static JobType perf(RegionName region) { + return deploymentTo(ZoneId.from(perf, region)); + } + + /** A deployment to the given perf region. */ public static JobType perf(String region) { return deploymentTo(ZoneId.from("perf", region)); } /** A deployment to the given prod region. */ + public static JobType prod(RegionName region) { + return deploymentTo(ZoneId.from(prod, region)); + } + + /** A deployment to the given prod region. */ public static JobType prod(String region) { return deploymentTo(ZoneId.from("prod", region)); } /** A production test in the given region. */ + public static JobType test(RegionName region) { + return productionTestOf(ZoneId.from(prod, region)); + } + + /** A production test in the given region. */ public static JobType test(String region) { return productionTestOf(ZoneId.from("prod", region)); } + /** A deployment to the given zone; this may be a zone in the {@code test} or {@code staging} environments. */ public static JobType deploymentTo(ZoneId zone) { String name; switch (zone.environment()) { @@ -254,18 +101,16 @@ public final class JobType implements Comparable<JobType> { case staging: name = "staging-test"; break; default: name = zone.environment().value() + "-" + zone.region().value(); } - return of(name, dummy(zone), false); + return new JobType(name, zone, false); } + /** A production test in the given production zone. */ public static JobType productionTestOf(ZoneId zone) { - return of("test-" + require(zone.environment() == prod, zone, "must be prod zone").region().value(), dummy(zone), true); + String name = "test-" + require(zone.environment() == prod, zone, "must be prod zone").region().value(); + return new JobType(name, zone, true); } - private static Map<SystemName, ZoneId> dummy(ZoneId zone) { - return Stream.of(SystemName.values()).collect(Collectors.toMap(Function.identity(), __ -> zone)); - } - - // TODO jonmv: use for serialisation + /** Creates a new job type from serialized zone data, and whether it is a production test; the inverse of {@link #serialized()} */ public static JobType ofSerialized(String raw) { String[] parts = raw.split("\\."); if (parts.length == 2) return deploymentTo(ZoneId.from(parts[0], parts[1])); @@ -273,20 +118,41 @@ public final class JobType implements Comparable<JobType> { throw new IllegalArgumentException("illegal serialized job type '" + raw + "'"); } - public String serialized(SystemName system) { - ZoneId zone = zone(system); - return zone.environment().value() + "." + zone.region().value() + (isProductionTest ? ".test" : ""); + /** Creates a new job type from a job name, and a zone registry for looking up zones for the special system and staging test types. */ + public static JobType fromJobName(String jobName, ZoneRegistry zones) { + String[] parts = jobName.split("-", 2); + if (parts.length != 2) throw new IllegalArgumentException("job names must be 'system-test', 'staging-test', or environment and region parts, separated by '-', but got: " + jobName); + switch (parts[0]) { + case "system": return systemTest(zones); + case "staging": return stagingTest(zones); + case "production": return prod(parts[1]); + case "test": return test(parts[1]); + case "dev": return dev(parts[1]); + case "perf": return perf(parts[1]); + default: throw new IllegalArgumentException("job names must begin with one of: system, staging, production, test, dev, perf; but got: " + jobName); + } } public static List<JobType> allIn(ZoneRegistry zones) { return zones.zones().controllerUpgraded().zones().stream() .flatMap(zone -> zone.getEnvironment().isProduction() ? Stream.of(deploymentTo(zone.getId()), productionTestOf(zone.getId())) : Stream.of(deploymentTo(zone.getId()))) - .collect(Collectors.toUnmodifiableList()); + .sorted(naturalOrder()) + .collect(toUnmodifiableList()); } - static JobType[] values() { - return Arrays.copyOf(values, values.length); + /** A serialized form of this: {@code <environment>.<region>[.test]}; the inverse of {@link #ofSerialized(String)} */ + public String serialized() { + return zone.environment().value() + "." + zone.region().value() + (isProductionTest ? ".test" : ""); + } + + public String jobName() { + return jobName; + } + + /** Returns the zone for this job. */ + public ZoneId zone() { + return zone; } public boolean isSystemTest() { @@ -298,81 +164,31 @@ public final class JobType implements Comparable<JobType> { } /** Returns whether this is a production job */ - public boolean isProduction() { return environment() == prod; } + public boolean isProduction() { + return environment() == prod; + } /** Returns whether this job runs tests */ - public boolean isTest() { return isProductionTest || environment().isTest(); } + public boolean isTest() { + return isProductionTest || environment().isTest(); + } /** Returns whether this job deploys to a zone */ - public boolean isDeployment() { return ! (isProduction() && isProductionTest); } + public boolean isDeployment() { + return ! isProductionTest; + } /** Returns the environment of this job type */ public Environment environment() { - return zones.values().iterator().next().environment(); - } - - // TODO jonmv: require zones - public static Optional<JobType> fromOptionalJobName(String jobName) { - if (jobName.contains(".")) return Optional.of(ofSerialized(jobName)); // TODO jonmv: remove - return Stream.of(values) - .filter(jobType -> jobType.jobName.equals(jobName)) - .findAny(); - } - - // TODO jonmv: require zones - public static JobType fromJobName(String jobName) { - return fromOptionalJobName(jobName) - .orElseThrow(() -> new IllegalArgumentException("Unknown job name '" + jobName + "'")); - } - - // TODO jonmv: require zones - public static JobType fromJobName(String jobName, ZoneRegistry zones) { - String[] parts = jobName.split("-", 2); - if (parts.length != 2) throw new IllegalArgumentException("job names must be 'system-test', 'staging-test', or environment and region parts, separated by '-', but got: " + jobName); - switch (parts[0]) { - case "system": return systemTest(zones); - case "staging": return stagingTest(zones); - case "production": return prod(parts[1]); - case "test": return test(parts[1]); - case "dev": return dev(parts[1]); - case "perf": return perf(parts[1]); - default: throw new IllegalArgumentException("job names must begin with one of: system, staging, production, test, dev, perf; but got: " + jobName); - } - } - - /** Returns the job type for the given zone */ - public static Optional<JobType> from(SystemName system, ZoneId zone, boolean isTest) { - return Stream.of(values) - .filter(job -> zone.equals(job.zones.get(system)) && job.isTest() == isTest) - .findAny(); + return zone.environment(); } - /** Returns the job type for the given zone */ - public static Optional<JobType> from(SystemName system, ZoneId zone) { - return from(system, zone, zone.environment().isTest()); - } - - /** Returns the production test job type for the given environment and region or null if none */ - public static Optional<JobType> testFrom(SystemName system, RegionName region) { - return from(system, ZoneId.from(prod, region), true); - } - - /** Returns the job job type for the given environment and region or null if none */ - public static Optional<JobType> from(SystemName system, Environment environment, RegionName region) { - switch (environment) { - case test: return Optional.of(systemTest); - case staging: return Optional.of(stagingTest); - } - return from(system, ZoneId.from(environment, region)); - } - - - private static final Comparator<JobType> comparator = Comparator.comparing(JobType::environment) - .thenComparing(JobType::isDeployment) - .thenComparing(JobType::jobName); @Override public int compareTo(JobType other) { - return comparator.compare(this, other); + int result; + if (0 != (result = environment().compareTo(other.environment()))) return -result; + if (0 != (result = zone.region().compareTo(other.zone.region()))) return result; + return Boolean.compare(isProductionTest, other.isProductionTest); } @Override diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/NodeRepositoryNode.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/NodeRepositoryNode.java index 71f08f7318d..8964e1b5127 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/NodeRepositoryNode.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/NodeRepositoryNode.java @@ -85,6 +85,8 @@ public class NodeRepositoryNode { private Boolean wantToDeprovision; @JsonProperty("wantToRebuild") private Boolean wantToRebuild; + @JsonProperty("down") + private Boolean down; @JsonProperty("cost") private Integer cost; @JsonProperty("history") @@ -318,6 +320,14 @@ public class NodeRepositoryNode { this.wantToRebuild = wantToRebuild; } + public Boolean getDown() { + return down; + } + + public void setDown(Boolean down) { + this.down = down; + } + public Integer getCost() { return cost; } @@ -465,6 +475,7 @@ public class NodeRepositoryNode { ", wantToRetire=" + wantToRetire + ", wantToDeprovision=" + wantToDeprovision + ", wantToRebuild=" + wantToRebuild + + ", down=" + down + ", cost=" + cost + ", history=" + history + ", orchestratorStatus='" + orchestratorStatus + '\'' + diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/DeploymentFailureMails.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/DeploymentFailureMails.java index b35bf7c68c2..561fa21fde6 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/DeploymentFailureMails.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/DeploymentFailureMails.java @@ -75,8 +75,7 @@ public class DeploymentFailureMails { return "System test"; if (type.isStagingTest()) return "Staging test"; - return (type.isDeployment() ? "Deployment to " : "Verification test of ") + - type.zone(registry.system()).region(); + return (type.isDeployment() ? "Deployment to " : "Verification test of ") + type.zone().region(); } } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneRegistry.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneRegistry.java index 893b7a1b1dc..935ba17eed6 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneRegistry.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneRegistry.java @@ -81,6 +81,9 @@ public interface ZoneRegistry { /** Returns a URL where an informative dashboard can be found. */ URI dashboardUrl(); + /** Returns a URL which displays information about the given tenant. */ + URI dashboardUrl(TenantName id); + /** Returns a URL which displays information about the given application. */ URI dashboardUrl(ApplicationId id); diff --git a/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobTypeTest.java b/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobTypeTest.java index 64f4d6150dd..6ff52bd5f03 100644 --- a/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobTypeTest.java +++ b/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobTypeTest.java @@ -1,10 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.api.integration.deployment; -import com.yahoo.config.provision.Environment; -import com.yahoo.config.provision.SystemName; import com.yahoo.config.provision.zone.ZoneId; -import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneRegistry; import org.junit.Test; import static org.junit.Assert.assertEquals; @@ -18,20 +15,8 @@ public class JobTypeTest { @Test public void test() { - for (JobType type : JobType.values()) { - if (type.isProduction()) { - boolean match = false; - for (JobType other : JobType.values()) - match |= type != other - && type.isTest() == other.isDeployment() - && type.zones.equals(other.zones); - - assertTrue(type + " should have matching job", match); - } - } - - assertEquals(JobType.testUsEast3, JobType.ofSerialized("prod.us-east-3.test")); - assertEquals(JobType.devAwsUsEast1c, JobType.ofSerialized("dev.aws-us-east-1c")); + assertEquals(JobType.test("us-east-3"), JobType.ofSerialized("prod.us-east-3.test")); + assertEquals(JobType.dev("aws-us-east-1c"), JobType.ofSerialized("dev.aws-us-east-1c")); assertEquals(JobType.fromJobName("production-my-zone", null), JobType.prod("my-zone")); assertEquals(JobType.fromJobName("test-my-zone", null), JobType.test("my-zone")); |