Skip to content

Commit

Permalink
[changelog skip] Move integration logging test to main test suite (#2240
Browse files Browse the repository at this point in the history
)

* Copy test from shell/t1.rb to test/test_integration_t1.rb
  • Loading branch information
harrylewis committed Apr 29, 2020
1 parent 5a4e744 commit e5f1655
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions test/shell/run.rb
Expand Up @@ -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|
Expand Down
18 changes: 0 additions & 18 deletions test/shell/t1.rb

This file was deleted.

19 changes: 19 additions & 0 deletions test/test_integration_single.rb
Expand Up @@ -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
4 changes: 2 additions & 2 deletions test/test_rack_handler.rb
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit e5f1655

Please sign in to comment.