From 7d3bdbcfbe86eb37d665aba08c13a9101d35c0f7 Mon Sep 17 00:00:00 2001
From: nharmata bazel build
and bazel test
; you should specify such
+test targets with explicit target patterns on the command line if you want Bazel
+to build/test them. In contrast, bazel query
doesn't perform any
+such filtering automatically (that would defeat the purpose of
+bazel query
).
### Fetching external dependencies
diff --git a/src/main/java/com/google/devtools/build/lib/rules/test/TestSuiteRule.java b/src/main/java/com/google/devtools/build/lib/rules/test/TestSuiteRule.java
index 33b449453771be..ecd4e34cb32003 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/test/TestSuiteRule.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/test/TestSuiteRule.java
@@ -58,11 +58,13 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env)
tests still need to be legal (e.g. not blocked by visibility constraints).
- The manual
tag keyword is treated specially. It marks the
- test_suite
target as "manual" so that it will be ignored by the wildcard
- expansion and automated testing facilities. It does not work as a filter on the set
- of tests in the suite. So when the manual
tag is used on a test_suite, test
- rules do not have to be tagged as manual
to be included in the test suite.
+ The manual
tag keyword is treated differently than the above by the
+ "test_suite expansion" performed by the blaze test
command on invocations
+ involving wildcard
+ target patterns.
+ There, test_suite
targets tagged "manual" are filtered out (and thus not
+ expanded). This behavior is consistent with how blaze build
and
+ blaze test
handle wildcard target patterns in general.
Note that a test's size
is considered a tag for the purpose of filtering.
@@ -120,7 +122,10 @@ public Metadata getMetadata() {
A test_suite
defines a set of tests that are considered "useful" to humans. This
allows projects to define sets of tests, such as "tests you must run before checkin", "our
-project's stress tests" or "all small tests."
+project's stress tests" or "all small tests." The blaze test
command respects this sort
+of organization: For an invocation like blaze test //some/test:suite
, Blaze first
+enumerates all test targets transitively included by the //some/test:suite
target (we
+call this "test_suite expansion"), then Blaze builds and tests those targets.