[sagemath] 01/01: Add rules to print/count failures by their error or stack trace

Ximin Luo infinity0 at debian.org
Thu Nov 3 00:23:23 UTC 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository sagemath.

commit f66aaac755d75167795b8e9fe3ec35efd2abbbc6
Author: Ximin Luo <infinity0 at debian.org>
Date:   Thu Nov 3 01:22:33 2016 +0100

    Add rules to print/count failures by their error or stack trace
---
 debian/README.Debian |  8 ++++++++
 debian/rules         | 16 ++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/debian/README.Debian b/debian/README.Debian
index 8ee7d0a..e6f7fae 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -44,6 +44,14 @@ It will run all previously-failed tests again, which is useful if you're on a
 mass test-fixing spree and forget to count which ones you've fixed. However
 this assumes that you didn't break any of the previously successful ones :p
 
+ $ debian/rules failed-tests-by-count
+ $ debian/rules failed-tests-by-error
+ $ debian/rules failed-tests-by-cause
+
+These, and other related rules, will print you some nice stats about the test
+failures. This is useful if you have say, hundreds or thousands of failures to
+deal with and don't know where to begin.
+
 ## Current test status
 
 The below is invalid at the moment; we have ~4000 failing tests after migrating
diff --git a/debian/rules b/debian/rules
index 04fc44a..a1e9df8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -171,4 +171,20 @@ failed-tests-by-count:
 	  | sort '-t#' -k2n,2n \
 	  | sed -e 's,9999999,,g'
 
+failed-tests-by-error:
+# Filter out NameError; most of these are caused by earlier errors
+	grep 'Error:' sage/logs/ptestlong.log \
+	  | grep -v NameError \
+	  | sort | uniq -c | sort -k1n,1n
+
+FT_CAUSE_ERRORTYPE = Error
+FT_CAUSE_BACKTRACE = 2
+failed-tests-by-cause:
+	grep -B$$((2 * $(FT_CAUSE_BACKTRACE))) -Z '$(FT_CAUSE_ERRORTYPE):' sage/logs/ptestlong.log \
+	  | sed -e 's/^--$$/\x00/g' \
+	  | sed -z -e 's/^\s*//g' \
+	  | tr '\0\n' '\n\t' \
+	  | sort | uniq -c | sort -k1n,1n \
+	  | less -S +G
+
 .PHONY: gencontrol ptestlong clean-doc-build reset build-dep gencontrol

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagemath.git



More information about the debian-science-commits mailing list