changeset 593:6c0a5903d0ae

Tests: cleanup now duplicating tests for no alerts.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 27 May 2015 17:09:22 +0300
parents 355f2d5ff60f
children 8dd5cf697eae
files image_filter_finalize.t memcached_keepalive.t memcached_keepalive_stale.t mp4.t post_action.t proxy_cache.t proxy_cache_path.t proxy_cache_range.t proxy_cache_variables.t proxy_force_ranges.t proxy_keepalive.t ssi.t ssi_if.t ssi_waited.t
diffstat 14 files changed, 14 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- 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');
-
 ###############################################################################
--- 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');
-
 ###############################################################################
--- 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');
-
 ###############################################################################
--- 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 {
--- 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');
-
 ###############################################################################
--- 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 {
--- 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');
-
 ###############################################################################
--- 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 {
--- 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/(?<!X-Cache).*SEE
 
 like(http_get('/'), qr/SEE-THOSE/, 'proxy_cache empty - not cached');
 
-like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts');
-
 ###############################################################################
--- 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 {
--- 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');
 
 ###############################################################################
--- 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');
-
 ###############################################################################
--- 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');
-
 ###############################################################################
--- 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');
-
 ###############################################################################