[Pkg-haskell-commits] [package-plan] 01/01: test-packages.pl: Write out stats.csv (for Jenkins)

Joachim Breitner nomeata at moszumanska.debian.org
Fri Apr 18 15:27:43 UTC 2014


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

nomeata pushed a commit to branch master
in repository package-plan.

commit 4b3338e9b78fee87537c7b251030eea44fa2e795
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Fri Apr 18 17:27:03 2014 +0200

    test-packages.pl: Write out stats.csv (for Jenkins)
---
 test-packages.pl | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/test-packages.pl b/test-packages.pl
index b8b79ac..51ee0e8 100755
--- a/test-packages.pl
+++ b/test-packages.pl
@@ -24,6 +24,7 @@ my @flags;
 
 my $allow_upgrade = 0;
 my $error_count = 0;
+my %stats;
 
 GetOptions (
 	"allow-upgrade" => \$allow_upgrade,
@@ -90,24 +91,30 @@ for my $pkg (sort keys %packages) {
 	if ($obsolete{$pkg} && $available{$pkg}) {
 		printf "Obsolete: %s %s\n" ,
 			$pkg, $available{$pkg};
+		$stats{obsolete}++;
 	} elsif ($obsolete{$pkg} && !$available{$pkg}) {
 		printf "REMOVED:  %s %s\n" ,
 			$pkg, $available{$pkg};
 		$error_count++;
+		$stats{REMOVED}++;
 	} elsif (! exists($versions{$pkg})) {
 		printf "MISSING:  %s %s\n" ,
 			$pkg, $available{$pkg};
 		$error_count++;
+		$stats{MISSING}++;
 	} elsif (! exists($available{$pkg})) {
 		printf "Added:    %s is %s here but does not exist in the archive.\n" ,
 			$pkg, $versions{$pkg};
+		$stats{Added}++;
 	} elsif ( version_compare($versions{$pkg}, $available{$pkg}) == -1 ) {
 		printf "OLD:      %s is %s here but %s exists in the archive.\n" ,
 			$pkg, $versions{$pkg}, $available{$pkg};
 		$error_count++;
+		$stats{OLD}++;
 	} elsif ( version_compare($versions{$pkg}, $available{$pkg}) == 1 ) {
 		printf "Updated:  %s is %s in the archive but %s exists here.\n" ,
 			$pkg, $available{$pkg}, $versions{$pkg};
+		$stats{Updated}++;
  	}
 }
 
@@ -189,6 +196,7 @@ __END__
 			}
 		};
 		$tarfile->replace_content($content) or die;
+		$stats{patched}++;
 	}
 	print "Writing 00-list.tar...\n";
 	$tar->write($tarpath);
@@ -245,6 +253,7 @@ if (run \@params, \"", \$out, \$err) {
 		unless (exists $versions{$pkg}) {
 			printf "ERROR: Additional dependency pulled in: %s-%s\n", $pkg, $version;
 			$error_count++;
+			$stats{MISSING_DEP}++;
 			next
 		}
 		unless ($versions{$pkg} eq $version) {
@@ -259,6 +268,7 @@ if (run \@params, \"", \$out, \$err) {
 		$count++;
 	}
 	printf "%s packages successfully tested for co-installability.\n", $count;
+	$stats{total} = $count;
 	unless ($count) {
 		printf "Really no packages? output was:\n$out";
 	}
@@ -267,6 +277,15 @@ if (run \@params, \"", \$out, \$err) {
 	$error_count++;
 	print $err;
 }
+
+open STATS, ">", "stats.csv" or die $!;
+print STATS (join ",",sort keys %stats), "\n";
+print STATS (join ",",map {$stats{$_}} sort keys %stats), "\n";
+close STATS;
+
+for my $key (sort keys %stats) {
+}
+
 if ($error_count) {
 	printf "%d error(s) in total.\n", $error_count;
 	exit 1;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/package-plan.git



More information about the Pkg-haskell-commits mailing list