[Bps-public-commit] r11517 - in SVN-PropDB: t
clkao at bestpractical.com
clkao at bestpractical.com
Fri Apr 4 21:15:50 EDT 2008
Author: clkao
Date: Fri Apr 4 21:15:49 2008
New Revision: 11517
Modified:
SVN-PropDB/lib/Prophet/Sync/Source/RT.pm
SVN-PropDB/t/sd-rt.t
Log:
fix test & cache key.
Modified: SVN-PropDB/lib/Prophet/Sync/Source/RT.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Sync/Source/RT.pm (original)
+++ SVN-PropDB/lib/Prophet/Sync/Source/RT.pm Fri Apr 4 21:15:49 2008
@@ -93,11 +93,8 @@
sub prophet_has_seen_transaction {
my $self = shift;
my ($id) = validate_pos(@_, 1 );
- my $cache = App::Cache->new( { ttl => 60 * 60 } );
- return $cache->get(
- $self->uuid,
- '-txn-' . $id)
-
+
+ return $cache->get( $self->uuid. '-txn-' . $id);
}
sub record_pushed_transaction {
@@ -106,11 +103,10 @@
my $cache = App::Cache->new( { ttl => 60 * 60 } ); # la la la
# warn "storing changeset metadata ".$self->uuid. " $uuid $seq / for ".join(',',@$txn_ids);
- # warn "===> ? ".$self->uuid,'-txn-....';
+ # warn "===> ? ".$self->uuid.' -txn-....'.$args{transaction};
$cache->set(
- $self->uuid,
- '-txn-' . $args{transaction},
+ $self->uuid. '-txn-' . $args{transaction},
join( ':', $args{changeset}->original_source_uuid, $args{changeset}->original_sequence_no )
);
}
@@ -143,7 +139,7 @@
# XXX: extract the original txn id from $changeset
# warn "===> ? ".$self->uuid,'-txn-'.$txn_id;
- my $ret = $cache->get( $self->uuid, '-txn-' . $txn_id );
+ my $ret = $cache->get( $self->uuid. '-txn-' . $txn_id );
# warn "==> $ret";
return $ret;
}
@@ -375,9 +371,9 @@
my $ticket = shift;
my @txns;
for my $txn ( $self->rt->get_transaction_ids( parent_id => $ticket ) ) {
-
+
next if $self->prophet_has_seen_transaction($txn);
-
+
push @txns, $self->rt->get_transaction( parent_id => $ticket, id => $txn, type => 'ticket' );
}
return \@txns;
Modified: SVN-PropDB/t/sd-rt.t
==============================================================================
--- SVN-PropDB/t/sd-rt.t (original)
+++ SVN-PropDB/t/sd-rt.t Fri Apr 4 21:15:49 2008
@@ -43,7 +43,7 @@
diag $ticket->id;
my ($ret, $out, $err);
($ret, $out, $err) = run_script('sd', ['pull', $sd_rt_url]);
-
+warn $err;
my ($yatta_uuid, $flyman_uuid);
run_output_matches('sd', ['ticket', '--list', '--regex', '.'], [qr/(.*?)(?{ $flyman_uuid = $1 }) Fly Man new/]);
@@ -71,17 +71,16 @@
]);
($ret, $out, $err) = run_script('sd', ['push', $sd_rt_url]);
-
+diag $err;
my @tix = $rt->search(
type => 'ticket',
query => "Subject='YATTA'"
);
-diag @tix;
+
ok(scalar @tix, 'YATTA pushed');
($ret, $out, $err) = run_script('sd', ['pull', $sd_rt_url]);
-
run_output_matches('sd', ['ticket', '--list', '--regex', '.'],
[ sort
"$yatta_uuid YATTA new",
@@ -98,7 +97,7 @@
run_output_matches('sd', ['ticket', '--list', '--regex', '.'],
[ sort
- "$yatta_uuid YATTA open",
+ "$yatta_uuid YATTA new",
"$flyman_uuid Fly Man stalled",
]);
@@ -108,8 +107,9 @@
status => 'open',
)->store();
+warn "===> bad pull";
($ret, $out, $err) = run_script('sd', ['pull', $sd_rt_url]);
-
+diag $err;
run_output_matches('sd', ['ticket', '--list', '--regex', '.'],
[ sort
"$yatta_uuid YATTA open",
More information about the Bps-public-commit
mailing list