aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/TestSummary.java
diff options
context:
space:
mode:
authorGravatar Michajlo Matijkiw <michajlo@google.com>2015-02-11 21:15:59 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-02-11 21:15:59 +0000
commitc766ee4596676d5b2aaad14e6559bf7ee430e62d (patch)
treef7f3b8b257bd0c4a027f2304154f2077457ed66d /src/main/java/com/google/devtools/build/lib/runtime/TestSummary.java
parentcbebd63acff81620c46c24e26780a5803fe42156 (diff)
fix accumulating logic around cached tests
there was an error in the accounting of how many tests were actually executed vs those that were cached. this was a result of not considering remotely cached tests when accumulating test results. fix the bug and add some unit tests to prove out functionality, as well as some javadoc clarifying functionality. R=janakr -- MOS_MIGRATED_REVID=86112421
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/TestSummary.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/TestSummary.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/TestSummary.java b/src/main/java/com/google/devtools/build/lib/runtime/TestSummary.java
index 171f15085f..75c7fe2e75 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/TestSummary.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/TestSummary.java
@@ -211,6 +211,12 @@ public class TestSummary implements Comparable<TestSummary> {
return this;
}
+ /**
+ * Set the number of results cached, locally or remotely.
+ *
+ * @param numCached number of results cached locally or remotely
+ * @return this Builder
+ */
public Builder setNumCached(int numCached) {
checkMutation();
summary.numCached = numCached;
@@ -329,6 +335,12 @@ public class TestSummary implements Comparable<TestSummary> {
return status;
}
+ /**
+ * Whether or not any results associated with this test were cached locally
+ * or remotely.
+ *
+ * @return true if any results were cached, false if not
+ */
public boolean isCached() {
return numCached > 0;
}
@@ -341,6 +353,9 @@ public class TestSummary implements Comparable<TestSummary> {
return numLocalActionCached;
}
+ /**
+ * @return number of results that were cached locally or remotely
+ */
public int numCached() {
return numCached;
}
@@ -349,6 +364,12 @@ public class TestSummary implements Comparable<TestSummary> {
return totalRuns() - numCached;
}
+ /**
+ * Whether or not any action was taken for this test, that is there was some
+ * result that was <em>not cached</em>.
+ *
+ * @return true if some action was taken for this test, false if not
+ */
public boolean actionRan() {
return actionRan;
}