summaryrefslogtreecommitdiffstats
path: root/tenant-cd
diff options
context:
space:
mode:
authorJon Marius Venstad <jvenstad@yahoo-inc.com>2019-06-27 14:25:29 +0200
committerJon Marius Venstad <jvenstad@yahoo-inc.com>2019-06-27 14:25:29 +0200
commita8596d43658832c5f7d52bfd985396258ffbaae7 (patch)
treef165073dad3d9220b31254b22b3098473eca9d09 /tenant-cd
parent6864b681a2c02a8c5951ca133a693dd26abe8c07 (diff)
Provide annotations for different test classes
Diffstat (limited to 'tenant-cd')
-rw-r--r--tenant-cd/src/main/java/ai/vespa/hosted/cd/ProductionTest.java19
-rw-r--r--tenant-cd/src/main/java/ai/vespa/hosted/cd/StagingTest.java20
-rw-r--r--tenant-cd/src/main/java/ai/vespa/hosted/cd/SystemTest.java21
3 files changed, 48 insertions, 12 deletions
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 0dfeab5d327..5f6e4408b93 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
@@ -1,6 +1,16 @@
// 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.Retention;
+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 that verify the health of production deployments of Vespa applications.
*
@@ -14,10 +24,11 @@ package ai.vespa.hosted.cd;
*
* @author jonmv
*/
-public interface ProductionTest {
-
- /** Use with JUnit 5 @Tag to have this run in the production jobs in the pipeline. */
- String name = "ai.vespa.hosted.cd.ProductionTest";
+@Target({TYPE, ANNOTATION_TYPE})
+@Retention(RUNTIME)
+@Test
+@Tag("ai.vespa.hosted.cd.ProductionTest")
+public @interface ProductionTest {
// Want to verify metrics (Vespa).
// Want to verify external metrics (YAMAS, other).
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 6e1487ced0f..ae753c9cffc 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
@@ -1,6 +1,16 @@
// 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.Retention;
+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 that assert continuity of behaviour for Vespa application deployments, through upgrades.
*
@@ -16,11 +26,13 @@ package ai.vespa.hosted.cd;
*
* @author jonmv
*/
-public interface StagingTest {
-
- /** Use with JUnit 5 @Tag to have this run in the staging test job in the pipeline. */
- String name = "ai.vespa.hosted.cd.StagingTest";
+@Target({TYPE, ANNOTATION_TYPE})
+@Retention(RUNTIME)
+@Test
+@Tag("ai.vespa.hosted.cd.StagingTest")
+public @interface StagingTest {
// Want to verify documents are not damaged by upgrade.
// May want to verify metrics during 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 36539cb63c1..3c3c96a1974 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
@@ -1,6 +1,18 @@
// 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 that compare the behaviour of a Vespa application deployment against a fixed specification.
*
@@ -14,10 +26,11 @@ package ai.vespa.hosted.cd;
*
* @author jonmv
*/
-public interface SystemTest {
-
- /** Use with JUnit 5 @Tag to have this run in the system test job in the pipeline. */
- String name = "ai.vespa.hosted.cd.SystemTest";
+@Target({TYPE, ANNOTATION_TYPE})
+@Retention(RUNTIME)
+@Test
+@Tag("ai.vespa.hosted.cd.SystemTest")
+public @interface SystemTest {
// Want to feed some documents.
// Want to verify document processing and routing is as expected.