sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject sqoop git commit: SQOOP-2447: Sqoop2: Precommit: Improve cobertura test coverage reporting
Date Thu, 30 Jul 2015 01:44:26 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 eb76d8bb1 -> 51fe7a9bc


SQOOP-2447: Sqoop2: Precommit: Improve cobertura test coverage reporting

(Jarek Jarcec Cecho via Abraham Elmahrek)


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

Branch: refs/heads/sqoop2
Commit: 51fe7a9bc14c6c33ebd3a4f50c675fae5220418f
Parents: eb76d8b
Author: Abraham Elmahrek <abe@apache.org>
Authored: Wed Jul 29 18:43:37 2015 -0700
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Wed Jul 29 18:43:37 2015 -0700

----------------------------------------------------------------------
 dev-support/test-patch.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/51fe7a9b/dev-support/test-patch.py
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.py b/dev-support/test-patch.py
index 16d7a1e..4bd5a7d 100755
--- a/dev-support/test-patch.py
+++ b/dev-support/test-patch.py
@@ -104,7 +104,7 @@ def jira_color(level):
   elif level == ResultItem.FATAL:
     return "{color:red}ERROR:{color}"
   elif level == ResultItem.WARNING:
-    return "{color:yellow}WARNING:{color}"
+    return "{color:orange}WARNING:{color}"
   else:
     return level
 
@@ -363,7 +363,9 @@ def cobertura_compare(result, output_dir, compare_url):
 
     report.write("Package %s: Line coverage %d (%d -> %d), Branch coverage %d (%d ->
%d)\n" % (package, diffLine, compareLine, localLine, diffBranch, compareBranch, localBranch))
 
-    if diffLine < 0 or diffBranch < 0:
+    # Cobertura's percentage calculation doesn't seem to be deterministic - it can do +/-
1% even without change a single line. The goal here is to highlight
+    # significant troubles when the coverage is diminished substantially, so we're simply
workarounding that by ignoring 1% of difference.
+    if diffLine < -1 or diffBranch < -1:
       lowers.append("Package {{%s}} has lower test coverage: Line coverage decreased by %d%%
(from %d%% to %d%%), Branch coverage decreased by %d%% (from %d%% to %d%%)" % (package, abs(diffLine),
compareLine, localLine, abs(diffBranch), compareBranch, localBranch))
 
   # Add to the JIRA summary report


Mime
View raw message