accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [1/6] accumulo git commit: ACCUMULO-3871 add counters to know the number of failed tests before the completion of the m/r job
Date Fri, 17 Jul 2015 18:53:05 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master e057f1a14 -> 7ec6291a3


ACCUMULO-3871 add counters to know the number of failed tests before the completion of the
m/r job


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/11487511
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/11487511
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/11487511

Branch: refs/heads/master
Commit: 114875114659eed8ada0b2d881f4d126a69ec51a
Parents: e057f1a
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Wed Jul 15 16:18:56 2015 -0400
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Wed Jul 15 16:18:56 2015 -0400

----------------------------------------------------------------------
 .../apache/accumulo/test/mrit/IntegrationTestMapReduce.java   | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/11487511/test/src/main/java/org/apache/accumulo/test/mrit/IntegrationTestMapReduce.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/mrit/IntegrationTestMapReduce.java
b/test/src/main/java/org/apache/accumulo/test/mrit/IntegrationTestMapReduce.java
index eb8a813..62b82c9 100644
--- a/test/src/main/java/org/apache/accumulo/test/mrit/IntegrationTestMapReduce.java
+++ b/test/src/main/java/org/apache/accumulo/test/mrit/IntegrationTestMapReduce.java
@@ -86,6 +86,10 @@ public class IntegrationTestMapReduce extends Configured implements Tool
{
     static final Text PASS = new Text("PASS");
     static final Text ERROR = new Text("ERROR");
 
+    public static enum TestCounts {
+      PASS, FAIL, ERROR
+    }
+
     @Override
     protected void map(LongWritable key, Text value, final Mapper<LongWritable,Text,Text,Text>.Context
context) throws IOException, InterruptedException {
       isMapReduce = true;
@@ -99,6 +103,7 @@ public class IntegrationTestMapReduce extends Configured implements Tool
{
         test = Class.forName(className);
       } catch (ClassNotFoundException e) {
         log.debug("Error finding class {}", className, e);
+        context.getCounter(TestCounts.ERROR);
         context.write(ERROR, new Text(e.toString()));
         return;
       }
@@ -131,9 +136,11 @@ public class IntegrationTestMapReduce extends Configured implements Tool
{
         Result result = core.run(test);
         if (result.wasSuccessful()) {
           log.info("{} was successful", className);
+          context.getCounter(TestCounts.PASS);
           context.write(PASS, value);
         } else {
           log.info("{} failed", className);
+          context.getCounter(TestCounts.FAIL);
           context.write(FAIL, new Text(className + "(" + StringUtils.join(failures, ", ")
+ ")"));
         }
       } catch (Exception e) {


Mime
View raw message