Skip to content

Commit 010672c

Browse files
committedDec 18, 2015
Write log file manually
1 parent fc3487a commit 010672c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed
 

‎Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
parallel_cucumber (0.1.17)
4+
parallel_cucumber (0.1.18)
55
cucumber
66
parallel (~> 1.6)
77

‎lib/parallel_cucumber/runner.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def execute_command_for_process(process_number, cmd)
3030
print_chevron_msg(process_number, "Custom env: #{env.map { |k, v| "#{k}=#{v}" }.join(' ')}; command: #{cmd}")
3131

3232
begin
33-
output = IO.popen(env, "#{cmd} 2>&1 | tee thread_#{process_number}.log") do |io|
33+
output = IO.popen(env, "#{cmd} 2>&1") do |io|
3434
print_chevron_msg(process_number, "Pid: #{io.pid}")
3535
show_output(io, process_number)
3636
end
@@ -75,6 +75,7 @@ def print_chevron_msg(chevron, line, io = $stdout)
7575
end
7676

7777
def show_output(io, process_number)
78+
file = File.open("process_#{process_number}.log", 'w')
7879
remaining_part = ''
7980
probable_finish = false
8081
begin
@@ -86,6 +87,7 @@ def show_output(io, process_number)
8687
lines.each do |line|
8788
probable_finish = true if last_cucumber_line?(line)
8889
print_chevron_msg(process_number, line)
90+
file.write("#{line}\n")
8991
end
9092
end
9193
rescue IO::WaitReadable
@@ -105,6 +107,8 @@ def show_output(io, process_number)
105107
return
106108
ensure
107109
print_chevron_msg(process_number, remaining_part)
110+
file.write("#{remaining_part}")
111+
file.close unless file.nil?
108112
end
109113
end
110114

‎lib/parallel_cucumber/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module ParallelCucumber
2-
VERSION = '0.1.17'
2+
VERSION = '0.1.18'
33
end # ParallelCucumber

0 commit comments

Comments
 (0)
Please sign in to comment.