]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
added `--continue` to test run
authorelijah <elijah@riseup.net>
Tue, 10 Dec 2013 19:09:03 +0000 (11:09 -0800)
committerelijah <elijah@riseup.net>
Tue, 10 Dec 2013 19:09:03 +0000 (11:09 -0800)
lib/leap_cli/commands/test.rb

index 7066241bd005fadb14786c71779cc76297455249..da4a4b54bc45033f0fbecc7a277057442c2b38d3 100644 (file)
@@ -11,10 +11,11 @@ module LeapCli; module Commands
 
     test.desc 'Run tests.'
     test.command :run do |run|
+      run.switch 'continue', :desc => 'Continue over errors and failures (default is --no-continue).', :negatable => true
       run.action do |global_options,options,args|
         manager.filter!(args).each_node do |node|
           ssh_connect(node) do |ssh|
-            ssh.run(test_cmd)
+            ssh.run(test_cmd(options))
           end
         end
       end
@@ -25,8 +26,12 @@ module LeapCli; module Commands
 
   private
 
-  def test_cmd
-    "#{PUPPET_DESTINATION}/bin/run_tests"
+  def test_cmd(options)
+    if options[:continue]
+      "#{PUPPET_DESTINATION}/bin/run_tests --continue"
+    else
+      "#{PUPPET_DESTINATION}/bin/run_tests"
+    end
   end
 
   #