Mercurial > hg > nginx-tests
changeset 891:f4189a38c3a4
Tests: mark 'phantom event' alerts on Solaris as TODO (iff any).
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Fri, 01 Apr 2016 20:16:27 +0300 |
parents | b06beed07bc8 |
children | 0c64f87aa689 |
files | lib/Test/Nginx.pm limit_conn.t mail_imap_ssl.t proxy_unfinished.t stream_access.t stream_proxy_ssl_verify.t stream_ssl.t stream_tcp_nodelay.t |
diffstat | 8 files changed, 8 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/Test/Nginx.pm Fri Apr 01 17:41:57 2016 +0300 +++ b/lib/Test/Nginx.pm Fri Apr 01 20:16:27 2016 +0300 @@ -66,9 +66,14 @@ if (Test::More->builder->expected_tests) { local $Test::Nginx::TODO = 'alerts' unless $self->{_alerts}; - my $alerts = $self->read_file('error.log'); - $alerts = join "\n", $alerts =~ /.+\[alert\].+/gm; - Test::More::is($alerts, '', 'no alerts'); + my @alerts = $self->read_file('error.log') =~ /.+\[alert\].+/gm; + + if ($^O eq 'solaris') { + $Test::Nginx::TODO = 'alerts' if @alerts + && ! grep { $_ !~ /phantom event/ } @alerts; + } + + Test::More::is(join("\n", @alerts), '', 'no alerts'); } if (Test::More->builder->expected_tests) {
--- a/limit_conn.t Fri Apr 01 17:41:57 2016 +0300 +++ b/limit_conn.t Fri Apr 01 20:16:27 2016 +0300 @@ -23,8 +23,6 @@ my $t = Test::Nginx->new()->has(qw/http proxy limit_conn limit_req shmem/); -$t->todo_alerts() if $^O eq 'solaris'; - $t->write_file_expand('nginx.conf', <<'EOF')->plan(8); %%TEST_GLOBALS%%
--- a/mail_imap_ssl.t Fri Apr 01 17:41:57 2016 +0300 +++ b/mail_imap_ssl.t Fri Apr 01 20:16:27 2016 +0300 @@ -37,8 +37,6 @@ ->has(qw/mail mail_ssl imap http rewrite/)->has_daemon('openssl') ->run_daemon(\&Test::Nginx::IMAP::imap_test_daemon)->plan(12); -$t->todo_alerts() if $^O eq 'solaris'; - $t->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%%
--- a/proxy_unfinished.t Fri Apr 01 17:41:57 2016 +0300 +++ b/proxy_unfinished.t Fri Apr 01 20:16:27 2016 +0300 @@ -33,8 +33,6 @@ my $t = Test::Nginx->new()->has(qw/http proxy cache sub shmem/)->plan(15); -$t->todo_alerts() if $^O eq 'solaris'; - $t->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%%
--- a/stream_access.t Fri Apr 01 17:41:57 2016 +0300 +++ b/stream_access.t Fri Apr 01 20:16:27 2016 +0300 @@ -25,8 +25,6 @@ my $t = Test::Nginx->new()->has(qw/stream stream_access ipv6/); -$t->todo_alerts() if $^O eq 'solaris'; - $t->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%%
--- a/stream_proxy_ssl_verify.t Fri Apr 01 17:41:57 2016 +0300 +++ b/stream_proxy_ssl_verify.t Fri Apr 01 20:16:27 2016 +0300 @@ -24,8 +24,6 @@ my $t = Test::Nginx->new()->has(qw/stream stream_ssl/)->has_daemon('openssl'); -$t->todo_alerts() if $^O eq 'solaris'; - $t->write_file_expand('nginx.conf', <<'EOF')->plan(6); %%TEST_GLOBALS%%
--- a/stream_ssl.t Fri Apr 01 17:41:57 2016 +0300 +++ b/stream_ssl.t Fri Apr 01 20:16:27 2016 +0300 @@ -35,8 +35,6 @@ my $t = Test::Nginx->new()->has(qw/stream stream_ssl/)->has_daemon('openssl'); -$t->todo_alerts() if $^O eq 'solaris'; - $t->plan(7)->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%%
--- a/stream_tcp_nodelay.t Fri Apr 01 17:41:57 2016 +0300 +++ b/stream_tcp_nodelay.t Fri Apr 01 20:16:27 2016 +0300 @@ -28,8 +28,6 @@ my $t = Test::Nginx->new()->has(qw/stream/); -$t->todo_alerts() if $^O eq 'solaris'; - plan(skip_all => 'no tcp_nodelay') unless $t->has_version('1.9.4'); $t->plan(2)->write_file_expand('nginx.conf', <<'EOF');