fix tests, truncating log file breaks everything log

This commit is contained in:
Jorge Morante 2021-01-03 18:50:44 +01:00
parent c5906899b4
commit b693ddf953
7 changed files with 10 additions and 13 deletions

View File

@ -11,7 +11,8 @@ class Fingers::ActionRunner
return unless final_shell_command
`tmux run-shell -b "#{final_shell_command} &> #{Fingers::Dirs::LOG_PATH}"`
redirect_to_log_file = ">>#{Fingers::Dirs::LOG_PATH} 2>&1"
`tmux run-shell -b "#{final_shell_command} #{redirect_to_log_file}"`
end
private

View File

@ -80,11 +80,10 @@ class Fingers::Commands::LoadConfig < Fingers::Commands::Base
end
def setup_bindings
# ruby
input_mode = 'fingers-mode'
ruby_bin = "#{RbConfig.ruby} --disable-gems"
`tmux bind-key #{Fingers.config.key} run-shell -b "#{ruby_bin} #{cli} start '#{input_mode}' '\#{pane_id}' >#{Fingers::Dirs::LOG_PATH} 2>&1"`
`tmux bind-key #{Fingers.config.key} run-shell -b "#{ruby_bin} #{cli} start '#{input_mode}' '\#{pane_id}' >>#{Fingers::Dirs::LOG_PATH} 2>&1"`
setup_fingers_mode_bindings if input_mode == 'fingers-mode'
end

View File

@ -113,6 +113,7 @@ class Fingers::Commands::Start < Fingers::Commands::Base
tmux.disable_prefix
tmux.set_key_table 'fingers'
Fingers.benchmark_stamp('ready-for-input:end')
Fingers.trace_for_tests_do_not_remove_or_the_whole_fabric_of_reality_will_tear_apart_with_unforeseen_consequences('fingers-ready')
input_socket.on_input do |input|

View File

@ -56,9 +56,9 @@ module Fingers
end
def self.load_from_cache
Fingers.benchmark_stamp('load_config_from_cache:start')
Fingers.benchmark_stamp('load-config-from-cache:start')
result = Marshal.load(File.open(CONFIG_PATH))
Fingers.benchmark_stamp('load_config_from_cache:end')
Fingers.benchmark_stamp('load-config-from-cache:end')
result
end
end

View File

@ -20,11 +20,6 @@ def measure_benchmarks
elsif phase == 'end'
_, start_ms = step_stack.pop
puts "step: #{step}"
puts "ms: #{ms}"
puts "start_ms: #{start_ms}"
puts '----'
ellapsed_ms = ms - start_ms
ellapsed_times_by_step[step] = [] unless ellapsed_times_by_step[step]

View File

@ -30,7 +30,7 @@ shared_context 'tmuxomatic setup', a: :b do
tmuxomatic.send_keys(tmuxomatic_pane_id, keys)
if trace_benchmark
Fingers.benchmark_stamp('boot:start')
Fingers.benchmark_stamp('ready_for_input:start')
Fingers.benchmark_stamp('ready-for-input:start')
end
end
# TODO: detect when key is received, is it even possible?

View File

@ -1,7 +1,8 @@
#!/usr/bin/env ruby
fingers_root = File.dirname(__FILE__)
redirect_to_log_file = ">#{fingers_root}/fingers.log 2>&1"
`tmux run-shell -b "#{fingers_root}/bin/fingers load_config #{redirect_to_log_file}"`
redirect_to_log_file = ">>#{fingers_root}/fingers.log 2>&1"
`tmux run-shell -b "#{fingers_root}/bin/fingers load_config"`
`tmux run-shell -b "#{fingers_root}/bin/fingers check_version #{redirect_to_log_file}"`