diff --git a/test/shell/t1_conf.rb b/test/config/t1_conf.rb similarity index 100% rename from test/shell/t1_conf.rb rename to test/config/t1_conf.rb diff --git a/test/shell/run.rb b/test/shell/run.rb index d5e9019fa5..58317f9293 100644 --- a/test/shell/run.rb +++ b/test/shell/run.rb @@ -2,9 +2,9 @@ require "puma/detect" TESTS_TO_RUN = if Process.respond_to?(:fork) - %w[t1 t2 t3] + %w[t2 t3] else - %w[t1 t2] + %w[t2] end results = TESTS_TO_RUN.map do |test| diff --git a/test/shell/t1.rb b/test/shell/t1.rb deleted file mode 100644 index bffbfb47b3..0000000000 --- a/test/shell/t1.rb +++ /dev/null @@ -1,18 +0,0 @@ -system "ruby -rrubygems -Ilib bin/puma -p 10102 -C test/shell/t1_conf.rb test/rackup/hello.ru &" - -sleep 1 until system "curl http://localhost:10102/" - -Process.kill :TERM, Integer(File.read("t1-pid")) - -sleep 1 - -log = File.read("t1-stdout") - -File.unlink "t1-stdout" if File.file? "t1-stdout" -File.unlink "t1-pid" if File.file? "t1-pid" - -if log =~ %r!GET / HTTP/1\.1! - exit 0 -else - exit 1 -end diff --git a/test/test_integration_single.rb b/test/test_integration_single.rb index 864c3385ae..ebe8fa578b 100644 --- a/test/test_integration_single.rb +++ b/test/test_integration_single.rb @@ -112,4 +112,23 @@ def test_siginfo_thread_print assert_match "Thread: TID", output.join end + + def test_write_to_log + skip_unless_signal_exist? :TERM + + suppress_output = '> /dev/null 2>&1' + + cli_server '-C test/config/t1_conf.rb test/rackup/hello.ru' + + system "curl http://localhost:#{@tcp_port}/ #{suppress_output}" + + stop_server + + log = File.read('t1-stdout') + + File.unlink 't1-stdout' if File.file? 't1-stdout' + File.unlink 't1-pid' if File.file? 't1-pid' + + assert_match(%r!GET / HTTP/1\.1!, log) + end end diff --git a/test/test_rack_handler.rb b/test/test_rack_handler.rb index bcfc3542b1..348e874f5d 100644 --- a/test/test_rack_handler.rb +++ b/test/test_rack_handler.rb @@ -236,7 +236,7 @@ def test_file_log_requests_wins_over_default_config file_log_requests_config = true @options[:config_files] = [ - 'test/shell/t1_conf.rb' + 'test/config/t1_conf.rb' ] conf = Rack::Handler::Puma.config(->{}, @options) @@ -250,7 +250,7 @@ def test_user_log_requests_wins_over_file_config @options[:log_requests] = user_log_requests_config @options[:config_files] = [ - 'test/shell/t1_conf.rb' + 'test/config/t1_conf.rb' ] conf = Rack::Handler::Puma.config(->{}, @options)