[Bps-public-commit] r11558 - in SVN-PropDB: t
clkao at bestpractical.com
clkao at bestpractical.com
Sat Apr 5 20:09:14 EDT 2008
Author: clkao
Date: Sat Apr 5 20:08:54 2008
New Revision: 11558
Modified:
SVN-PropDB/lib/Prophet/Replica.pm
SVN-PropDB/t/sd-hm.t
Log:
make test run and more tests.
Modified: SVN-PropDB/lib/Prophet/Replica.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Replica.pm (original)
+++ SVN-PropDB/lib/Prophet/Replica.pm Sat Apr 5 20:08:54 2008
@@ -51,7 +51,7 @@
# XXX TODO HACK NEED A PROPER WAY TO DETERMINE SYNC SOURCE
if ( $args->{url} =~ /^rt:/ ) {
$class = 'Prophet::Replica::RT';
- } elsif ($args->{url} =~ /^hiveminder:/ ) {
+ } elsif ($args->{url} =~ /^hm:/ ) {
$class = 'Prophet::Replica::Hiveminder';
} else {
$class = 'Prophet::Replica::SVN';
Modified: SVN-PropDB/t/sd-hm.t
==============================================================================
--- SVN-PropDB/t/sd-hm.t (original)
+++ SVN-PropDB/t/sd-hm.t Sat Apr 5 20:08:54 2008
@@ -11,6 +11,8 @@
my $server = BTDT::Test->make_server;
my $URL = $server->started_ok;
+$URL =~ s|http://|http://gooduser\@example.com:secret@|;
+
ok(1, "Loaded the test script");
my $GOODUSER = BTDT::CurrentUser->new( email => 'gooduser at example.com' );
@@ -23,10 +25,48 @@
diag $task->id;
my ($ret, $out, $err);
-my $sd_rt_url = "hiveminder:$URL";
+my $sd_rt_url = "hm:$URL";
($ret, $out, $err) = run_script('sd', ['pull', $sd_rt_url]);
diag $err;
my ($yatta_uuid, $flyman_uuid);
run_output_matches('sd', ['ticket', '--list', '--regex', '.'], [qr/(.*?)(?{ $flyman_uuid = $1 }) Fly Man (.*)/]);
+
+$task->set_summary( 'Crash Man' );
+
+($ret, $out, $err) = run_script('sd', ['pull', $sd_rt_url]);
+
+run_output_matches('sd', ['ticket', '--list', '--regex', '.'], ["$flyman_uuid Crash Man (.*)"]);
+
+run_output_matches('sd', ['ticket', '--create', '--summary', 'YATTA', '--status', 'new'], [qr/Created ticket (.*)(?{ $yatta_uuid = $1 })/]);
+
+diag $yatta_uuid;
+
+run_output_matches('sd', ['ticket', '--list', '--regex', '.'],
+ [ sort
+ "$yatta_uuid YATTA new",
+ "$flyman_uuid Crash Man (no status)", # XXX: or whatever status captured previously
+ ]);
+
+($ret, $out, $err) = run_script('sd', ['push', $sd_rt_url]);
+diag $err;
+ok( $task->load_by_cols( summary => 'YATTA' ) );
+
+($ret, $out, $err) = run_script('sd', ['pull', $sd_rt_url]);
+
+run_output_matches('sd', ['ticket', '--list', '--regex', '.'],
+ [ sort
+ "$yatta_uuid YATTA new",
+ "$flyman_uuid Fly Man (no status)",
+ ]);
+
+$task->set_summary( 'KILL' );
+
+($ret, $out, $err) = run_script('sd', ['pull', $sd_rt_url]);
+
+run_output_matches('sd', ['ticket', '--list', '--regex', '.'],
+ [ sort
+ "$yatta_uuid KILL new",
+ "$flyman_uuid Fly Man (no status)",
+ ]);
More information about the Bps-public-commit
mailing list