Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a --simple-progress option which forces lines breaks in progres…

…s bar output to always be newlines. This displays better in Hudson's console output.
  • Loading branch information...
commit d397aecc07d16d2ab5e6ee12317db953209f323f 1 parent 28212ef
@lukemelia lukemelia authored
View
6 lib/testjour/configuration.rb
@@ -212,10 +212,14 @@ def option_parser
@options[:strict] = true
end
- opts.on("--create-mysql-db", "Create MySQL for each slave") do |server|
+ opts.on("--create-mysql-db", "Create MySQL for each slave") do
@options[:create_mysql_db] = true
end
+ opts.on("--simple-progress", "Use a simpler progress bar that may display better in logs") do
+ @options[:simple_progress] = true
+ end
+
opts.on("--queue-host=QUEUE_HOST", "Use another server to host the main redis queue") do |queue_host|
@options[:queue_host] = queue_host
end
View
5 lib/testjour/progressbar.rb
@@ -15,9 +15,10 @@ class ProgressBar
attr_accessor :colorer
attr_writer :title
- def initialize (title, total, out = STDERR)
+ def initialize (title, total, simple, out = STDERR)
@title = title
@total = total
+ @simple = simple
@out = out
@current = 0
@previous = 0
@@ -59,7 +60,7 @@ def time
end
def eol
- if @is_finished then "\n" else "\r" end
+ if (@simple || @is_finished) then "\n" else "\r" end
end
def bar(percentage)
View
2  lib/testjour/results_formatter.rb
@@ -7,7 +7,7 @@ class ResultsFormatter
def initialize(step_counter, options = {})
@options = options
- @progress_bar = ProgressBar.new("0 failures", step_counter.count)
+ @progress_bar = ProgressBar.new("0 failures", step_counter.count, options[:simple_progress])
@result_set = ResultSet.new(step_counter)
end
Please sign in to comment.
Something went wrong with that request. Please try again.