Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add some nice tests results from emmentaler (needs results.json)

  • Loading branch information...
commit 5ed32c085fc085e517c412bf7939cc321e9a62bd 1 parent 3e6bfc6
@tadzik tadzik authored
Showing with 35 additions and 2 deletions.
  1. +29 −2 web/build.p6
  2. +6 −0 web/index.mojo
View
31 web/build.p6
@@ -1,7 +1,6 @@
use v6;
use Template::Mojo;
use JSON::Tiny;
-use File::Path;
class Project {
has $.URL = die "Every project needs an URL";
@@ -12,6 +11,8 @@ class Project {
has $.logo;
has $.description;
+ has Pair $.test-results is rw; # colour => description
+
method has_tests() {
return True if "$.gitname/t".IO.e;
return False;
@@ -67,9 +68,35 @@ class Project {
}
}
+my %test-results = from-json(slurp("results.json"));
+
my $projects = slurp("modules.list").split("\n").map: {
- Project.new(URL => $_, gitname => ~$/[0]) if /\/\/.*?\/.*?\/(.*?)\.git/;
+ say $_;
+ my $p = Project.new(URL => $_, gitname => ~$/[0]) if /\/\/.*?\/.*?\/(.*?)\.git/;
+ next unless $p;
+ say $p.perl;
+ next unless $p.name;
+ next unless %test-results{$p.name};
+ $p.test-results = do given %test-results{$p.name} {
+ when .<prereq> == False {
+ red => 'Could not resolve dependencies'
+ }
+ when .<build> == False {
+ red => 'Did not build successfully'
+ }
+ when .<test> == False {
+ red => 'Some tests have failed'
+ }
+ when $p.has_tests == False {
+ yellow => 'Has no tests'
+ }
+ default {
+ green => 'Everything all right'
+ }
+ }
+ $p;
}
+
my $last_update = DateTime.now.Str;
my $tmpl = slurp "index.mojo";
View
6 web/index.mojo
@@ -127,6 +127,12 @@ dl.table-display {
% } else {
<img src='unachieved.png' title='No commits in the past 90 days' alt="Unachieved badge" />
% }
+% my $tests = $_.test-results;
+ <span
+ style="font-size:32px;color:<%= $tests.key %>">
+ <abbr title="<%= sprintf 'Test results for %s: %s',
+ $_.name, $tests.value %>">●</abbr>
+ </span>
</div>
<%= $_.description %></dd>
% } # if
Please sign in to comment.
Something went wrong with that request. Please try again.