summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Chabot <brettchabot@google.com>2014-06-13 16:32:21 -0700
committerBrett Chabot <brettchabot@google.com>2014-06-13 16:32:21 -0700
commit63726971b42c7a6fb9df9d70117ad10511da96e3 (patch)
tree77f284945a5597415853fb47de431fbed27f1ee7
parent1afabcc1a3db33f786ff7cc0c8d72e40990c8876 (diff)
downloadtesting-63726971b42c7a6fb9df9d70117ad10511da96e3.tar.gz
Only print suite assignment suggestions if test timing is valid.
Also increase small test limit to 200ms. Change-Id: I8fa4116efecf63939e6b8e7adbbb33d306690b73
-rw-r--r--support/src/android/support/test/internal/runner/listener/SuiteAssignmentPrinter.java32
1 files changed, 18 insertions, 14 deletions
diff --git a/support/src/android/support/test/internal/runner/listener/SuiteAssignmentPrinter.java b/support/src/android/support/test/internal/runner/listener/SuiteAssignmentPrinter.java
index 798e252..aafe4d5 100644
--- a/support/src/android/support/test/internal/runner/listener/SuiteAssignmentPrinter.java
+++ b/support/src/android/support/test/internal/runner/listener/SuiteAssignmentPrinter.java
@@ -35,7 +35,7 @@ public class SuiteAssignmentPrinter extends InstrumentationRunListener {
* This constant defines the maximum allowed runtime (in ms) for a test included in the "small"
* suite. It is used to make an educated guess at what suite an unlabeled test belongs to.
*/
- private static final float SMALL_SUITE_MAX_RUNTIME = 100;
+ private static final float SMALL_SUITE_MAX_RUNTIME = 200;
/**
* This constant defines the maximum allowed runtime (in ms) for a test included in the "medium"
@@ -61,6 +61,10 @@ public class SuiteAssignmentPrinter extends InstrumentationRunListener {
if (!mTimingValid || mStartTime < 0) {
assignmentSuite = "NA";
runTime = -1;
+ sendString("F");
+ Log.d("SuiteAssignmentPrinter", String.format(
+ "%s#%s: skipping suite assignment due to test failure\n", description.getClassName(),
+ description.getMethodName()));
} else {
runTime = endTime - mStartTime;
if (runTime < SMALL_SUITE_MAX_RUNTIME) {
@@ -70,23 +74,23 @@ public class SuiteAssignmentPrinter extends InstrumentationRunListener {
} else {
assignmentSuite = TestRequestBuilder.LARGE_SIZE;
}
+
+ String currentSize = getTestSize(description);
+ if (!assignmentSuite.equals(currentSize)) {
+ // test size != runtime
+ sendString(String.format("\n%s#%s: current size: %s. suggested: %s runTime: %d ms\n",
+ description.getClassName(), description.getMethodName(), currentSize,
+ assignmentSuite, runTime));
+ } else {
+ sendString(".");
+ Log.d("SuiteAssignmentPrinter", String.format(
+ "%s#%s assigned correctly as %s. runTime: %d ms\n", description.getClassName(),
+ description.getMethodName(), assignmentSuite, runTime));
+ }
}
// Clear mStartTime so that we can verify that it gets set next time.
mStartTime = -1;
- String currentSize = getTestSize(description);
- if (!assignmentSuite.equals(currentSize)) {
- // test size != runtime
- sendString(String.format("\n%s#%s: current size: %s. suggested: %s runTime: %d ms\n",
- description.getClassName(), description.getMethodName(), currentSize,
- assignmentSuite, runTime));
- } else {
- sendString(".");
- Log.d("SuiteAssignmentPrinter", String.format(
- "%s#%s assigned correctly as %s. runTime: %d ms\n", description.getClassName(),
- description.getMethodName(), assignmentSuite, runTime));
- }
-
}
private String getTestSize(Description description) {