diff options
author | Valerij Fredriksen <valerijf@verizonmedia.com> | 2019-08-20 16:58:46 +0200 |
---|---|---|
committer | Valerij Fredriksen <valerijf@verizonmedia.com> | 2019-08-20 16:58:46 +0200 |
commit | 94f014195bc61925d60e16a823ad1858a639cb0b (patch) | |
tree | 371f9b047d4340dda7ef22f98b871a08143bf401 /tenant-cd | |
parent | 85e3fd8d395a53d74d5b1d1769d49fb40424ea90 (diff) | |
parent | 272c6dc7543f71a2a9b4311e1e7e4db4daa8b742 (diff) |
Merge branch 'master' into freva/add-bandwidth-to-node-resources
# Conflicts:
# node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/LoadBalancerExpirerTest.java
Diffstat (limited to 'tenant-cd')
8 files changed, 44 insertions, 27 deletions
diff --git a/tenant-cd/src/main/java/ai/vespa/hosted/cd/EmptyGroup.java b/tenant-cd/src/main/java/ai/vespa/hosted/cd/EmptyGroup.java deleted file mode 100644 index 8deca3cfb11..00000000000 --- a/tenant-cd/src/main/java/ai/vespa/hosted/cd/EmptyGroup.java +++ /dev/null @@ -1,9 +0,0 @@ -package ai.vespa.hosted.cd; - -/** - * The Surefire configuration element <excludedGroups> requires a non-empty argument to reset another. - * This class serves that purpose. Without it, no tests run in the various integration test profiles. - * - * @author jonmv - */ -public interface EmptyGroup { } diff --git a/tenant-cd/src/main/java/ai/vespa/hosted/cd/IntegrationTest.java b/tenant-cd/src/main/java/ai/vespa/hosted/cd/IntegrationTest.java new file mode 100644 index 00000000000..a8c8d958cc1 --- /dev/null +++ b/tenant-cd/src/main/java/ai/vespa/hosted/cd/IntegrationTest.java @@ -0,0 +1,27 @@ +// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package ai.vespa.hosted.cd; + +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * Tests which run against a fully operational Vespa deployment to verify its behaviour. + * + * Examples of integration test types are {@link SystemTest}, {@link StagingTest} and {@link ProductionTest}. + * + * @author jonmv + */ +@Target({TYPE, ANNOTATION_TYPE}) +@Retention(RUNTIME) +@Tag("integration") +public @interface IntegrationTest { } + diff --git a/tenant-cd/src/main/java/ai/vespa/hosted/cd/ProductionTest.java b/tenant-cd/src/main/java/ai/vespa/hosted/cd/ProductionTest.java index e9a2be1fb1f..a60a8ea0e14 100644 --- a/tenant-cd/src/main/java/ai/vespa/hosted/cd/ProductionTest.java +++ b/tenant-cd/src/main/java/ai/vespa/hosted/cd/ProductionTest.java @@ -26,7 +26,8 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; */ @Target({TYPE, ANNOTATION_TYPE}) @Retention(RUNTIME) -@Tag("ai.vespa.hosted.cd.ProductionTest") +@IntegrationTest +@Tag("production") public @interface ProductionTest { // Want to verify metrics (Vespa). diff --git a/tenant-cd/src/main/java/ai/vespa/hosted/cd/StagingTest.java b/tenant-cd/src/main/java/ai/vespa/hosted/cd/StagingTest.java index b0325efa8d3..93a5780da25 100644 --- a/tenant-cd/src/main/java/ai/vespa/hosted/cd/StagingTest.java +++ b/tenant-cd/src/main/java/ai/vespa/hosted/cd/StagingTest.java @@ -28,7 +28,8 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; */ @Target({TYPE, ANNOTATION_TYPE}) @Retention(RUNTIME) -@Tag("ai.vespa.hosted.cd.StagingTest") +@IntegrationTest +@Tag("staging") public @interface StagingTest { // Want to verify documents are not damaged by upgrade. diff --git a/tenant-cd/src/main/java/ai/vespa/hosted/cd/SystemTest.java b/tenant-cd/src/main/java/ai/vespa/hosted/cd/SystemTest.java index f27fa01072c..ccaf0765768 100644 --- a/tenant-cd/src/main/java/ai/vespa/hosted/cd/SystemTest.java +++ b/tenant-cd/src/main/java/ai/vespa/hosted/cd/SystemTest.java @@ -28,7 +28,8 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; */ @Target({TYPE, ANNOTATION_TYPE}) @Retention(RUNTIME) -@Tag("ai.vespa.hosted.cd.SystemTest") +@IntegrationTest +@Tag("system") public @interface SystemTest { // Want to feed some documents. diff --git a/tenant-cd/src/main/java/ai/vespa/hosted/cd/TestRuntime.java b/tenant-cd/src/main/java/ai/vespa/hosted/cd/TestRuntime.java index 4ae1c0b7a5e..e10d627808f 100644 --- a/tenant-cd/src/main/java/ai/vespa/hosted/cd/TestRuntime.java +++ b/tenant-cd/src/main/java/ai/vespa/hosted/cd/TestRuntime.java @@ -1,10 +1,10 @@ package ai.vespa.hosted.cd; -import ai.vespa.hosted.api.ApiAuthenticator; -import ai.vespa.hosted.api.EndpointAuthenticator; +import ai.vespa.hosted.api.Authenticator; import ai.vespa.hosted.api.ControllerHttpClient; import ai.vespa.hosted.api.Properties; import ai.vespa.hosted.api.TestConfig; +import ai.vespa.hosted.auth.CertificateAndKeyAuthenticator; import ai.vespa.hosted.cd.http.HttpDeployment; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.Environment; @@ -29,7 +29,7 @@ public class TestRuntime { private final Map<String, Deployment> productionDeployments; private final Deployment deploymentToTest; - private TestRuntime(TestConfig config, EndpointAuthenticator authenticator) { + private TestRuntime(TestConfig config, Authenticator authenticator) { this.config = config; this.productionDeployments = config.deployments().entrySet().stream() .filter(zoneDeployment -> zoneDeployment.getKey().environment() == Environment.prod) @@ -41,7 +41,7 @@ public class TestRuntime { } /** - * Returns the config for this test, or null if it has not been provided. + * Returns the config and authenticator to use when running integration tests. * * If the system property {@code "vespa.test.config"} is set (to a file path), a file at that location * is attempted read, and config parsed from it. @@ -55,13 +55,13 @@ public class TestRuntime { String configPath = System.getProperty("vespa.test.config"); TestConfig config = configPath != null ? fromFile(configPath) : fromController(); theRuntime = new TestRuntime(config, - new ai.vespa.hosted.auth.EndpointAuthenticator(config.system())); + new CertificateAndKeyAuthenticator(config.system())); } return theRuntime; } /** Returns a copy of this runtime, with the given endpoint authenticator. */ - public TestRuntime with(EndpointAuthenticator authenticator) { + public TestRuntime with(Authenticator authenticator) { return new TestRuntime(config, authenticator); } diff --git a/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpDeployment.java b/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpDeployment.java index 22c622effae..04cebcf50b2 100644 --- a/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpDeployment.java +++ b/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpDeployment.java @@ -1,6 +1,6 @@ package ai.vespa.hosted.cd.http; -import ai.vespa.hosted.api.EndpointAuthenticator; +import ai.vespa.hosted.api.Authenticator; import ai.vespa.hosted.cd.TestDeployment; import ai.vespa.hosted.cd.TestEndpoint; import com.yahoo.config.provision.Environment; @@ -22,7 +22,7 @@ public class HttpDeployment implements TestDeployment { private final Map<String, HttpEndpoint> endpoints; /** Creates a representation of the given deployment endpoints, using the authenticator for data plane access. */ - public HttpDeployment(Map<String, URI> endpoints, ZoneId zone, EndpointAuthenticator authenticator) { + public HttpDeployment(Map<String, URI> endpoints, ZoneId zone, Authenticator authenticator) { this.zone = zone; this.endpoints = endpoints.entrySet().stream() .collect(Collectors.toUnmodifiableMap(entry -> entry.getKey(), diff --git a/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpEndpoint.java b/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpEndpoint.java index 17703d8fbab..a9d8f2e7cc5 100644 --- a/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpEndpoint.java +++ b/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpEndpoint.java @@ -1,9 +1,6 @@ package ai.vespa.hosted.cd.http; -import ai.vespa.hosted.api.EndpointAuthenticator; -import com.yahoo.slime.Inspector; -import com.yahoo.slime.JsonDecoder; -import com.yahoo.slime.Slime; +import ai.vespa.hosted.api.Authenticator; import ai.vespa.hosted.cd.Digest; import ai.vespa.hosted.cd.Feed; import ai.vespa.hosted.cd.Query; @@ -14,7 +11,6 @@ import ai.vespa.hosted.cd.Visit; import ai.vespa.hosted.cd.metric.Metrics; import java.io.IOException; -import java.io.UncheckedIOException; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; @@ -37,9 +33,9 @@ public class HttpEndpoint implements TestEndpoint { private final URI endpoint; private final HttpClient client; - private final EndpointAuthenticator authenticator; + private final Authenticator authenticator; - public HttpEndpoint(URI endpoint, EndpointAuthenticator authenticator) { + public HttpEndpoint(URI endpoint, Authenticator authenticator) { this.endpoint = requireNonNull(endpoint); this.authenticator = requireNonNull(authenticator); this.client = HttpClient.newBuilder() |