aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2016-10-10 23:16:02 +0000
committerGravatar Yue Gan <yueg@google.com>2016-10-11 08:45:59 +0000
commitcc784073ca363ea25b3ee1a51c4a060ea2f5f081 (patch)
treee468442b8a95ad04da537deaa81e8aa95712501c /src
parenta725afe0644b0a6fe179e10e8c56ed3eedb81de5 (diff)
*** Reason for rollback *** This CL is causing failures in one of our integration tests: //javatests/com/google/security/authorization/sphinx/integration:SimpleUIEditorPageE2eTest_firefox-linux [] link: [] Note: Specifically, it looks like BinStackingShardingFilterFactory.java pointing to the branched RuntimeCost annotation is causing the failures. I tried to change our test to point to the branched RuntimeCost annotation but Target '//third_party/bazel/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted:weighted' is not visible. *** Original change description *** Branched internal RuntimeCost in junitrunner. RuntimeCost class is needed by the package com.google.testing.junit.runner.sharding.weighted. I branched it from the internal code because the weighted package is now open sourced and does not have access to the previous import. This didn't break Bazel before because there was no dependency to the weighted target when building BazelTestRunner. I catched this trying to open-source junitrunner tests. -- MOS_MIGRATED_REVID=135734237
Diffstat (limited to 'src')
-rw-r--r--src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD1
-rw-r--r--src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/BUILD1
-rw-r--r--src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/BinStackingShardingFilterFactory.java1
-rw-r--r--src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/RuntimeCost.java41
-rw-r--r--src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/WeightedShardingFilter.java1
5 files changed, 3 insertions, 42 deletions
diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD
index 5879ad4163..9d6c9c00c4 100644
--- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD
+++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD
@@ -14,7 +14,6 @@ java_library(
# Disable sunapi warnings about sun.misc.Signal.
# There are no non-Sun APIs for doing this.
javacopts = ["-Xlint:-sunapi"],
- runtime_deps = ["//src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted"],
deps = [
"//src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal",
"//src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4",
diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/BUILD
index e0cb79b3db..a35ed2357c 100644
--- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/BUILD
+++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/BUILD
@@ -12,6 +12,7 @@ java_library(
name = "weighted",
srcs = glob(["*.java"]),
deps = [
+ "//java/com/google/testing/util",
"//src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/api",
"//third_party:junit4",
],
diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/BinStackingShardingFilterFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/BinStackingShardingFilterFactory.java
index 6b3d05294c..5f597920bd 100644
--- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/BinStackingShardingFilterFactory.java
+++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/BinStackingShardingFilterFactory.java
@@ -16,6 +16,7 @@ package com.google.testing.junit.runner.sharding.weighted;
import com.google.testing.junit.runner.sharding.api.ShardingFilterFactory;
import com.google.testing.junit.runner.sharding.api.WeightStrategy;
+import com.google.testing.util.RuntimeCost;
import java.util.Collection;
import org.junit.Ignore;
import org.junit.runner.Description;
diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/RuntimeCost.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/RuntimeCost.java
deleted file mode 100644
index ee3726311c..0000000000
--- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/RuntimeCost.java
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2016 The Bazel Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.google.testing.junit.runner.sharding.weighted;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * An annotation specified on a test method to indicate the tests' expected
- * runtime duration. The costs are expressed in user defined relative units.
- * For example, if a test with weight=1 runs in 10 seconds, then test with
- * weight=5 should run in 50 seconds.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.METHOD})
-public @interface RuntimeCost {
-
- /**
- * Returns the relative cost of running the annotated test.
- */
- public int value();
-
- /**
- * Returns any notes.
- */
- public String notes() default "";
-}
diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/WeightedShardingFilter.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/WeightedShardingFilter.java
index 7e2795134e..bb3a8aa718 100644
--- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/WeightedShardingFilter.java
+++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/WeightedShardingFilter.java
@@ -15,6 +15,7 @@
package com.google.testing.junit.runner.sharding.weighted;
import com.google.testing.junit.runner.sharding.api.WeightStrategy;
+import com.google.testing.util.RuntimeCost;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;