[Bps-public-commit] SD branch, master, updated. d02accac84c588b99422aa602f40e2ee1b6228da

spang at bestpractical.com spang at bestpractical.com
Thu Aug 20 13:13:16 EDT 2009


The branch, master has been updated
       via  d02accac84c588b99422aa602f40e2ee1b6228da (commit)
      from  d15e489bbb0aec5721fa0b50097f42f186f5e636 (commit)

Summary of changes:
 lib/App/SD/CLI/Command/Clone.pm               |    5 ++++
 lib/App/SD/CLI/Command/Init.pm                |    5 ++++
 lib/App/SD/CLI/NewReplicaCommand.pm           |   31 +++++++++++++-----------
 t/01-create.t                                 |    2 +-
 t/02-create-with-editor.t                     |    2 +-
 t/03-update-ticket-with-editor.t              |    2 +-
 t/04-update-ticket-comment-with-editor.t      |    2 +-
 t/06-ticket-show.t                            |    2 +-
 t/07-sort-group.t                             |    2 +-
 t/attachment-content.t                        |    2 +-
 t/sd-attachments.t                            |    2 +-
 t/sd-comments.t                               |    2 +-
 t/sd-dispatcher.t                             |    2 +-
 t/sd-gcode/basic.t                            |    2 +-
 t/sd-github/basic.t                           |    2 +-
 t/sd-hm/attachments.t                         |    2 +-
 t/sd-hm/basics.t                              |    4 ++-
 t/sd-hm/comments.t                            |    4 ++-
 t/sd-hm/comments1.t                           |    2 +-
 t/sd-hm/group.t                               |    7 ++++-
 t/sd-hm/push-reporter-not-pro.t               |    2 +-
 t/sd-hm/push-reporter-pro.t                   |    2 +-
 t/sd-hm/tag.t                                 |    3 +-
 t/sd-hm/update.t                              |    4 ++-
 t/sd-log.t                                    |    2 +-
 t/sd-redmine/basic.t                          |    6 +++-
 t/sd-redmine/clone.t                          |    4 ++-
 t/sd-rt/basic.t                               |    4 ++-
 t/sd-rt/bogus-rt-data.t                       |    4 ++-
 t/sd-rt/pull-owner.t                          |    2 +-
 t/sd-rt/pull-watchers.t                       |    2 +-
 t/sd-rt/race-condition.t                      |    4 ++-
 t/sd-rt/rt-auto-open-conflict.t               |    4 ++-
 t/sd-rt/sd-rt-hm-single.t                     |    3 +-
 t/sd-rt/sd-rt-hm.t                            |    5 ++-
 t/sd-rt/sd-rt-n-foreign-sync.t                |    5 ++-
 t/sd-rt/sd-rt-permission.t                    |    2 +-
 t/sd-trac/basic.t                             |    3 +-
 t/sd-trac/push-new-ticket-to-trac-then-pull.t |    3 +-
 t/sd-usage.t                                  |    2 +-
 t/sd-validation.t                             |    2 +-
 41 files changed, 96 insertions(+), 56 deletions(-)

- Log -----------------------------------------------------------------
commit d02accac84c588b99422aa602f40e2ee1b6228da
Author: Christine Spang <spang at bestpractical.com>
Date:   Thu Aug 20 17:02:25 2009 +0100

    --non-interactive option for init/clone
    
    We need this to not try prompting in tests when we don't want it to,
    and it's good for scriptability too.

diff --git a/lib/App/SD/CLI/Command/Clone.pm b/lib/App/SD/CLI/Command/Clone.pm
index 41acded..d7c10c9 100644
--- a/lib/App/SD/CLI/Command/Clone.pm
+++ b/lib/App/SD/CLI/Command/Clone.pm
@@ -3,6 +3,11 @@ use Any::Moose;
 extends 'Prophet::CLI::Command::Clone';
 with 'App::SD::CLI::NewReplicaCommand';
 
+sub ARG_TRANSLATIONS {
+    shift->SUPER::ARG_TRANSLATIONS(),
+    n => 'non-interactive',
+};
+
 override run => sub {
     my $self = shift;
 
diff --git a/lib/App/SD/CLI/Command/Init.pm b/lib/App/SD/CLI/Command/Init.pm
index cb1e8ff..e28e75d 100644
--- a/lib/App/SD/CLI/Command/Init.pm
+++ b/lib/App/SD/CLI/Command/Init.pm
@@ -3,6 +3,11 @@ use Any::Moose;
 extends 'Prophet::CLI::Command::Init';
 with 'App::SD::CLI::NewReplicaCommand';
 
+sub ARG_TRANSLATIONS {
+    shift->SUPER::ARG_TRANSLATIONS(),
+    n => 'non-interactive',
+};
+
 override run => sub {
     my $self = shift;
 
diff --git a/lib/App/SD/CLI/NewReplicaCommand.pm b/lib/App/SD/CLI/NewReplicaCommand.pm
index 664f97f..442780c 100644
--- a/lib/App/SD/CLI/NewReplicaCommand.pm
+++ b/lib/App/SD/CLI/NewReplicaCommand.pm
@@ -12,24 +12,27 @@ sub new_replica_wizard {
     # VCS wrappers themselves should take care of settings email addresses on
     # init/clone from VCS configuration, don't put that here
 
-    # don't prompt for configuration if there's already a user-wide email set
-    if ( ! defined $self->config->get( key => 'user.email-address' ) ) {
+    # non-interactive option is useful for testing and scriptability
+    unless ( $self->has_arg('non-interactive') ) {
+        # don't prompt for configuration if there's already a user-wide email set
+        if ( ! defined $self->config->get( key => 'user.email-address' ) ) {
 
-        print "\nYou need an email address configured to use SD. I'll try"
-              ." to find one.\n";
+            print "\nYou need an email address configured to use SD. I'll try"
+                ." to find one.\n";
 
-        if ( $ENV{EMAIL} ) {
-            $self->_migrate_email_from_env;
+            if ( $ENV{EMAIL} ) {
+                $self->_migrate_email_from_env;
+            }
+        }
+        # if we still don't have an email, ask
+        if ( ! defined $self->config->get( key => 'user.email-address' ) ) {
+            $self->_prompt_email;
         }
-    }
-    # if we still don't have an email, ask
-    if ( ! defined $self->config->get( key => 'user.email-address' ) ) {
-        $self->_prompt_email;
-    }
 
-    # new replicas probably want to change settings right away,
-    # at least to change the project name ;)
-    $self->_prompt_edit_settings if $args{edit_settings};
+        # new replicas probably want to change settings right away,
+        # at least to change the project name ;)
+        $self->_prompt_edit_settings if $args{edit_settings};
+    }
 
     # this message won't print if the user has a ~/.sdrc, which is
     # probably a pretty good indication that they're not new
diff --git a/t/01-create.t b/t/01-create.t
index 2c7f6ea..2a8f190 100644
--- a/t/01-create.t
+++ b/t/01-create.t
@@ -15,7 +15,7 @@ BEGIN {
     diag "export SD_REPO=".$ENV{'PROPHET_REPO'} ."\n";
 }
 
-run_script( 'sd', [ 'init']);
+run_script( 'sd', [ 'init', '--non-interactive']);
 
 # create from sd and push
 my ($yatta_id, $yatta_uuid) = create_ticket_ok( '--summary', 'YATTA');
diff --git a/t/02-create-with-editor.t b/t/02-create-with-editor.t
index 761a406..a599d80 100644
--- a/t/02-create-with-editor.t
+++ b/t/02-create-with-editor.t
@@ -9,7 +9,7 @@ BEGIN {
     $ENV{'PROPHET_REPO'} = $ENV{'SD_REPO'} = File::Temp::tempdir( CLEANUP => 1 ) . '/_svb';
     diag 'export SD_REPO=' . $ENV{'PROPHET_REPO'} . "\n";
 }
-run_script( 'sd', [ 'init']);
+run_script( 'sd', [ 'init', '--non-interactive']);
 
 my $replica_uuid = replica_uuid;
 
diff --git a/t/03-update-ticket-with-editor.t b/t/03-update-ticket-with-editor.t
index 57c76a7..ab6a34d 100644
--- a/t/03-update-ticket-with-editor.t
+++ b/t/03-update-ticket-with-editor.t
@@ -9,7 +9,7 @@ BEGIN {
     $ENV{'PROPHET_REPO'} = $ENV{'SD_REPO'} = File::Temp::tempdir( CLEANUP => 1 ) . '/_svb';
     diag 'export SD_REPO=' . $ENV{'PROPHET_REPO'} . "\n";
 }
-run_script( 'sd', [ 'init']);
+run_script( 'sd', [ 'init', '--non-interactive']);
 
 my $replica_uuid = replica_uuid;
 
diff --git a/t/04-update-ticket-comment-with-editor.t b/t/04-update-ticket-comment-with-editor.t
index 026cbfa..5c66279 100644
--- a/t/04-update-ticket-comment-with-editor.t
+++ b/t/04-update-ticket-comment-with-editor.t
@@ -11,7 +11,7 @@ BEGIN {
     Prophet::Test->set_editor_script('ticket-comment-update-editor.pl');
 }
 
-run_script( 'sd', [ 'init']);
+run_script( 'sd', [ 'init', '--non-interactive']);
 
 
 my $replica_uuid = replica_uuid;
diff --git a/t/06-ticket-show.t b/t/06-ticket-show.t
index 05056f0..8ffa11c 100644
--- a/t/06-ticket-show.t
+++ b/t/06-ticket-show.t
@@ -16,7 +16,7 @@ BEGIN {
     diag "export SD_REPO=".$ENV{'PROPHET_REPO'} ."\n";
 }
 
-run_script( 'sd', [ 'init']);
+run_script( 'sd', [ 'init', '--non-interactive']);
 
 my $replica_uuid = replica_uuid;
 
diff --git a/t/07-sort-group.t b/t/07-sort-group.t
index a24469a..dffe771 100644
--- a/t/07-sort-group.t
+++ b/t/07-sort-group.t
@@ -15,7 +15,7 @@ BEGIN {
     diag "export SD_REPO=".$ENV{'PROPHET_REPO'} ."\n";
 }
 
-run_script( 'sd', [ 'init']);
+run_script( 'sd', [ 'init', '--non-interactive']);
 
 my $replica_uuid = replica_uuid;
 
diff --git a/t/attachment-content.t b/t/attachment-content.t
index 89f6664..fe5b8cf 100644
--- a/t/attachment-content.t
+++ b/t/attachment-content.t
@@ -21,7 +21,7 @@ BEGIN {
     $ENV{'PROPHET_REPO'} = $ENV{'SD_REPO'} = File::Temp::tempdir( CLEANUP => 1 ) . '/_svb';
     diag "export SD_REPO=".$ENV{'PROPHET_REPO'} ."\n";
 }
-run_script( 'sd', [ 'init']);
+run_script( 'sd', [ 'init', '--non-interactive']);
 
 
 # create from sd and push
diff --git a/t/sd-attachments.t b/t/sd-attachments.t
index 172ef45..f81225e 100644
--- a/t/sd-attachments.t
+++ b/t/sd-attachments.t
@@ -12,7 +12,7 @@ BEGIN {
     diag "export SD_REPO=".$ENV{'PROPHET_REPO'} ."\n";
 }
 
-run_script( 'sd', [ 'init']);
+run_script( 'sd', [ 'init', '--non-interactive']);
 
 
 my $replica_uuid = replica_uuid;
diff --git a/t/sd-comments.t b/t/sd-comments.t
index 22b267e..ad0e402 100644
--- a/t/sd-comments.t
+++ b/t/sd-comments.t
@@ -13,7 +13,7 @@ BEGIN {
     diag $ENV{'PROPHET_REPO'};
 }
 
-run_script( 'sd', [ 'init']);
+run_script( 'sd', [ 'init', '--non-interactive']);
 
 
 my $replica_uuid = replica_uuid;
diff --git a/t/sd-dispatcher.t b/t/sd-dispatcher.t
index 955a959..9c3ffab 100644
--- a/t/sd-dispatcher.t
+++ b/t/sd-dispatcher.t
@@ -13,7 +13,7 @@ BEGIN {
 
 # tests for pseudo-commands that are only sugar in the dispatcher
 
-run_script( 'sd', [ 'init']);
+run_script( 'sd', [ 'init', '--non-interactive']);
 
 # create from sd
 my ($yatta_id, $yatta_uuid) = create_ticket_ok(    '--summary', 'YATTA', '--status', 'new' );
diff --git a/t/sd-gcode/basic.t b/t/sd-gcode/basic.t
index 49ce55d..c29c3df 100644
--- a/t/sd-gcode/basic.t
+++ b/t/sd-gcode/basic.t
@@ -23,7 +23,7 @@ my $sd_gcode_url = "gcode:net-google-code";
 
 my ( $ret, $out, $err );
 ( $ret, $out, $err ) =
-  run_script( 'sd', [ 'clone', '--from', $sd_gcode_url ] );
+  run_script( 'sd', [ 'clone', '--from', $sd_gcode_url, '--non-interactive' ] );
 my $for_sd_id;
 
 diag($err) if ($err);
diff --git a/t/sd-github/basic.t b/t/sd-github/basic.t
index cf3baa9..9ae1601 100644
--- a/t/sd-github/basic.t
+++ b/t/sd-github/basic.t
@@ -24,7 +24,7 @@ my $sd_github_url = "github:$url";
 
 my ( $ret, $out, $err );
 ( $ret, $out, $err ) =
-  run_script( 'sd', [ 'clone', '--from', $sd_github_url ] );
+  run_script( 'sd', [ 'clone', '--from', $sd_github_url, '--non-interactive' ] );
 my $first_id;
 
 diag($err) if ($err);
diff --git a/t/sd-hm/attachments.t b/t/sd-hm/attachments.t
index 92ef95b..26aac05 100644
--- a/t/sd-hm/attachments.t
+++ b/t/sd-hm/attachments.t
@@ -20,7 +20,7 @@ BEGIN {
 
 eval 'use BTDT::Test; 1;' or die "$@";
 
-run_script('sd', ['init']);
+run_script('sd', ['init', '--non-interactive']);
 
 my $server = BTDT::Test->make_server;
 my $URL    = $server->started_ok;
diff --git a/t/sd-hm/basics.t b/t/sd-hm/basics.t
index 14d551f..9873144 100644
--- a/t/sd-hm/basics.t
+++ b/t/sd-hm/basics.t
@@ -45,7 +45,9 @@ diag $task->id;
 my ( $ret, $out, $err );
 
 my $sd_hm_url = "hm:$URL";
-eval { ( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', $sd_hm_url ] ) };
+eval { ( $ret, $out, $err )
+    = run_script( 'sd',
+        [ 'clone', '--from', $sd_hm_url, '--non-interactive' ] ) };
 
 my ($flyman_uuid, $flyman_id );
 run_output_matches( 'sd', [ 'ticket', 'list', '--regex', '.' ], [qr/(.*?)(?{ $flyman_uuid = $1 }) Fly Man (.*)/] );
diff --git a/t/sd-hm/comments.t b/t/sd-hm/comments.t
index 9d2caa3..528a4cc 100644
--- a/t/sd-hm/comments.t
+++ b/t/sd-hm/comments.t
@@ -43,7 +43,9 @@ $task->create(
 my ($yatta_uuid, $yatta_id);
 {
     diag($sd_hm_url);
-    my ($ret, $out, $err) = run_script( 'sd', [ 'clone', '--from', $sd_hm_url ] );
+    my ($ret, $out, $err)
+        = run_script( 'sd',
+            [ 'clone', '--from', $sd_hm_url, '--non-interactive' ] );
     run_output_matches( 'sd', [qw(ticket list --regex .)], [qr/(.*?)(?{ $yatta_id = $1 }) YATTA (.*)/] );
     ( $ret, $out, $err ) = run_script( 'sd', [ qw(ticket show --batch --id), $yatta_id ] );
     if ($out =~ /^id: (.*) \((.*)\)$/m) {
diff --git a/t/sd-hm/comments1.t b/t/sd-hm/comments1.t
index 88ac8bf..19d8e45 100644
--- a/t/sd-hm/comments1.t
+++ b/t/sd-hm/comments1.t
@@ -36,7 +36,7 @@ $GOODUSER->user_object->set_accepted_eula_version( Jifty->config->app('EULAVersi
 
 my $sd_hm_url = "hm:$URL";
 
-run_script('sd', [qw(init)]);
+run_script('sd', [qw(init --non-interactive)]);
 
 my ($yatta_id, $yatta_uuid) = create_ticket_ok( qw(--summary YATTA --status new) );
 {
diff --git a/t/sd-hm/group.t b/t/sd-hm/group.t
index c163afd..ce3222c 100644
--- a/t/sd-hm/group.t
+++ b/t/sd-hm/group.t
@@ -67,7 +67,9 @@ my $sd_hm_url = "hm:$URL|group=$gid";
 
 # pull
 {
-    eval { ( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', $sd_hm_url ] ) };
+    eval { ( $ret, $out, $err )
+        = run_script( 'sd',
+            [ 'clone', '--from', $sd_hm_url, '--non-interactive' ] ) };
     diag($out);
     diag($err);
 }
@@ -122,7 +124,8 @@ rmtree( $ENV{'SD_REPO'}, {keep_root => 1} );
 $sd_hm_url = "hm:$URL|group=$gname";
 # pull
 {
-    eval { ( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', $sd_hm_url ] ) };
+    eval { ( $ret, $out, $err ) = run_script( 'sd',
+            [ 'clone', '--from', $sd_hm_url, '--non-interactive' ] ) };
     TODO: { local $TODO = ' Investigate changeset count. Why do we have 2 extra?';
     like($out, qr/2 changesets/, "merged changes");
     };
diff --git a/t/sd-hm/push-reporter-not-pro.t b/t/sd-hm/push-reporter-not-pro.t
index e6d0c65..3c4a825 100644
--- a/t/sd-hm/push-reporter-not-pro.t
+++ b/t/sd-hm/push-reporter-not-pro.t
@@ -109,7 +109,7 @@ diag("from requestor to no requestor");
 sub flush_sd {
     use File::Path qw(rmtree);
     rmtree( $ENV{'SD_REPO'} );
-    run_script( 'sd', ['init'] );
+    run_script( 'sd', ['init', '--non-interactive'] );
 }
 
 { my %seen;
diff --git a/t/sd-hm/push-reporter-pro.t b/t/sd-hm/push-reporter-pro.t
index aeca3c0..7de4ef4 100644
--- a/t/sd-hm/push-reporter-pro.t
+++ b/t/sd-hm/push-reporter-pro.t
@@ -125,7 +125,7 @@ diag("only one requestor");
 sub flush_sd {
     use File::Path qw(rmtree);
     rmtree( $ENV{'SD_REPO'} );
-    run_script( 'sd', ['init'] );
+    run_script( 'sd', ['init', '--non-interactive'] );
 }
 
 { my %seen;
diff --git a/t/sd-hm/tag.t b/t/sd-hm/tag.t
index 272fa68..4b26730 100644
--- a/t/sd-hm/tag.t
+++ b/t/sd-hm/tag.t
@@ -55,7 +55,8 @@ diag $task->id;
 my ( $ret, $out, $err );
 
 my $sd_hm_url = "hm:$URL|tag=mytag";
-eval { ( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', $sd_hm_url ] ) };
+eval { ( $ret, $out, $err )
+    = run_script( 'sd', [ 'clone', '--from', $sd_hm_url, '--non-interactive' ] ) };
 diag($err) if ($err);
 my ($flyman_uuid, $flyman_id );
 {
diff --git a/t/sd-hm/update.t b/t/sd-hm/update.t
index 3b06537..018a861 100644
--- a/t/sd-hm/update.t
+++ b/t/sd-hm/update.t
@@ -43,7 +43,9 @@ my $remote_id = $task->id;
 
 my ($yatta_uuid, $yatta_id);
 {
-    my ($ret, $out, $err) = run_script( 'sd', [ 'clone', '--from', $sd_hm_url ] );
+    my ($ret, $out, $err)
+        = run_script( 'sd',
+            [ 'clone', '--from', $sd_hm_url, '--non-interactive' ] );
 
     run_output_matches( 'sd', [qw(ticket list --regex .)], [qr/(.*?)(?{ $yatta_uuid = $1 }) YATTA (.*)/] );
     ( $ret, $out, $err ) = run_script( 'sd', [ qw(ticket show --batch --id), $yatta_uuid ] );
diff --git a/t/sd-log.t b/t/sd-log.t
index 3a894aa..0cb0e4a 100644
--- a/t/sd-log.t
+++ b/t/sd-log.t
@@ -16,7 +16,7 @@ BEGIN {
     diag $ENV{'PROPHET_REPO'};
 }
 
-run_script( 'sd', [ 'init']);
+run_script( 'sd', [ 'init', '--non-interactive']);
 
 my $replica_uuid = replica_uuid;
 
diff --git a/t/sd-redmine/basic.t b/t/sd-redmine/basic.t
index b9a304d..77a5fb7 100644
--- a/t/sd-redmine/basic.t
+++ b/t/sd-redmine/basic.t
@@ -33,9 +33,11 @@ my $user = $r->connection->user;
 my $pass = $r->connection->password;
 $sd_redmine_url =~ s|http://|http://${user}:${pass}@|;
 
-diag "sd clone --from ${sd_redmine_url}";
+diag "sd clone --from ${sd_redmine_url} --non-interactive";
 
-my ( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', $sd_redmine_url ] );
+my ( $ret, $out, $err )
+    = run_script( 'sd',
+        [ 'clone', '--from', $sd_redmine_url, '--non-interactive' ] );
 is(count_tickets_in_sd(),5, "the total cloned tickets is 5.");
 
 note "close one of them, push it to server.";
diff --git a/t/sd-redmine/clone.t b/t/sd-redmine/clone.t
index 059a4a2..015b962 100644
--- a/t/sd-redmine/clone.t
+++ b/t/sd-redmine/clone.t
@@ -47,7 +47,9 @@ When qr/I clone the redmine project with sd/, sub {
     my $user = $r->connection->user;
     my $pass = $r->connection->password;
     $sd_redmine_url =~ s|http://|http://${user}:${pass}@|;
-    my ( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', $sd_redmine_url ] );
+    my ( $ret, $out, $err )
+        = run_script( 'sd',
+            [ 'clone', '--from', $sd_redmine_url, '--non-interactive' ] );
 
     diag($err) if ($err);
 };
diff --git a/t/sd-rt/basic.t b/t/sd-rt/basic.t
index 1cb28f5..b95e7cb 100644
--- a/t/sd-rt/basic.t
+++ b/t/sd-rt/basic.t
@@ -52,7 +52,9 @@ my $ticket = RT::Client::REST::Ticket->new(
 my $flyman_rt_id = $ticket->id;
 
 my ( $ret, $out, $err );
-( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', $sd_rt_url ] );
+( $ret, $out, $err )
+    = run_script( 'sd',
+        [ 'clone', '--from', $sd_rt_url, '--non-interactive' ] );
 my ( $yatta_id, $flyman_id );
 diag($err) if ($err);
 run_output_matches(
diff --git a/t/sd-rt/bogus-rt-data.t b/t/sd-rt/bogus-rt-data.t
index 5e83ef2..dbcc1e8 100644
--- a/t/sd-rt/bogus-rt-data.t
+++ b/t/sd-rt/bogus-rt-data.t
@@ -56,7 +56,9 @@ my $ticket = RT::Client::REST::Ticket->new(
 my $flyman_rt_id = $ticket->id;
 
 my ( $ret, $out, $err );
-( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', $sd_rt_url ] );
+( $ret, $out, $err )
+    = run_script( 'sd',
+        [ 'clone', '--from', $sd_rt_url, '--non-interactive' ] );
 my ( $flyman_id );
 run_output_matches(
     'sd',
diff --git a/t/sd-rt/pull-owner.t b/t/sd-rt/pull-owner.t
index 091e754..aa1f720 100644
--- a/t/sd-rt/pull-owner.t
+++ b/t/sd-rt/pull-owner.t
@@ -162,6 +162,6 @@ ok $root->id, 'loaded root';
 
 sub flush_sd {
     rmtree( $ENV{'SD_REPO'} );
-    run_script( 'sd', ['init'] );
+    run_script( 'sd', ['init', '--non-interactive' ] );
 }
 
diff --git a/t/sd-rt/pull-watchers.t b/t/sd-rt/pull-watchers.t
index 242aaac..9c33c03 100644
--- a/t/sd-rt/pull-watchers.t
+++ b/t/sd-rt/pull-watchers.t
@@ -518,6 +518,6 @@ my $sd_rt_url = "rt:$url|General|Status!='resolved'";
 
 sub flush_sd {
     rmtree( $ENV{'SD_REPO'} );
-    run_script( 'sd', ['init'] );
+    run_script( 'sd', ['init', '--non-interactive' ] );
 }
 
diff --git a/t/sd-rt/race-condition.t b/t/sd-rt/race-condition.t
index 14cfd68..fcb9085 100644
--- a/t/sd-rt/race-condition.t
+++ b/t/sd-rt/race-condition.t
@@ -71,7 +71,9 @@ ok($flyman_rt_id, "I created a new ticket in RT");
 
 
 my ( $ret, $out, $err );
-( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', $sd_rt_url ] );
+( $ret, $out, $err )
+    = run_script( 'sd',
+        [ 'clone', '--from', $sd_rt_url, '--non-interactive' ] );
 my ( $yatta_id, $flyman_id );
 
 
diff --git a/t/sd-rt/rt-auto-open-conflict.t b/t/sd-rt/rt-auto-open-conflict.t
index 114f67b..63a5411 100644
--- a/t/sd-rt/rt-auto-open-conflict.t
+++ b/t/sd-rt/rt-auto-open-conflict.t
@@ -43,7 +43,9 @@ my $sd_rt_url = "rt:$url|General|Status!='resolved'";
 
 my $ticket = RT::Client::REST::Ticket->new( rt      => $rt, queue   => 'General', status  => 'new', subject => 'helium',)->store( text => "Ticket Comment" );
 diag("Clone from RT");
-my ( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', $sd_rt_url ] );
+my ( $ret, $out, $err )
+    = run_script( 'sd',
+        [ 'clone', '--from', $sd_rt_url, '--non-interactive' ] );
 ok( $ret, $out );
 diag($err);
 my $helium_id;
diff --git a/t/sd-rt/sd-rt-hm-single.t b/t/sd-rt/sd-rt-hm-single.t
index 9a4c476..83c7da5 100644
--- a/t/sd-rt/sd-rt-hm-single.t
+++ b/t/sd-rt/sd-rt-hm-single.t
@@ -80,7 +80,8 @@ diag("Pull from Hiveminder");
 
 as_bob {
     local $ENV{SD_REPO} = $ENV{'PROPHET_REPO'};
-    ( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', $sd_hm_url ] );
+    ( $ret, $out, $err ) = run_script( 'sd',
+        [ 'clone', '--from', $sd_hm_url, '--non-interactive' ] );
     diag($err) if ($err);
     run_output_matches( 'sd', [ 'ticket', 'list', '--regex', '.' ], [qr/^(.*?)(?{ $yatta_id = $1 }) YATTA .*/] );
     $yatta_uuid = get_uuid_for_luid($yatta_id);
diff --git a/t/sd-rt/sd-rt-hm.t b/t/sd-rt/sd-rt-hm.t
index 6ede231..2a0688e 100644
--- a/t/sd-rt/sd-rt-hm.t
+++ b/t/sd-rt/sd-rt-hm.t
@@ -79,13 +79,14 @@ my ( $ret, $out, $err );
 
 as_alice {
     local $ENV{SD_REPO} = $ENV{PROPHET_REPO};
-    ( $ret, $out, $err ) = run_script('sd',['init']);
+    ( $ret, $out, $err ) = run_script('sd',['init', '--non-interactive']);
     diag($err) if ($err);
 };
 
 as_bob {
     local $ENV{SD_REPO} = $ENV{PROPHET_REPO};
-    ( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', repo_uri_for('alice') ] );
+    ( $ret, $out, $err ) = run_script( 'sd',
+        [ 'clone', '--from', repo_uri_for('alice'), '--non-interactive' ] );
     diag($err) if ($err);
 };
 
diff --git a/t/sd-rt/sd-rt-n-foreign-sync.t b/t/sd-rt/sd-rt-n-foreign-sync.t
index 5f8ea05..e474279 100644
--- a/t/sd-rt/sd-rt-n-foreign-sync.t
+++ b/t/sd-rt/sd-rt-n-foreign-sync.t
@@ -99,13 +99,14 @@ my ( $ret, $out, $err );
 as_alice {
     local $ENV{SD_REPO} = $ENV{'PROPHET_REPO'};
 
-    run_script( 'sd', [ 'init']);
+    run_script( 'sd', [ 'init', '--non-interactive' ]);
 };
 
 as_bob {
     local $ENV{SD_REPO} = $ENV{'PROPHET_REPO'};
 
-    ( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', repo_uri_for('alice') ] );
+    ( $ret, $out, $err ) = run_script( 'sd',
+        [ 'clone', '--from', repo_uri_for('alice'), '--non-interactive' ] );
 };
 
 # now the tests, bob syncs with rt, alice syncs with hm
diff --git a/t/sd-rt/sd-rt-permission.t b/t/sd-rt/sd-rt-permission.t
index f16a025..b7180f2 100644
--- a/t/sd-rt/sd-rt-permission.t
+++ b/t/sd-rt/sd-rt-permission.t
@@ -64,7 +64,7 @@ $alice_url =~ s|http://|http://alice:AlicesPassword@|;
 my $alice_rt_url = "rt:$alice_url|General|Status!='resolved'";
 
 as_alice {
-    run_script( 'sd', [ 'init']);
+    run_script( 'sd', [ 'init', '--non-interactive' ]);
     ($ret, $out, $err) = run_script('sd', ['pull', '--from',  $alice_rt_url, '--force']);
     ok($ret);
 
diff --git a/t/sd-trac/basic.t b/t/sd-trac/basic.t
index 7fa0aac..413e947 100644
--- a/t/sd-trac/basic.t
+++ b/t/sd-trac/basic.t
@@ -84,7 +84,8 @@ is( $first->category, 'Ticket' );
 #
 
 my ( $ret, $out, $err );
-( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', $sd_trac_url ] );
+( $ret, $out, $err )
+    = run_script( 'sd', [ 'clone', '--from', $sd_trac_url, '--non-interactive' ] );
 
 is(count_tickets_in_sd(),1);
 
diff --git a/t/sd-trac/push-new-ticket-to-trac-then-pull.t b/t/sd-trac/push-new-ticket-to-trac-then-pull.t
index f81ad57..b545a1e 100644
--- a/t/sd-trac/push-new-ticket-to-trac-then-pull.t
+++ b/t/sd-trac/push-new-ticket-to-trac-then-pull.t
@@ -41,7 +41,8 @@ is( count_tickets_in_trac(), 0 );
 # Clone from trac
 #
 
-my ( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', $sd_trac_url ] );
+my ( $ret, $out, $err )
+    = run_script( 'sd', [ 'clone', '--from', $sd_trac_url, '--non-interactive' ] );
 is( count_tickets_in_sd(), 0 );
 ok(!($?>>8), $out." ".$err);
 #
diff --git a/t/sd-usage.t b/t/sd-usage.t
index f4ed638..5ff641c 100644
--- a/t/sd-usage.t
+++ b/t/sd-usage.t
@@ -12,7 +12,7 @@ diag "Replica is in $ENV{PROPHET_REPO}";
 
 # additional tests for SD-specific usage methods
 
-run_command( 'init' );
+run_command( 'init', '--non-interactive' );
 
 my @cmds = (
     {
diff --git a/t/sd-validation.t b/t/sd-validation.t
index b41ba70..d2f2d33 100644
--- a/t/sd-validation.t
+++ b/t/sd-validation.t
@@ -11,7 +11,7 @@ BEGIN {
     $ENV{'PROPHET_REPO'} = $ENV{'SD_REPO'} = File::Temp::tempdir( CLEANUP => 1 ) . '/_svb';
 }
 
-run_script( 'sd', [ 'init']);
+run_script( 'sd', [ 'init', '--non-interactive']);
 
 # create from sd and push
 my ($yatta_id, $yatta_uuid) = create_ticket_ok(    '--summary', 'YATTA', '--status', 'new' );

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list