[Bps-public-commit] r14179 - in Prophet/trunk: . t
sartak at bestpractical.com
sartak at bestpractical.com
Wed Jul 16 18:55:49 EDT 2008
Author: sartak
Date: Wed Jul 16 18:55:45 2008
New Revision: 14179
Modified:
Prophet/trunk/ (props changed)
Prophet/trunk/lib/Prophet/Test/Participant.pm
Prophet/trunk/t/export.t
Prophet/trunk/t/non-conflicting-merge.t
Prophet/trunk/t/real-conflicting-merge.t
Prophet/trunk/t/simple-conflicting-merge.t
Prophet/trunk/t/simple-push.t
Log:
r64451 at onn: sartak | 2008-07-16 18:30:19 -0400
use force in the tests because we're currently too lazy to properly clone databases ;)
Modified: Prophet/trunk/lib/Prophet/Test/Participant.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Test/Participant.pm (original)
+++ Prophet/trunk/lib/Prophet/Test/Participant.pm Wed Jul 16 18:55:45 2008
@@ -118,7 +118,7 @@
$self->record_action( 'sync_from_peer', $args );
@_ = (
- [ 'merge', '--prefer', 'to', '--from', repo_uri_for($from), '--to', repo_uri_for( $self->name ) ],
+ [ 'merge', '--prefer', 'to', '--from', repo_uri_for($from), '--to', repo_uri_for( $self->name ), '--force' ],
$self->name . " sync from " . $from . " ran ok!"
);
goto \&call_func_ok;
Modified: Prophet/trunk/t/export.t
==============================================================================
--- Prophet/trunk/t/export.t (original)
+++ Prophet/trunk/t/export.t Wed Jul 16 18:55:45 2008
@@ -25,7 +25,7 @@
diag repo_uri_for('bob');
diag repo_uri_for('alice');
- run_ok( 'prophet', [ 'merge', '--to', repo_uri_for('bob'), '--from', repo_uri_for('alice') ], "Sync ran ok!" );
+ run_ok( 'prophet', [ 'merge', '--to', repo_uri_for('bob'), '--from', repo_uri_for('alice'), '--force' ], "Sync ran ok!" );
# check our local replicas
my ( $ret, $out, $err ) = run_script( 'prophet', [qw(search --type Bug --regex .)] );
like( $out, qr/new/, "We have the one record from alice" );
Modified: Prophet/trunk/t/non-conflicting-merge.t
==============================================================================
--- Prophet/trunk/t/non-conflicting-merge.t (original)
+++ Prophet/trunk/t/non-conflicting-merge.t Wed Jul 16 18:55:45 2008
@@ -28,7 +28,7 @@
# sync from bob
diag('Alice syncs from bob');
- run_ok( 'prophet', [ 'merge', '--from', repo_uri_for('bob'), '--to', repo_uri_for('alice') ], "Sync ran ok!" );
+ run_ok( 'prophet', [ 'merge', '--from', repo_uri_for('bob'), '--to', repo_uri_for('alice'), '--force' ], "Sync ran ok!" );
# check our local replicas
my ( $ret, $out, $err ) = run_script( 'prophet', [qw(search --type Bug --regex .)] );
@@ -42,7 +42,7 @@
diag('Alice syncs from bob again. There will be no new changes from bob');
# sync from bob
- run_ok( 'prophet', [ 'merge', '--from', repo_uri_for('bob'), '--to', repo_uri_for('alice') ], "Sync ran ok!" );
+ run_ok( 'prophet', [ 'merge', '--from', repo_uri_for('bob'), '--to', repo_uri_for('alice'), '--force' ], "Sync ran ok!" );
# check our local replicas
( $ret, $out, $err ) = run_script( 'prophet', [qw(search --type Bug --regex .)] );
@@ -66,7 +66,7 @@
# sync from alice
- run_ok( 'prophet', [ 'merge', '--to', repo_uri_for('bob'), '--from', repo_uri_for('alice') ], "Sync ran ok!" );
+ run_ok( 'prophet', [ 'merge', '--to', repo_uri_for('bob'), '--from', repo_uri_for('alice'), '--force' ], "Sync ran ok!" );
# check our local replicas
( $ret, $out, $err ) = run_script( 'prophet', [qw(search --type Bug --regex .)] );
@@ -79,7 +79,7 @@
$last_rev = replica_last_rev();
diag('Sync from alice to bob again');
- run_ok( 'prophet', [ 'merge', '--to', repo_uri_for('bob'), '--from', repo_uri_for('alice') ], "Sync ran ok!" );
+ run_ok( 'prophet', [ 'merge', '--to', repo_uri_for('bob'), '--from', repo_uri_for('alice'), '--force' ], "Sync ran ok!" );
is_deeply( replica_merge_tickets(), { replica_uuid_for('alice') => as_alice { replica_last_rev() - 1 } } );
is( replica_last_rev(), $last_rev, "We have not recorded another transaction after a second sync" );
@@ -88,7 +88,7 @@
as_alice {
my $last_rev = replica_last_rev();
- run_ok( 'prophet', [ 'merge', '--to', repo_uri_for('alice'), '--from', repo_uri_for('bob') ], "Sync ran ok!" );
+ run_ok( 'prophet', [ 'merge', '--to', repo_uri_for('alice'), '--from', repo_uri_for('bob'), '--force' ], "Sync ran ok!" );
is( replica_last_rev(), $last_rev,
"We have not recorded another transaction after bob had fully synced from alice" );
Modified: Prophet/trunk/t/real-conflicting-merge.t
==============================================================================
--- Prophet/trunk/t/real-conflicting-merge.t (original)
+++ Prophet/trunk/t/real-conflicting-merge.t Wed Jul 16 18:55:45 2008
@@ -18,7 +18,7 @@
as_bob {
like(run_command(qw(create --type Dummy -- --ignore yes)), qr/Created Dummy/);
- like(run_command('merge', '--to', repo_uri_for('bob'), '--from', repo_uri_for('alice')), qr/Merge complete/, "Sync ran ok!");
+ like(run_command('merge', '--to', repo_uri_for('bob'), '--from', repo_uri_for('alice'), '--force'), qr/Merge complete/, "Sync ran ok!");
# check our local replicas
my $out = run_command(qw(search --type Bug --regex .));
@@ -67,7 +67,7 @@
my $conflict_obj;
throws_ok {
- $target->import_changesets( from => $source, );
+ $target->import_changesets( from => $source, force => 1);
}
qr/not resolved/;
@@ -75,6 +75,7 @@
$target->import_changesets(
from => $source,
resolver => sub { die "my way of death\n" },
+ force => 1,
);
}
qr/my way of death/, 'our resolver is actually called';
@@ -84,7 +85,8 @@
$target->import_changesets(
from => $source,
- resolver_class => 'Prophet::Resolver::AlwaysTarget'
+ resolver_class => 'Prophet::Resolver::AlwaysTarget',
+ force => 1,
);
},
3,
@@ -105,21 +107,22 @@
my $source = Prophet::Replica->new( { url => repo_uri_for('bob') } );
my $target = Prophet::Replica->new( { url => repo_uri_for('alice') } );
throws_ok {
- $target->import_changesets( from => $source, );
+ $target->import_changesets( from => $source, force => 1 );
}
qr/not resolved/;
- $target->import_resolutions_from_remote_replica( from => $source );
+ $target->import_resolutions_from_remote_replica( from => $source, force => 1 );
$target->import_changesets(
from => $source,
- resdb => $target->resolution_db_handle
+ resdb => $target->resolution_db_handle,
+ force => 1,
);
lives_and {
ok_added_revisions(
sub {
- $target->import_changesets( from => $source );
+ $target->import_changesets( from => $source, force => 1 );
},
0,
'no more changes to sync'
@@ -135,7 +138,7 @@
lives_and {
ok_added_revisions(
sub {
- $target->import_changesets( from => $source );
+ $target->import_changesets( from => $source, force => 1 );
},
0,
'no more changes to sync'
Modified: Prophet/trunk/t/simple-conflicting-merge.t
==============================================================================
--- Prophet/trunk/t/simple-conflicting-merge.t (original)
+++ Prophet/trunk/t/simple-conflicting-merge.t Wed Jul 16 18:55:45 2008
@@ -19,7 +19,7 @@
run_ok( 'prophet', [qw(create --type Dummy -- --ignore yes)], "Created a dummy record" );
- run_ok( 'prophet', [ 'merge', '--to', repo_uri_for('bob'), '--from', repo_uri_for('alice') ], "Sync ran ok!" );
+ run_ok( 'prophet', [ 'merge', '--to', repo_uri_for('bob'), '--from', repo_uri_for('alice'), '--force' ], "Sync ran ok!" );
# check our local replicas
my ( $ret, $out, $err ) = run_script( 'prophet', [qw(search --type Bug --regex .)] );
@@ -75,6 +75,7 @@
lives_ok {
$target->import_changesets(
from => $source,
+ force => 1,
conflict_callback => sub {
$conflict_obj = shift;
}
Modified: Prophet/trunk/t/simple-push.t
==============================================================================
--- Prophet/trunk/t/simple-push.t (original)
+++ Prophet/trunk/t/simple-push.t Wed Jul 16 18:55:45 2008
@@ -87,7 +87,7 @@
# sync from bob
diag('Alice syncs from bob');
is($alice->last_changeset_from_source($bob->uuid) => 0);
- run_ok( 'prophet', [ 'merge', '--from', repo_uri_for('bob'), '--to', repo_uri_for('alice') ], "Sync ran ok!" );
+ run_ok( 'prophet', [ 'merge', '--from', repo_uri_for('bob'), '--to', repo_uri_for('alice'), '--force' ], "Sync ran ok!" );
is($alice->last_changeset_from_source($bob->uuid) => $bob->latest_sequence_no);
};
More information about the Bps-public-commit
mailing list