From 6d2835f444a59a09a85866af6c9ed3f10c0e0a9b Mon Sep 17 00:00:00 2001 From: franck cuny Date: Sun, 3 Oct 2010 11:40:37 +0200 Subject: update config, view, tests --- config.yml | 12 +++++++++- public/css/style.css | 2 +- t/003_hook_route.t | 59 +++++++++++++++++++++++++------------------------- t/data/test.yaml | 3 ++- views/project/index.tt | 28 ++++++++++++++---------- 5 files changed, 60 insertions(+), 44 deletions(-) diff --git a/config.yml b/config.yml index 75ce73a..de542de 100644 --- a/config.yml +++ b/config.yml @@ -18,4 +18,14 @@ jitterbug: dir: /tmp/build build_process: builder: ./scripts/capsule.sh - on_failure: ./scripts/on_failure.sh + on_failure: ./scripts/build-failed.sh + +plugins: + DBIC: + schema: + skip_automake: 1 + pckg: "jitterbug::Schema" + connect_info: + - dbi:SQLite:dbname=jitterbug.db + + diff --git a/public/css/style.css b/public/css/style.css index 038fa80..2e546be 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -224,7 +224,7 @@ float: right; } .git { -width:18em;padding:.8em 0 .8em 1.2em;border-left:1px solid #bedce7;color:#808080;;font-size:.85em;line-height:1.5em; +width:23em;padding:.8em 0 .8em 1.2em;border-left:1px solid #bedce7;color:#808080;;font-size:.85em;line-height:1.5em; } .message { diff --git a/t/003_hook_route.t b/t/003_hook_route.t index 9929553..b9d7e1f 100644 --- a/t/003_hook_route.t +++ b/t/003_hook_route.t @@ -1,43 +1,44 @@ -use Test::More tests => 1; +use Test::More tests => 4; use strict; use warnings; -ok 1; -#use jitterbug; -#use JSON; -#use YAML qw/LoadFile/; -#use Dancer::Test; -#use Dancer::Config qw/setting/; +#ok 1; +use jitterbug; +use JSON; +use YAML qw/LoadFile/; +use Dancer::Test; +use Dancer::Config qw/setting/; -#my $content = LoadFile('t/data/test.yaml'); +my $content = LoadFile('t/data/test.yaml'); -#setting jitterbug => { namespace => 'jitterbug_test' }; +setting jitterbug => { namespace => 'jitterbug_test' }; -#route_exists [ POST => '/hook/' ], 'a route handle is defined for /'; +route_exists [ POST => '/hook/' ], 'a route handle is defined for /'; -#my $response; +my $response; -#{ - #$response = dancer_response( POST => '/hook', ); - #is $response->{status}, 200, '200 with empty post'; -#} +{ + $response = dancer_response( POST => '/hook', ); + is $response->{status}, 200, '200 with empty post'; +} -#{ - #my $payload = "payload=" . JSON::encode_json($content); +{ + my $payload = "payload=" . JSON::encode_json($content); #open my $in, '<', \$payload; #$ENV{'CONTENT_LENGTH'} = length($payload); #$ENV{'CONTENT_TYPE'} = 'application/x-www-form-urlencoded'; #$ENV{'psgi.input'} = $in; - #$response = dancer_response( - #POST => '/hook/', - #{ - #headers => [ 'Content-Length' => length($payload) ], - #body => $payload - #} - #); - - #is $response->{status}, 200; - #is_deeply JSON::decode_json( $response->{content} ), - #{ updated => 'Dancer' }; -#} + $response = dancer_response( + POST => '/hook/', + { + headers => + [ 'Content-Type' => 'application/x-www-form-urlencoded' ], + body => $payload + } + ); +#use YAML::Syck; warn Dump $response; + is $response->{status}, 200; + is_deeply JSON::decode_json( $response->{content} ), + { updated => 'Dancer' }; +} diff --git a/t/data/test.yaml b/t/data/test.yaml index 9636611..c8e1a63 100644 --- a/t/data/test.yaml +++ b/t/data/test.yaml @@ -8,7 +8,8 @@ commits: author: email: franck@lumberjaph.net name: franck cuny - id: 8c3c1d6be0fa27ada4f03258ddea7683c967a925 + #id: 8c3c1d6be0fa27ada4f03258ddea7683c967a925 + id: ba54d9b7d82eabe4ba35ec212eb24d00869119d5 message: test modified: - lib/Dancer.pm diff --git a/views/project/index.tt b/views/project/index.tt index 2749989..7f3ee1f 100644 --- a/views/project/index.tt +++ b/views/project/index.tt @@ -1,33 +1,37 @@
-

<: $project :> / build history

+

<: $project.name :> / build history

- "<: $description :>" + "<: $project.description :>" :for $days -> $day {

<: $day :>

- :for $builds[$day] -> $build { -
+ :for $commits[$day] -> $commit { +
-
<: $build.message :>
-
<: $build.author.name :>
-
<: $build.timestamp :>
+
<: $commit.message :>
+
<: $commit.author.name :>
+
- :for $build.version.keys() -> $version { - <: $version :> <: $build.version[$version] :> + :for $commit.build.version.keys() -> $version { + <: $version :> <: $commit.build.version[$version] :> :}
- commit  <: $build.commit :>
+ commit   <: $commit.id :>
+ commited <: $commit.timestamp :>
+ ref      <: $commit.ref :>
+ <: if $commit.build { :> + built in <: $commit.build.end_time - $commit.build.start_time :> seconds
+ <: } :>
- -
:}
-- cgit 1.4.1