[Bps-public-commit] smokingit branch, full-tap, created. 15b45cef288b2dcc8be8670ba98361a0fbbd7c48

Alex Vandiver alexmv at bestpractical.com
Fri Jun 28 16:51:53 EDT 2013


The branch, full-tap has been created
        at  15b45cef288b2dcc8be8670ba98361a0fbbd7c48 (commit)

- Log -----------------------------------------------------------------
commit 9c4a9ecf5bdbe22571e9ac9945e420d994665d80
Merge: 6d304c7 bde0a2d
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Jun 21 11:03:21 2013 -0700

    Merge branch 'anna'
    
    Conflicts:
    	Makefile.PL

diff --cc Makefile.PL
index e770618,525b8db..6a33586
--- a/Makefile.PL
+++ b/Makefile.PL
@@@ -4,6 -4,10 +4,11 @@@ name        'Smokingit'
  version     '0.01';
  requires    'Jifty' => '1.01209';
  requires    'Git::PurePerl';
 +requires    'Plack::Middleware::CrossOrigin';
+ requires    'IM::Engine';
+ requires    'String::IRC';
+ 
+ # requires IM::Engine from git://github.com/sartak/IM-Engine.git
+ # requires Web::Hippie from git://github.com/alexmv/Web-Hippie.git
  
  WriteAll;

commit 8a4deea413715bc09f5848aaac1d570816f9c5c3
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Jun 21 11:47:03 2013 -0700

    Switch to clients sending raw TAP, not the parsed data from the aggregator

diff --git a/etc/config.yml b/etc/config.yml
index 1b9d03a..5716b09 100644
--- a/etc/config.yml
+++ b/etc/config.yml
@@ -11,7 +11,7 @@ framework:
     Host: localhost
     Password: ''
     User: postgres
-    Version: 0.0.7
+    Version: 0.0.8
   DevelMode: 1
   LogLevel: INFO
   Mailer: Sendmail
diff --git a/lib/Smokingit/Model/SmokeFileResult.pm b/lib/Smokingit/Model/SmokeFileResult.pm
new file mode 100644
index 0000000..311015f
--- /dev/null
+++ b/lib/Smokingit/Model/SmokeFileResult.pm
@@ -0,0 +1,35 @@
+use strict;
+use warnings;
+
+package Smokingit::Model::SmokeFileResult;
+use Jifty::DBI::Schema;
+use Smokingit::Status;
+
+use Smokingit::Record schema {
+    column smoke_result_id =>
+        is mandatory,
+        references Smokingit::Model::SmokeResult,
+        is indexed;
+
+    column filename  => type is 'text';
+    column elapsed   => type is 'float';
+    column is_ok     => is boolean;
+    column raw_tap   => type is 'text';
+    column tests_run => type is 'integer';
+};
+
+sub since { '0.0.8' }
+
+sub is_protected {1}
+
+sub current_user_can {
+    my $self  = shift;
+    my $right = shift;
+    my %args  = (@_);
+
+    return 1 if $right eq 'read';
+
+    return $self->SUPER::current_user_can($right => %args);
+}
+
+1;
diff --git a/lib/Smokingit/Model/SmokeResult.pm b/lib/Smokingit/Model/SmokeResult.pm
index 273c301..f45d595 100644
--- a/lib/Smokingit/Model/SmokeResult.pm
+++ b/lib/Smokingit/Model/SmokeResult.pm
@@ -47,7 +47,8 @@ use Smokingit::Record schema {
 
     column aggregator =>
         type is 'blob',
-        filters are 'Jifty::DBI::Filter::Storable';
+        filters are 'Jifty::DBI::Filter::Storable',
+        till '0.0.8';
 
     column is_ok        => is boolean;
 
@@ -58,11 +59,13 @@ use Smokingit::Record schema {
     column skipped      => type is 'integer';
     column todo         => type is 'integer';
     column todo_passed  => type is 'integer';
+    column total        => type is 'integer',
+        since '0.0.8';
 
     column wait         => type is 'integer';
     column exit         => type is 'integer';
 
-    column elapsed      => type is 'integer';
+    column elapsed      => type is 'float';
 };
 sub is_protected {1}
 
@@ -138,31 +141,10 @@ sub post_result {
     my ($arg) = @_;
 
     my %result = %{ $arg };
+    delete $result{start};
+    delete $result{end};
 
-    # Properties to extract from the aggregator
-    my @props =
-        qw/failed
-           parse_errors
-           passed
-           planned
-           skipped
-           todo
-           todo_passed
-           wait
-           exit/;
-
-    # Aggregator might not exist if we had a configure failure
-    require TAP::Parser::Aggregator;
-    my $a = $result{aggregator};
-    if ($a) {
-        $result{$_} = $a->$_ for @props;
-        $result{is_ok}      = not($a->has_problems);
-        $result{elapsed}    = $a->elapsed->[0];
-        $result{error}      = undef;
-    } else {
-        # Unset the existing data if there was a fail
-        $result{$_} = undef for @props, "is_ok", "elapsed";
-    }
+    my %tests = %{ delete $result{test} };
 
     my $status = Smokingit::Status->new( $self );
 
@@ -188,6 +170,29 @@ sub post_result {
     # Mark as no longer smoking
     $self->set_queue_status(undef);
 
+    # Delete all previous test file results
+    my $testfiles = Smokingit::Model::SmokeFileResultCollection->new(
+        current_user => Smokingit::CurrentUser->superuser,
+    );
+    $testfiles->limit( column => "smoke_result_id", value => $self->id );
+    while (my $fileresult = $testfiles->next) {
+        $fileresult->delete;
+    }
+
+    # Create rows for all test files
+    for my $filename (sort keys %tests) {
+        my $fileresult = Smokingit::Model::SmokeFileResult->new(
+            current_user => Smokingit::CurrentUser->superuser,
+        );
+        my ($ok, $msg) = $fileresult->create(
+            %{$tests{$filename}},
+            filename => $filename,
+            smoke_result_id => $self->id,
+        );
+        warn "Failed to create entry for $filename: $msg"
+            unless $ok;
+    }
+
     # And commit all of that
     Jifty->handle->commit;
 
diff --git a/lib/Smokingit/Upgrade.pm b/lib/Smokingit/Upgrade.pm
index d923537..a0bd941 100644
--- a/lib/Smokingit/Upgrade.pm
+++ b/lib/Smokingit/Upgrade.pm
@@ -34,4 +34,9 @@ since '0.0.4' => sub {
     }
 };
 
+# Time elapsed became a float
+since '0.0.8' => sub {
+    Jifty->handle->simple_query("ALTER TABLE smoke_results ALTER COLUMN elapsed TYPE float");
+};
+
 1;
diff --git a/lib/Smokingit/View/Commit.pm b/lib/Smokingit/View/Commit.pm
index 2ab3c23..cf09412 100644
--- a/lib/Smokingit/View/Commit.pm
+++ b/lib/Smokingit/View/Commit.pm
@@ -20,11 +20,6 @@ template '/smoke' => page {
         return;
     }
 
-    my $a = $s->aggregator;
-    pre {
-        YAML::Dump($a);
-    };
-
 };
 
 1;

commit a0d4db290bb11e463443b4f0a47109537fb4b621
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Jun 28 16:50:33 2013 -0400

    Link test results from commit pages

diff --git a/lib/Smokingit/View/Commit.pm b/lib/Smokingit/View/Commit.pm
index cf09412..8aba98f 100644
--- a/lib/Smokingit/View/Commit.pm
+++ b/lib/Smokingit/View/Commit.pm
@@ -7,6 +7,24 @@ use Jifty::View::Declare -base;
 template '/commit' => page {
     redirect '/' unless get('commit');
     page_title is get('commit')->short_sha;
+
+    my $commit = get('commit');
+
+    ul {
+        my $configs = $b->project->configurations;
+        while (my $config = $configs->next) {
+            li {
+                my $smoke = Smokingit::Model::SmokeResult->new;
+                $smoke->load_by_cols(
+                    project_id       => $commit->project->id,
+                    configuration_id => $config->id,
+                    commit_id        => $commit->id,
+                );
+                next unless $smoke->id;
+                Smokingit::View::test_result( $smoke );
+            }
+        }
+    }
 };
 
 template '/smoke' => page {

commit 15b45cef288b2dcc8be8670ba98361a0fbbd7c48
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Jun 28 16:51:42 2013 -0400

    Bare-bones passing/failing test list for smoke results

diff --git a/lib/Smokingit/View/Commit.pm b/lib/Smokingit/View/Commit.pm
index 8aba98f..28589ee 100644
--- a/lib/Smokingit/View/Commit.pm
+++ b/lib/Smokingit/View/Commit.pm
@@ -38,6 +38,20 @@ template '/smoke' => page {
         return;
     }
 
+    my $results = Smokingit::Model::SmokeFileResultCollection->new;
+    $results->limit( column => "smoke_result_id", value => $s->id );
+    $results->order_by( column => "filename" );
+    $results->columns( "filename", "is_ok", "elapsed" );
+    while (my $result = $results->next) {
+        div {
+            class is ($result->is_ok ? "passingfile" : "failingfile");
+            outs $result->filename;
+            span {
+                class is "elapsed";
+                outs sprintf "(%.2fs)", $result->elapsed;
+            };
+        };
+    }
 };
 
 1;
diff --git a/share/web/static/css/app-late.css b/share/web/static/css/app-late.css
index f5e2456..6dd7fe9 100644
--- a/share/web/static/css/app-late.css
+++ b/share/web/static/css/app-late.css
@@ -1,3 +1,5 @@
+ at import "testresults.css";
+
 html {
   padding: .75em;
   background: #223;
@@ -352,15 +354,6 @@ li {
 }
 
 
-/* Commit pages */
-.failingtest .header {
-  border-bottom: 5px dotted #f11;
-}
-.passingtest .header {
-  border-bottom: 5px dotted #1c1;
-}
-
-
 /* Footer and escaping smoke in the corner */
 #footer {
   position: absolute;
diff --git a/share/web/static/css/testresults.css b/share/web/static/css/testresults.css
new file mode 100644
index 0000000..869ec51
--- /dev/null
+++ b/share/web/static/css/testresults.css
@@ -0,0 +1,24 @@
+/* Commit pages */
+.failingtest .header {
+    border-bottom: 5px dotted #f11;
+}
+.passingtest .header {
+    border-bottom: 5px dotted #1c1;
+}
+
+.passingfile, .failingfile {
+    margin-right: auto;
+    margin-left: auto;
+}
+
+.passingfile {
+    border: 1px solid #cfc;
+    border-collapse: collapse;
+    padding: 0.1em 1em;
+    background-color: #beb;
+}
+
+.elapsed {
+    position: absolute;
+    right: 2em;
+}
\ No newline at end of file

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list