Skylark: Document default attributes for test rules.
Add 'args' to the list (for consistency with native rules).
--
MOS_MIGRATED_REVID=96776585
diff --git a/site/docs/skylark/rules.md b/site/docs/skylark/rules.md
index cbab9df..671b1bc 100644
--- a/site/docs/skylark/rules.md
+++ b/site/docs/skylark/rules.md
@@ -29,8 +29,9 @@
is useful in particular for label attributes (your rule will have an
implicit dependency on this label).
-The following attributes are implicitly added to every rule: `name`,
-`visibility`, `deprecation`, `tags`, `testonly`, `features`.
+The following attributes are implicitly added to every rule: `deprecation`,
+`features`, `name`, `tags`, `testonly`, `visibility`. Test rules also have the
+following attributes: `args`, `flaky`, `local`, `shard_count`, `size`, `timeout`.
To access an attribute, use `ctx.attr.<attribute_name>`. The name and the
package of a rule are available with `ctx.label.name` and `ctx.label.package`.
diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java
index b0ffbc6..f05d222 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java
@@ -22,6 +22,7 @@
import static com.google.devtools.build.lib.packages.Type.LABEL;
import static com.google.devtools.build.lib.packages.Type.LABEL_LIST;
import static com.google.devtools.build.lib.packages.Type.STRING;
+import static com.google.devtools.build.lib.packages.Type.STRING_LIST;
import static com.google.devtools.build.lib.syntax.SkylarkType.castList;
import static com.google.devtools.build.lib.syntax.SkylarkType.castMap;
@@ -146,6 +147,8 @@
.add(attr("shard_count", INTEGER).value(-1))
.add(attr("local", BOOLEAN).value(false).taggable()
.nonconfigurable("policy decision: this should be consistent across configurations"))
+ .add(attr("args", STRING_LIST)
+ .nonconfigurable("policy decision: should be consistent across configurations"))
.add(attr("$test_runtime", LABEL_LIST).cfg(HOST).value(ImmutableList.of(
labelCache.getUnchecked("//tools/test:runtime"))))
.add(attr(":run_under", LABEL).cfg(DATA).value(RUN_UNDER))