Skip to content

Commit 3c86073

Browse files
committed
mute a lot of logging
1 parent fdeda7f commit 3c86073

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

lib/arduino_ci/arduino_cmd.rb

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def prefs
4040
start = Time.now
4141
resp = run_and_capture("--get-pref")
4242
@prefs_response_time = Time.now - start
43-
puts "prefs_response_time = #{@prefs_response_time} = #{Time.now} - #{start}"
4443
end
4544
return nil unless resp[:success]
4645
lines = resp[:out].split("\n").select { |l| l.include? "=" }

lib/arduino_ci/display_manager.rb

+22-7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ def initialize
1616
@existing = existing_display?
1717
@enabled = false
1818
@pid = nil
19+
20+
# @xv_pipe_out_wr = nil
21+
# @xv_pipe_err_wr = nil
22+
# @xv_pipe_out = nil
23+
# @xv_pipe_err = nil
1924
end
2025

2126
# attempt to determine if the machine is running a graphical display (i.e. not Travis)
@@ -71,6 +76,8 @@ def enable
7176
end
7277

7378
return unless @pid.nil? # TODO: disable first?
79+
# @xv_pipe_out.close unless @xv_pipe_out.nil?
80+
# @xv_pipe_err.close unless @xv_pipe_err.nil?
7481

7582
# open Xvfb
7683
xvfb_cmd = [
@@ -81,7 +88,15 @@ def enable
8188
"-screen", "0",
8289
"1280x1024x16",
8390
]
84-
puts "pipeline_start for Xvfb"
91+
puts "Xvfb launching"
92+
93+
# # seems to cause a hang, not sure why
94+
# @xv_pipe_out, @xv_pipe_out_wr = IO.pipe
95+
# @xv_pipe_err, @xv_pipe_err_wr = IO.pipe
96+
# puts "xv_pipe_out_wr: #{@xv_pipe_out_wr}"
97+
# puts "xv_pipe_err_wr: #{@xv_pipe_err_wr}"
98+
# pipe = IO.popen(xvfb_cmd, stdout: @xv_pipe_out_wr, err: @xv_pipe_err_wr)
99+
85100
pipe = IO.popen(xvfb_cmd)
86101
@pid = pipe.pid
87102
@enabled = xvfb_launched?(DESIRED_DISPLAY, @pid, 30)
@@ -109,6 +124,9 @@ def disable
109124
Process.wait @pid
110125
@enabled = false
111126
@pid = nil
127+
128+
# @xv_pipe_out_wr.close
129+
# @xv_pipe_err_wr.close
112130
end
113131
end
114132

@@ -133,14 +151,11 @@ def run(*args, **kwargs)
133151
env_vars.merge!(args[0]) if has_env
134152
actual_args = has_env ? args[1..-1] : args # need to shift over if we extracted args
135153
full_cmd = env_vars.empty? ? actual_args : [env_vars] + actual_args
136-
137-
puts "Running #{env_vars} $ #{actual_args.join(' ')}"
138-
puts "Full_cmd is #{full_cmd}"
139-
puts "kwargs is #{kwargs}"
154+
shell_vars = env_vars.map { |k, v| "#{k}=#{v}" }.join(" ")
155+
puts " $ #{shell_vars} #{actual_args.join(' ')}"
140156
ret = system(*full_cmd, **kwargs)
141-
puts "system call to #{actual_args[0]} has completed"
157+
puts "#{actual_args[0]} has completed"
142158
end
143-
puts "with_display has completed"
144159
ret
145160
end
146161

0 commit comments

Comments
 (0)