diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2019-08-16 15:51:00 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2019-08-16 15:51:00 +0200 |
commit | 92832bbb4e7d32258448bd76cb320a7190456ae2 (patch) | |
tree | cbf5319f795149ec08ed77dd81204c3431df2352 | |
parent | f9ab8f501a1b476d0f2f3aafec12093ca2929617 (diff) |
Rename integration test categories and simplify pom.xml setup
6 files changed, 35 insertions, 68 deletions
diff --git a/tenant-base/pom.xml b/tenant-base/pom.xml index f087a8019da..3710fd738bc 100644 --- a/tenant-base/pom.xml +++ b/tenant-base/pom.xml @@ -37,6 +37,7 @@ <compiler_plugin_version>3.8.0</compiler_plugin_version> <surefire_version>2.22.0</surefire_version> <endpoint>https://api.vespa-external.aws.oath.cloud:4443</endpoint> + <test.categories>!integration</test.categories> </properties> <dependencyManagement> @@ -214,54 +215,6 @@ </plugins> </build> </profile> - - <profile> - <id>system-tests</id> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <groups>ai.vespa.hosted.cd.SystemTest</groups> - <excludedGroups>ai.vespa.hosted.cd.EmptyGroup</excludedGroups> - </configuration> - </plugin> - </plugins> - </build> - </profile> - - <profile> - <id>staging-tests</id> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <groups>ai.vespa.hosted.cd.StagingTest</groups> - <excludedGroups>ai.vespa.hosted.cd.EmptyGroup</excludedGroups> - </configuration> - </plugin> - </plugins> - </build> - </profile> - - <profile> - <id>production-tests</id> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <groups>ai.vespa.hosted.cd.ProductionTest</groups> - <excludedGroups>ai.vespa.hosted.cd.EmptyGroup</excludedGroups> - </configuration> - </plugin> - </plugins> - </build> - </profile> </profiles> <build> @@ -273,7 +226,7 @@ <artifactId>maven-surefire-plugin</artifactId> <version>${surefire_version}</version> <configuration> - <reportsDirectory>${env.TEST_DIR}</reportsDirectory> + <groups>${test.categories}</groups> <redirectTestOutputToFile>false</redirectTestOutputToFile> <trimStackTrace>false</trimStackTrace> <systemPropertyVariables> @@ -368,13 +321,6 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <excludedGroups> - ai.vespa.hosted.cd.SystemTest, - ai.vespa.hosted.cd.StagingTest, - ai.vespa.hosted.cd.ProductionTest - </excludedGroups> - </configuration> </plugin> </plugins> </build> 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. |