summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2020-06-17 10:56:52 +0200
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2020-06-17 10:56:52 +0200
commit2b2485cd6f22ced3d35db372d5d5ca140b005911 (patch)
tree32e29b807e32357d1fa1970acf063ad865086b55
parentecd4e0c09f20733f177fcd90c6f986f0202d1e96 (diff)
Add zone() to TestRuntime
-rw-r--r--cloud-tenant-cd/pom.xml12
-rw-r--r--cloud-tenant-cd/src/main/java/ai/vespa/hosted/cd/VespaTestRuntime.java17
-rw-r--r--tenant-cd-api/abi-spec.json3
-rw-r--r--tenant-cd-api/pom.xml6
-rw-r--r--tenant-cd-api/src/main/java/ai/vespa/hosted/cd/TestRuntime.java5
5 files changed, 31 insertions, 12 deletions
diff --git a/cloud-tenant-cd/pom.xml b/cloud-tenant-cd/pom.xml
index b61e06eba04..ba4b7d02020 100644
--- a/cloud-tenant-cd/pom.xml
+++ b/cloud-tenant-cd/pom.xml
@@ -37,6 +37,12 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>com.yahoo.vespa</groupId>
+ <artifactId>hosted-zone-api</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
<!-- compile scope -->
<dependency>
@@ -51,6 +57,12 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>com.yahoo.vespa</groupId>
+ <artifactId>config-provisioning</artifactId>
+ <version>${project.version}</version>
+ <scope>compile</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/cloud-tenant-cd/src/main/java/ai/vespa/hosted/cd/VespaTestRuntime.java b/cloud-tenant-cd/src/main/java/ai/vespa/hosted/cd/VespaTestRuntime.java
index f77716064e5..75aaaec78ba 100644
--- a/cloud-tenant-cd/src/main/java/ai/vespa/hosted/cd/VespaTestRuntime.java
+++ b/cloud-tenant-cd/src/main/java/ai/vespa/hosted/cd/VespaTestRuntime.java
@@ -1,6 +1,7 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.hosted.cd;
+import ai.vespa.cloud.Zone;
import ai.vespa.hosted.api.ControllerHttpClient;
import ai.vespa.hosted.api.Properties;
import ai.vespa.hosted.api.TestConfig;
@@ -26,17 +27,11 @@ public class VespaTestRuntime implements TestRuntime {
this.deploymentToTest = new HttpDeployment(config.deployments().get(config.zone()), new ai.vespa.hosted.auth.EndpointAuthenticator(config.system()));
}
-// In use ?
-// /** Returns a copy of this runtime, with the given endpoint authenticator. */
-// public TestRuntime with(EndpointAuthenticator authenticator) {
-// return new TestRuntime(config, authenticator);
-// }
-
- /** Returns the full id of the application this is testing. */
- public ApplicationId application() { return config.application(); }
-
- /** Returns the zone of the deployment this is testing. */
- public ZoneId zone() { return config.zone(); }
+ @Override
+ public Zone zone() {
+ return new Zone(
+ ai.vespa.cloud.Environment.valueOf(config.zone().environment().name()),
+ config.zone().region().value()); }
/** Returns the deployment this is testing. */
@Override
diff --git a/tenant-cd-api/abi-spec.json b/tenant-cd-api/abi-spec.json
index ce987107c0e..677a18c74e4 100644
--- a/tenant-cd-api/abi-spec.json
+++ b/tenant-cd-api/abi-spec.json
@@ -109,7 +109,8 @@
],
"methods": [
"public static ai.vespa.hosted.cd.TestRuntime get()",
- "public abstract ai.vespa.hosted.cd.Deployment deploymentToTest()"
+ "public abstract ai.vespa.hosted.cd.Deployment deploymentToTest()",
+ "public abstract ai.vespa.cloud.Zone zone()"
],
"fields": []
}
diff --git a/tenant-cd-api/pom.xml b/tenant-cd-api/pom.xml
index 6f6ebba7699..b19d42d094f 100644
--- a/tenant-cd-api/pom.xml
+++ b/tenant-cd-api/pom.xml
@@ -23,6 +23,12 @@
<!-- provided -->
<dependency>
<groupId>com.yahoo.vespa</groupId>
+ <artifactId>hosted-zone-api</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.yahoo.vespa</groupId>
<artifactId>annotations</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
diff --git a/tenant-cd-api/src/main/java/ai/vespa/hosted/cd/TestRuntime.java b/tenant-cd-api/src/main/java/ai/vespa/hosted/cd/TestRuntime.java
index feea05b7064..08cc0467b71 100644
--- a/tenant-cd-api/src/main/java/ai/vespa/hosted/cd/TestRuntime.java
+++ b/tenant-cd-api/src/main/java/ai/vespa/hosted/cd/TestRuntime.java
@@ -1,6 +1,8 @@
// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.hosted.cd;
+import ai.vespa.cloud.Zone;
+
import java.util.ServiceLoader;
/**
@@ -16,4 +18,7 @@ public interface TestRuntime {
}
Deployment deploymentToTest();
+
+ Zone zone();
+
}