# HG changeset patch # User Sergey Kandaurov # Date 1432735762 -10800 # Node ID 6c0a5903d0ae60d1f6381394ea42dfe114fcbda3 # Parent 355f2d5ff60ff5747fcb2514554f6e8c4ad7ec79 Tests: cleanup now duplicating tests for no alerts. diff --git a/image_filter_finalize.t b/image_filter_finalize.t --- a/image_filter_finalize.t +++ b/image_filter_finalize.t @@ -22,7 +22,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; my $t = Test::Nginx->new()->has(qw/http proxy cache image_filter limit_req/) - ->has(qw/rewrite shmem/)->plan(4) + ->has(qw/rewrite shmem/)->plan(3) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -142,6 +142,4 @@ http_get('/slow'); http_get('/t3'); like(http_get('/time.log'), qr!/t3:.*, [1-9]\.!, 'upstream response time'); -like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); - ############################################################################### diff --git a/memcached_keepalive.t b/memcached_keepalive.t --- a/memcached_keepalive.t +++ b/memcached_keepalive.t @@ -25,7 +25,7 @@ eval { require Cache::Memcached; }; plan(skip_all => 'Cache::Memcached not installed') if $@; my $t = Test::Nginx->new()->has(qw/http memcached upstream_keepalive rewrite/) - ->has_daemon('memcached')->plan(16) + ->has_daemon('memcached')->plan(15) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -190,8 +190,4 @@ is($memd1->stats()->{total}->{total_conn $memd2->stats()->{total}->{total_connections}, $total + 2, 'connection per backend'); -$t->stop(); - -like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); - ############################################################################### diff --git a/memcached_keepalive_stale.t b/memcached_keepalive_stale.t --- a/memcached_keepalive_stale.t +++ b/memcached_keepalive_stale.t @@ -25,7 +25,7 @@ eval { require Cache::Memcached; }; plan(skip_all => 'Cache::Memcached not installed') if $@; my $t = Test::Nginx->new()->has(qw/http memcached upstream_keepalive rewrite/) - ->has_daemon('memcached')->plan(2) + ->has_daemon('memcached')->plan(1) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -118,8 +118,4 @@ for (1 .. 100) { cmp_ok($memd1->stats()->{total}->{total_connections}, '<=', $total + 2, 'only one connection per worker used'); -$t->stop(); - -like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); - ############################################################################### diff --git a/mp4.t b/mp4.t --- a/mp4.t +++ b/mp4.t @@ -58,7 +58,7 @@ system('ffmpeg -loglevel quiet -y ' . "${\($t->testdir())}/test.mp4") == 0 or die "Can't create mp4 file: $!"; -$t->run()->plan(14); +$t->run()->plan(13); ############################################################################### @@ -86,10 +86,6 @@ unlike(http_head("/test.mp4?start=11"), 'start beyond short track'); like(http_head("/test.mp4?start=21"), qr!HTTP/1.1 500!, 'start beyond EOF'); -# check for alerts, e.g., "zero buf in output", shouldn't be any - -like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); - ############################################################################### sub durations { diff --git a/post_action.t b/post_action.t --- a/post_action.t +++ b/post_action.t @@ -22,7 +22,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(6); +my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(5); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -78,6 +78,4 @@ unlike(http_get('/remote'), qr/HIDDEN/m, like(`cat ${\($t->testdir())}/access.log`, qr/post/, 'post action in logs'); -like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); - ############################################################################### diff --git a/proxy_cache.t b/proxy_cache.t --- a/proxy_cache.t +++ b/proxy_cache.t @@ -21,7 +21,7 @@ use Test::Nginx qw/ :DEFAULT :gzip /; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http proxy cache gzip shmem/)->plan(14) +my $t = Test::Nginx->new()->has(qw/http proxy cache gzip shmem/)->plan(13) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -110,8 +110,6 @@ like(http_gzip_request('/empty.html'), qr/HTTP.*14\x0d\x0a.{20}\x0d\x0a0\x0d\x0a\x0d\x0a\z/s, 'empty get stale'); -like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); - ############################################################################### sub http_get_range { diff --git a/proxy_cache_path.t b/proxy_cache_path.t --- a/proxy_cache_path.t +++ b/proxy_cache_path.t @@ -22,7 +22,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http proxy cache shmem/)->plan(7) +my $t = Test::Nginx->new()->has(qw/http proxy cache shmem/)->plan(6) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -84,6 +84,4 @@ like(http_get('/t?c=ON'), qr/HIT.*SEE-TH like(http_get('/t?c=OFF'), qr/HIT.*SEE-THIS/ms, 'temp path cached off'); like(http_get('/t?c=LEVELS'), qr/HIT.*SEE-THIS/ms, 'temp path cached levels'); -like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); - ############################################################################### diff --git a/proxy_cache_range.t b/proxy_cache_range.t --- a/proxy_cache_range.t +++ b/proxy_cache_range.t @@ -21,7 +21,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http proxy cache shmem/)->plan(7) +my $t = Test::Nginx->new()->has(qw/http proxy cache shmem/)->plan(6) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -91,8 +91,6 @@ like(http_get_range('/min_uses/t.html?3' like(http_get_range('/min_uses/t.html?4', 'Range: bytes=0-2,4-'), qr/^SEE.*^THIS/ms, 'multipart range below min_uses'); -like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); - ############################################################################### sub http_get_range { diff --git a/proxy_cache_variables.t b/proxy_cache_variables.t --- a/proxy_cache_variables.t +++ b/proxy_cache_variables.t @@ -22,7 +22,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http proxy cache shmem/)->plan(9) +my $t = Test::Nginx->new()->has(qw/http proxy cache shmem/)->plan(8) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -91,6 +91,4 @@ like(http_get('/'), qr/(?testdir())}/error.log`, qr/^$/s, 'no alerts'); - ############################################################################### diff --git a/proxy_force_ranges.t b/proxy_force_ranges.t --- a/proxy_force_ranges.t +++ b/proxy_force_ranges.t @@ -23,7 +23,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http proxy cache shmem/)->plan(5) +my $t = Test::Nginx->new()->has(qw/http proxy cache shmem/)->plan(4) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -85,8 +85,6 @@ like(http_get_range('/cache/t.html', 'Ra like(http_get_range('/cache/t.html', 'Range: bytes=0-2,4-'), qr/^SEE.*^THIS/ms, 'cached multipart range'); -like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); - ############################################################################### sub http_get_range { diff --git a/proxy_keepalive.t b/proxy_keepalive.t --- a/proxy_keepalive.t +++ b/proxy_keepalive.t @@ -25,7 +25,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; my $t = Test::Nginx->new()->has(qw/http proxy upstream_keepalive ssi rewrite/) - ->plan(50)->write_file_expand('nginx.conf', <<'EOF'); + ->plan(49)->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -209,7 +209,6 @@ like(http_get('/inmemory/closed2'), qr/2 # check for errors, shouldn't be any -like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); like(`grep -F '[error]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no errors'); ############################################################################### diff --git a/ssi.t b/ssi.t --- a/ssi.t +++ b/ssi.t @@ -22,7 +22,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; my $t = Test::Nginx->new()->has(qw/http ssi cache proxy rewrite shmem/) - ->plan(28); + ->plan(27); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -190,6 +190,4 @@ like(http_get('/var_format.html?custom=1 like(http_get('/var_format.html'), qr/x\w+, \d\d-\w{3}-\d{4} \d\d:\d\d:\d\d [\w ]+x/, 'default ssi'); -like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); - ############################################################################### diff --git a/ssi_if.t b/ssi_if.t --- a/ssi_if.t +++ b/ssi_if.t @@ -22,7 +22,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http ssi/)->plan(44); +my $t = Test::Nginx->new()->has(qw/http ssi/)->plan(43); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -270,7 +270,4 @@ like(http_get('/zigzag_block.html?1=t&3= } - -like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); - ############################################################################### diff --git a/ssi_waited.t b/ssi_waited.t --- a/ssi_waited.t +++ b/ssi_waited.t @@ -21,7 +21,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http ssi/)->plan(2); +my $t = Test::Nginx->new()->has(qw/http ssi/)->plan(1); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -59,6 +59,4 @@ EOF like(http_get('/'), qr/^xFIRSTxWAITEDxSECONDx$/m, 'waited non-active'); -like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); - ###############################################################################