[Bps-public-commit] r11579 - in SVN-PropDB: lib/Prophet t
clkao at bestpractical.com
clkao at bestpractical.com
Sun Apr 6 00:25:30 EDT 2008
Author: clkao
Date: Sun Apr 6 00:25:28 2008
New Revision: 11579
Modified:
SVN-PropDB/lib/Prophet/Replica.pm
SVN-PropDB/lib/Prophet/Replica/Hiveminder.pm
SVN-PropDB/lib/Prophet/Replica/SVN.pm
SVN-PropDB/t/sd-rt-hm.t
Log:
- more tests.
- avoid prophet_handle call from prophet::replica.
Modified: SVN-PropDB/lib/Prophet/Replica.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Replica.pm (original)
+++ SVN-PropDB/lib/Prophet/Replica.pm Sun Apr 6 00:25:28 2008
@@ -338,7 +338,7 @@
# XXX: encapsulation
$changeset->{changes} = [
grep { $self->is_resdb || $_->node_type ne '_prophet_resolution' } grep {
- !( $_->node_type eq $Prophet::Handle::MERGETICKET_METATYPE && $_->node_uuid eq $self->prophet_handle->uuid )
+ !( $_->node_type eq $Prophet::Handle::MERGETICKET_METATYPE && $_->node_uuid eq $self->uuid )
} $changeset->changes
];
}
Modified: SVN-PropDB/lib/Prophet/Replica/Hiveminder.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Replica/Hiveminder.pm (original)
+++ SVN-PropDB/lib/Prophet/Replica/Hiveminder.pm Sun Apr 6 00:25:28 2008
@@ -182,6 +182,14 @@
}
+sub integrate_comment {
+ warn "comment not yet";
+}
+
+sub integrate_ticket_update {
+ warn "update not yet";
+}
+
sub _recode_props_for_integrate {
my $self = shift;
my ($change) = validate_pos( @_, { isa => 'Prophet::Change' } );
Modified: SVN-PropDB/lib/Prophet/Replica/SVN.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Replica/SVN.pm (original)
+++ SVN-PropDB/lib/Prophet/Replica/SVN.pm Sun Apr 6 00:25:28 2008
@@ -63,7 +63,7 @@
sub uuid {
my $self = shift;
- return $self->ra->get_uuid;
+ return $self->prophet_handle->repo_handle->fs->get_uuid;
}
=head2 fetch_changesets { after => SEQUENCE_NO }
Modified: SVN-PropDB/t/sd-rt-hm.t
==============================================================================
--- SVN-PropDB/t/sd-rt-hm.t (original)
+++ SVN-PropDB/t/sd-rt-hm.t Sun Apr 6 00:25:28 2008
@@ -6,9 +6,10 @@
use strict;
use Test::More;
+BEGIN {
eval 'use RT::Test; 1'
or plan skip_all => 'requires 3.7 to run tests.'.$@;
-
+}
BEGIN {
unless ($ENV{'JIFTY_APP_ROOT'}) {
die "You must define a JIFTY_APP_ROOT environment variable which points to your hiveminder source tree";
@@ -35,7 +36,7 @@
ok(1, "Loaded the test script");
# setup for rt
-use Prophet::Test tests => 7;
+use Prophet::Test tests => 10;
my ($url, $m) = RT::Test->started_ok;
diag $url;
@@ -78,7 +79,7 @@
local $ENV{SVB_REPO} = $ENV{'PROPHET_REPO'};
($ret, $out, $err) = run_script('sd', ['pull', $sd_hm_url]);
warn $err;
- run_output_matches('sd', ['ticket', '--list', '--regex', '.'], [qr/(.*?)(?{ $flyman_uuid = $1 }) YATTA .*/]);
+ run_output_matches('sd', ['ticket', '--list', '--regex', '.'], [qr/(.*?)(?{ $yatta_uuid = $1 }) YATTA .*/]);
};
as_bob {
@@ -90,12 +91,31 @@
($ret, $out, $err) = run_script('sd', ['pull', repo_uri_for('alice')]);
- ($ret, $out, $err) = run_script('sd', ['ticket', '--list', '--regex', '.']);
- warn $out;
- warn $err;
+ run_output_matches('sd', ['ticket', '--list', '--regex', '.'],
+ [ sort
+ "$yatta_uuid YATTA (no status)",
+ "$flyman_uuid Fly Man new",
+ ]);
+ ($ret, $out, $err) = run_script('sd', ['push', $sd_rt_url]);
+ warn $out;
+ # XXX: to check YATTA ticket created in RT.
};
+as_alice {
+ local $ENV{SVB_REPO} = $ENV{'PROPHET_REPO'};
+ ($ret, $out, $err) = run_script('sd', ['pull', repo_uri_for('bob')]);
+ run_output_matches('sd', ['ticket', '--list', '--regex', '.'],
+ [ sort
+ "$yatta_uuid YATTA (no status)",
+ "$flyman_uuid Fly Man new",
+ ]);
+
+ ($ret, $out, $err) = run_script('sd', ['push', $sd_rt_url]);
+
+ ok( $task->load_by_cols( summary => 'Fly Man' ) );
+
+}
__END__
More information about the Bps-public-commit
mailing list