aboutsummaryrefslogtreecommitdiffstats
path: root/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java
diff options
context:
space:
mode:
Diffstat (limited to 'controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java12
1 files changed, 6 insertions, 6 deletions
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 7aac0826b2b..1f546989b8d 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
@@ -143,15 +143,15 @@ public enum JobType {
private final String jobName;
private final Map<SystemName, ZoneId> zones;
- private final boolean isTest;
+ private final boolean isProductionTest;
- JobType(String jobName, Map<SystemName, ZoneId> zones, boolean isTest) {
+ 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");
this.jobName = jobName;
this.zones = zones;
- this.isTest = isTest;
+ this.isProductionTest = isProductionTest;
}
JobType(String jobName, Map<SystemName, ZoneId> zones) {
@@ -176,10 +176,10 @@ public enum JobType {
public boolean isProduction() { return environment() == Environment.prod; }
/** Returns whether this job runs tests */
- public boolean isTest() { return isTest; }
+ public boolean isTest() { return isProductionTest || environment().isTest(); }
/** Returns whether this job deploys to a zone */
- public boolean isDeployment() { return ! (isProduction() && isTest); }
+ public boolean isDeployment() { return ! (isProduction() && isProductionTest); }
/** Returns the environment of this job type, or null if it does not have an environment */
public Environment environment() {
@@ -206,7 +206,7 @@ public enum JobType {
/** Returns the job type for the given zone */
public static Optional<JobType> from(SystemName system, ZoneId zone) {
- return from(system, zone, false);
+ return from(system, zone, zone.environment().isTest());
}
/** Returns the production test job type for the given environment and region or null if none */