Skip to content
Browse files

Add badges for smoketesting results

  • Loading branch information...
1 parent 6f3320d commit e511f1e4ee5f5c9de777625663f99b8929092994 @tadzik tadzik committed May 1, 2012
Showing with 19 additions and 4 deletions.
  1. +13 −3 web/build-project-list.pl
  2. BIN web/good.png
  3. +6 −1 web/index.tmpl
  4. BIN web/nope.png
View
16 web/build-project-list.pl
@@ -37,7 +37,7 @@ sub getstore {
}
my $output_dir = shift(@ARGV) || './';
-my @MEDALS = qw<fresh medal readme tests unachieved proto camelia panda>;
+my @MEDALS = qw<fresh medal readme tests unachieved proto camelia panda good nope>;
binmode STDOUT, ':encoding(UTF-8)';
local $| = 1;
@@ -62,7 +62,9 @@ sub getstore {
if ( $previous && $previous->{last_updated} eq $latest->{committed_date} ) {
$previous->{badge_is_fresh} = $project->{badge_is_fresh} ; #Even if the project was not modified we need to update this
- $previous->{badge_panda} = $project->{badge_panda};
+ $previous->{badge_prereq_ok} = $project->{badge_prereq_ok};
+ $previous->{badge_builds_ok} = $project->{badge_builds_ok};
+ $previous->{badge_tests_ok} = $project->{badge_tests_ok};
%$project = %$previous;
print "Not updated since last check, loading from cache\n";
sleep(1); #We only did one api call
@@ -148,6 +150,9 @@ sub get_projects {
my ($list_url) = @_;
my $projects;
my $contents = eval { read_file('META.list.local') } || get($list_url);
+
+ my $test_results = json_get 'http://tjs.azalayah.net/results.json';
+
for my $proj (split "\n", $contents) {
print "$proj\n";
eval {
@@ -160,7 +165,12 @@ sub get_projects {
$projects->{$name}->{'auth'} = $auth;
$projects->{$name}->{'repo_name'} = $repo_name;
$projects->{$name}->{'url'} = $url;
- $projects->{$name}->{'badge_panda'} = defined $json->{'source-url'};
+
+ my $smoke = $test_results->{$name};
+
+ $projects->{$name}->{'prereq_ok'} = !!$smoke->{'prereq'};
+ $projects->{$name}->{'builds_ok'} = !!$smoke->{'build'};
+ $projects->{$name}->{'tests_ok'} = !!$smoke->{'test'};
$projects->{$name}->{'description'} = $json->{'description'};
};
warn $@ if $@;
View
BIN web/good.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
7 web/index.tmpl
@@ -110,7 +110,12 @@ dl.table-display {
<TMPL_IF badge_has_readme><a href="<TMPL_VAR badge_has_readme>"><img src='readme.png' title='Has a README' alt="Readme badge" /></a><TMPL_ELSE><img src='unachieved.png' title="Doesn't have a README" alt="Unachieved badge" /></TMPL_IF>
<TMPL_IF badge_has_tests><img src='tests.png' title='Has tests' alt="Tests badge" /><TMPL_ELSE><img src='unachieved.png' title="Doesn't have tests" alt="Unachieved badge" /></TMPL_IF>
<TMPL_IF badge_is_fresh><img src='fresh.png' title='Commits in the past 90 days' alt="Fresh badge" /><TMPL_ELSE><img src='unachieved.png' title='No commits in the past 90 days' alt="Unachieved badge" /></TMPL_IF>
- <TMPL_IF badge_panda><img src='panda.png' title='Conforms to the latest Perl 6 modules specs' alt="Panda badge" /><TMPL_ELSE><img src='unachieved.png' title='Not quite up-to-date with the specs' alt="Unachieved badge" /></TMPL_IF>
+ <TMPL_IF prereq_ok><img src='good.png' title='All the prerequisites are fine' alt="Prerequisites ok" />
+ <TMPL_ELSE><img src='nope.png' title='Not everything is fine with the prerequisites' alt="Prerequisites not ok" /></TMPL_IF>
+ <TMPL_IF builds_ok><img src='good.png' title='The module builds fine' alt="Build ok" />
+ <TMPL_ELSE><img src='nope.png' title='The module does not build fine' alt="Build not ok" /></TMPL_IF>
+ <TMPL_IF tests_ok><img src='good.png' title='All tests run fine' alt="Tests ok" />
+ <TMPL_ELSE><img src='nope.png' title='Not all tests run fine' alt="Tests not ok" /></TMPL_IF>
</div>
<TMPL_VAR description></dd>
</TMPL_IF>
View
BIN web/nope.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e511f1e

Please sign in to comment.
Something went wrong with that request. Please try again.