Remove @Ignore annotations from test support classes
At the bazel level treat only *Test.java classes as test classes and
build the rest of the classes under src/test/java/** as a java_library.
Change-Id: I10e418a09892da9700fa1f1a135ebab37e08ab95
diff --git a/BUILD b/BUILD
index d2d5e7d..01d9a2f 100644
--- a/BUILD
+++ b/BUILD
@@ -24,15 +24,28 @@
junit_tests(
name = "spanner-refdb_tests",
- srcs = glob(["src/test/java/**/*.java"]),
+ srcs = glob(["src/test/java/**/*Test.java"]),
resources = glob(["src/main/resources/**/*"]),
tags = ["spanner-refdb"],
deps = [
+ ":spanner-refdb_test_util",
":spanner-refdb__plugin_test_deps",
],
)
java_library(
+ name = "spanner-refdb_test_util",
+ testonly = True,
+ srcs = glob(
+ ["src/test/java/**/*.java"],
+ exclude = ["src/test/java/**/*Test.java"],
+ ),
+ deps = [
+ ":spanner-refdb__plugin_test_deps",
+ ]
+)
+
+java_library(
name = "spanner-refdb__plugin_test_deps",
testonly = 1,
visibility = ["//visibility:public"],
diff --git a/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/EmulatedSpannerRefDb.java b/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/EmulatedSpannerRefDb.java
index 20d6973..5ecfcc7 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/EmulatedSpannerRefDb.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/EmulatedSpannerRefDb.java
@@ -30,11 +30,9 @@
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
-import org.junit.Ignore;
import org.testcontainers.containers.SpannerEmulatorContainer;
import org.testcontainers.utility.DockerImageName;
-@Ignore
public class EmulatedSpannerRefDb extends SpannerTestSystem {
public static final String PROJECT_ID = "test";
public static final String SPANNER_INSTANCE_ID = "spanner-instance";
diff --git a/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/RealSpannerRefDb.java b/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/RealSpannerRefDb.java
index 01f34db..499ac57 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/RealSpannerRefDb.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/RealSpannerRefDb.java
@@ -28,9 +28,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
-import org.junit.Ignore;
-@Ignore
public class RealSpannerRefDb extends SpannerTestSystem {
private static RealSpannerRefDb INSTANCE;
diff --git a/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/RefFixture.java b/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/RefFixture.java
index 67e8428..9a0e816 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/RefFixture.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/RefFixture.java
@@ -19,9 +19,7 @@
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectIdRef;
import org.eclipse.jgit.lib.Ref;
-import org.junit.Ignore;
-@Ignore
public interface RefFixture {
static final String PROJECT_NAME = "A_TEST_PROJECT_NAME";
static final Project.NameKey PROJECT_NAME_KEY = Project.nameKey(PROJECT_NAME);
diff --git a/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/SpannerTestSystem.java b/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/SpannerTestSystem.java
index 5b2d6e6..3eb6d0c 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/SpannerTestSystem.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/spannerrefdb/SpannerTestSystem.java
@@ -15,9 +15,7 @@
package com.googlesource.gerrit.plugins.spannerrefdb;
import com.google.cloud.spanner.DatabaseClient;
-import org.junit.Ignore;
-@Ignore
public abstract class SpannerTestSystem {
public static SpannerTestSystem create() throws Exception {