diff options
Diffstat (limited to 'src')
5 files changed, 42 insertions, 3 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 9d6c9c00c4..5879ad4163 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,6 +14,7 @@ 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 a35ed2357c..e0cb79b3db 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,7 +12,6 @@ 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 5f597920bd..6b3d05294c 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,7 +16,6 @@ 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 new file mode 100644 index 0000000000..ee3726311c --- /dev/null +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/weighted/RuntimeCost.java @@ -0,0 +1,41 @@ +// 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 bb3a8aa718..7e2795134e 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,7 +15,6 @@ 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; |