aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Philipp Wollermann <philwo@google.com>2016-12-09 13:07:37 +0000
committerGravatar Irina Iancu <elenairina@google.com>2016-12-09 15:33:28 +0000
commit6be7a06de9ae1bf02e8bca2a4fcda94d112bc204 (patch)
treecf38438f291bfa3504a650ace483730ba8b29bea /src
parentad2ac97af8dc3bfeacbd406d66f8d9ebc956b253 (diff)
Fix the documentation for the "size" attribute in tests.
It wrongly stated that this only affects the timeout, however it actually affects the resources required for a test to run. -- PiperOrigin-RevId: 141546278 MOS_MIGRATED_REVID=141546278
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/docgen/templates/attributes/test/size.html40
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/test/TestTargetProperties.java3
2 files changed, 40 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/size.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/size.html
index 9da6c57d80..e1807113b8 100644
--- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/size.html
+++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/size.html
@@ -6,6 +6,40 @@ default is "medium"; optional</code></p>
<p>A classification of the test's "heaviness": how much time/resources
it needs to run.</p>
-<p>Unittests are considered "small", integration tests "medium", and
-end-to-end tests "large" or "enormous". Bazel uses the size only
-to determine a default timeout.</p>
+<p>Unittests are considered "small", integration tests "medium", and end-to-end tests "large" or
+"enormous". Bazel uses the size to determine a default timeout (which can be overridden using the
+"timeout" attribute) and the amount of resources that have to be acquired for the test to run.
+The mapping of test size to resource is currently:</p>
+
+<table style="width: 100%">
+ <tr>
+ <th>size</th>
+ <th>RAM (in MB)</th>
+ <th>CPU (in CPU cores)</th>
+ <th>I/O (fraction)</th>
+ </tr>
+ <tr>
+ <td>small</td>
+ <td>20</td>
+ <td>0.9</td>
+ <td>0</td>
+ </tr>
+ <tr>
+ <td>medium</td>
+ <td>100</td>
+ <td>0.9</td>
+ <td>0.1</td>
+ </tr>
+ <tr>
+ <td>large</td>
+ <td>300</td>
+ <td>0.8</td>
+ <td>0.1</td>
+ </tr>
+ <tr>
+ <td>enormous</td>
+ <td>800</td>
+ <td>0.7</td>
+ <td>0.4</td>
+ </tr>
+</table>
diff --git a/src/main/java/com/google/devtools/build/lib/rules/test/TestTargetProperties.java b/src/main/java/com/google/devtools/build/lib/rules/test/TestTargetProperties.java
index 4cd561c6fc..c455933424 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/test/TestTargetProperties.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/test/TestTargetProperties.java
@@ -37,6 +37,9 @@ public class TestTargetProperties {
/**
* Resources used by local tests of various sizes.
+ *
+ * <p>When changing these values, remember to update the documentation at
+ * attributes/test/size.html.
*/
private static final ResourceSet SMALL_RESOURCES = ResourceSet.create(20, 0.9, 0.00, 1);
private static final ResourceSet MEDIUM_RESOURCES = ResourceSet.create(100, 0.9, 0.1, 1);