Permalink
Browse files

releng work for cpan release 0.18.

  • Loading branch information...
1 parent f3e279c commit 12a54ba3e48693ae5c2db6c55fdf8bdf6fccc4a1 @agentzh agentzh committed Feb 3, 2012
View
35 Changes
@@ -1,13 +1,42 @@
Changes for Test::Nginx
+0.18 - 2012-02-03
+* feature: added new section "--- no_error_log" which could be used to specify
+ patterns of lines that do not appear in error.log at all.
+* feature: added MOCKEAGAIN_VERBOSE, DYLD_INSERT_LIBRARIES,
+ MOCKEAGAIN_WRITE_TIMEOUT_PATTERN, and LD_PRELOAD to the
+ environments that should be kept through nginx reload and restart.
+* doc: added Naxsi and ngx_rds_csv to the user module list in the POD documentation.
+* feature: now we can use the environment TEST_NGINX_USE_VALGRIND to specify the
+ valgrind command-line options, when set to 1 or other non-zero numbers, it is
+ effectively equivalent to the value "--tool=memcheck --leak-check=full". To
+ use Valgrind SGCheck to run the tests, just specify the environment
+ TEST_NGINX_USE_VALGRIND="--tool=exp-sgcheck" first.
+* feature: added support for environment TEST_NGINX_VERBOSE.
+* feature: added support for environment TEST_NGINX_USE_HUP.
+* feature: added support for the TEST_NGINX_POSTPONE_OUTPUT environment.
+* feature: now we'll retry sending the QUIT signal for at most 5 times when the
+ nginx process is refusing to quit. after 5 trials, KILL signal will be sent.
+* feature: exposes the "master_off" API which turns off the nginx master process.
+* feature: added new section "--- ignore_response" to test bad responses.
+* bugfix: Test::Nginx::Socket will retry 10 times if fail to connect because nginx
+ with valgrind can be very slow to start in some systems.
+* feature: added new section name "--- error_log" to test error lines. requested
+ by Piotr Sikora in the last year or so.
+* feature: added the TEST_NGINX_EVENT_TYPE environment to specify an event API type
+ (like "epoll" or "select") when running the test suite.
+
0.17 - 2011-11-04
-* bugfix: do not strip trailing CRCF for response headers in Test::Nginx::Socket's response parser.
-* bugfix: fixed issues in Content-Length response header handling in case of pipelined reqeusts.
+* bugfix: do not strip trailing CRCF for response headers in
+ Test::Nginx::Socket's response parser.
+* bugfix: fixed issues in Content-Length response header handling in case of
+ pipelined reqeusts.
* bugfix: fixed the pipelined_requests section support.
* feature: added support for user file timestamp.
0.16 - 2011-07-07
-* fixed a bug that length(undef) produced lots of warnings on perl 5.10.x. thanks Guo Ying (shrimp).
+* fixed a bug that length(undef) produced lots of warnings on perl 5.10.x.
+ thanks Guo Ying (shrimp).
* now we automatically retry connecting for 3 times (1 sec delay)
in Test::Nginx::Socket::send_request. this will help automatically recovering
from random slow valgrind loading problems.
View
@@ -3,11 +3,12 @@ abstract: 'Testing modules for Nginx C module development'
author:
- 'agentzh (章亦春) C<< <agentzh@gmail.com> >>'
build_requires:
- ExtUtils::MakeMaker: 6.42
+ ExtUtils::MakeMaker: 6.55
configure_requires:
- ExtUtils::MakeMaker: 6.42
+ ExtUtils::MakeMaker: 6.55
distribution_type: module
-generated_by: 'Module::Install version 1.01'
+dynamic_config: 1
+generated_by: 'Module::Install version 1.04'
license: bsd
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -32,8 +33,9 @@ requires:
Test::LongString: 0
Text::Diff: 0
Time::HiRes: 0
+ URI::Escape: 0
perl: 5.6.1
resources:
license: http://opensource.org/licenses/bsd-license.php
repository: http://github.com/agentzh/test-nginx
-version: 0.17
+version: 0.18
View
@@ -17,6 +17,7 @@ requires ('LWP::UserAgent');
requires ('HTTP::Response');
requires ('Fcntl');
requires ('POSIX');
+requires ('URI::Escape');
requires ('IO::Select');
requires ('List::MoreUtils');
requires ('ExtUtils::MakeMaker');
View
20 README
@@ -191,6 +191,9 @@ Nginx C modules that use Test::Nginx to drive their test suites
ngx_rds_json
<http://github.com/agentzh/rds-json-nginx-module>
+ ngx_rds_csv
+ <http://github.com/agentzh/rds-csv-nginx-module>
+
ngx_xss
<http://github.com/agentzh/xss-nginx-module>
@@ -221,6 +224,9 @@ Nginx C modules that use Test::Nginx to drive their test suites
ngx_coolkit
<http://github.com/FRiCKLE/ngx_coolkit>
+ Naxsi
+ <http://code.google.com/p/naxsi/>
+
SOURCE REPOSITORY
This module has a Git repository on Github, which has access for all.
@@ -234,12 +240,10 @@ AUTHORS
Antoine BONAVITA "<antoine.bonavita@gmail.com>"
COPYRIGHT & LICENSE
- Copyright (c) 2009-2011, Taobao Inc., Alibaba Group
- (<http://www.taobao.com>).
-
- Copyright (c) 2009-2011, agentzh "<agentzh@gmail.com>".
+ Copyright (c) 2009-2012, agentzh "<agentzh@gmail.com>".
- Copyright (c) 2011, Antoine Bonavita "<antoine.bonavita@gmail.com>".
+ Copyright (c) 2011-2012, Antoine Bonavita
+ "<antoine.bonavita@gmail.com>".
This module is licensed under the terms of the BSD license.
@@ -254,9 +258,9 @@ COPYRIGHT & LICENSE
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- * Neither the name of the Taobao Inc. nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
+ * Neither the name of the authors nor the names of its contributors
+ may be used to endorse or promote products derived from this
+ software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
View
@@ -7,7 +7,7 @@ use ExtUtils::MakeMaker ();
use vars qw{$VERSION};
BEGIN {
- $VERSION = '1.03';
+ $VERSION = '1.04';
}
# special map on pre-defined feature sets
@@ -17,11 +17,14 @@ my %FeatureMap = (
);
# various lexical flags
-my ( @Missing, @Existing, %DisabledTests, $UnderCPAN, $HasCPANPLUS );
+my ( @Missing, @Existing, %DisabledTests, $UnderCPAN, $InstallDepsTarget, $HasCPANPLUS );
my (
- $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly, $AllDeps
+ $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly, $AllDeps,
+ $UpgradeDeps
);
-my ( $PostambleActions, $PostambleUsed );
+my ( $PostambleActions, $PostambleActionsNoTest, $PostambleActionsUpgradeDeps,
+ $PostambleActionsUpgradeDepsNoTest, $PostambleActionsListDeps,
+ $PostambleActionsListAllDeps, $PostambleUsed, $NoTest);
# See if it's a testing or non-interactive session
_accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN );
@@ -31,6 +34,10 @@ sub _accept_default {
$AcceptDefault = shift;
}
+sub _installdeps_target {
+ $InstallDepsTarget = shift;
+}
+
sub missing_modules {
return @Missing;
}
@@ -63,6 +70,11 @@ sub _init {
__PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) );
exit 0;
}
+ elsif ( $arg =~ /^--upgradedeps=(.*)$/ ) {
+ $UpgradeDeps = 1;
+ __PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) );
+ exit 0;
+ }
elsif ( $arg =~ /^--default(?:deps)?$/ ) {
$AcceptDefault = 1;
}
@@ -125,7 +137,7 @@ sub import {
# check entirely since we don't want to have to load (and configure)
# an old CPAN just for a cosmetic message
- $UnderCPAN = _check_lock(1) unless $SkipInstall;
+ $UnderCPAN = _check_lock(1) unless $SkipInstall || $InstallDepsTarget;
while ( my ( $feature, $modules ) = splice( @args, 0, 2 ) ) {
my ( @required, @tests, @skiptests );
@@ -207,6 +219,7 @@ sub import {
$CheckOnly
or ($mandatory and $UnderCPAN)
or $AllDeps
+ or $InstallDepsTarget
or _prompt(
qq{==> Auto-install the }
. ( @required / 2 )
@@ -237,10 +250,17 @@ sub import {
}
}
- if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
+ if ( @Missing and not( $CheckOnly or $UnderCPAN) ) {
require Config;
- print
-"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";
+ my $make = $Config::Config{make};
+ if ($InstallDepsTarget) {
+ print
+"*** To install dependencies type '$make installdeps' or '$make installdeps_notest'.\n";
+ }
+ else {
+ print
+"*** Dependencies will be installed the next time you type '$make'.\n";
+ }
# make an educated guess of whether we'll need root permission.
print " (You may need to do that as the 'root' user.)\n"
@@ -271,6 +291,10 @@ END_MESSAGE
sub _check_lock {
return unless @Missing or @_;
+ if ($ENV{PERL5_CPANM_IS_RUNNING}) {
+ return _running_under('cpanminus');
+ }
+
my $cpan_env = $ENV{PERL5_CPAN_IS_RUNNING};
if ($ENV{PERL5_CPANPLUS_IS_RUNNING}) {
@@ -332,6 +356,11 @@ sub install {
}
}
+ if ($UpgradeDeps) {
+ push @modules, @installed;
+ @installed = ();
+ }
+
return @installed unless @modules; # nothing to do
return @installed if _check_lock(); # defer to the CPAN shell
@@ -463,6 +492,11 @@ sub _cpanplus_config {
} else {
die "*** Cannot convert option $key = '$value' to CPANPLUS version.\n";
}
+ push @config, 'prereqs', $value;
+ } elsif ( $key eq 'force' ) {
+ push @config, $key, $value;
+ } elsif ( $key eq 'notest' ) {
+ push @config, 'skiptest', $value;
} else {
die "*** Cannot convert option $key to CPANPLUS version.\n";
}
@@ -497,10 +531,14 @@ sub _install_cpan {
# set additional options
while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) {
( $args{$opt} = $arg, next )
- if $opt =~ /^force$/; # pseudo-option
+ if $opt =~ /^(?:force|notest)$/; # pseudo-option
$CPAN::Config->{$opt} = $arg;
}
+ if ($args{notest} && (not CPAN::Shell->can('notest'))) {
+ die "Your version of CPAN is too old to support the 'notest' pragma";
+ }
+
local $CPAN::Config->{prerequisites_policy} = 'follow';
while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
@@ -519,8 +557,16 @@ sub _install_cpan {
delete $INC{$inc};
}
- my $rv = $args{force} ? CPAN::Shell->force( install => $pkg )
- : CPAN::Shell->install($pkg);
+ my $rv = do {
+ if ($args{force}) {
+ CPAN::Shell->force( install => $pkg )
+ } elsif ($args{notest}) {
+ CPAN::Shell->notest( install => $pkg )
+ } else {
+ CPAN::Shell->install($pkg)
+ }
+ };
+
$rv ||= eval {
$CPAN::META->instance( 'CPAN::Distribution', $obj->cpan_file, )
->{install}
@@ -763,6 +809,35 @@ sub _make_args {
: "\$(NOECHO) \$(NOOP)"
);
+ my $deps_list = join( ',', @Missing, @Existing );
+
+ $PostambleActionsUpgradeDeps =
+ "\$(PERL) $0 --config=$config --upgradedeps=$deps_list";
+
+ my $config_notest =
+ join( ',', (UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config}),
+ 'notest', 1 )
+ if $Config;
+
+ $PostambleActionsNoTest = (
+ ($missing and not $UnderCPAN)
+ ? "\$(PERL) $0 --config=$config_notest --installdeps=$missing"
+ : "\$(NOECHO) \$(NOOP)"
+ );
+
+ $PostambleActionsUpgradeDepsNoTest =
+ "\$(PERL) $0 --config=$config_notest --upgradedeps=$deps_list";
+
+ $PostambleActionsListDeps =
+ '@$(PERL) -le "print for @ARGV" '
+ . join(' ', map $Missing[$_], grep $_ % 2 == 0, 0..$#Missing);
+
+ my @all = (@Missing, @Existing);
+
+ $PostambleActionsListAllDeps =
+ '@$(PERL) -le "print for @ARGV" '
+ . join(' ', map $all[$_], grep $_ % 2 == 0, 0..$#all);
+
return %args;
}
@@ -797,24 +872,44 @@ sub Write {
sub postamble {
$PostambleUsed = 1;
+ my $fragment;
- return <<"END_MAKE";
+ $fragment .= <<"AUTO_INSTALL" if !$InstallDepsTarget;
config :: installdeps
\t\$(NOECHO) \$(NOOP)
+AUTO_INSTALL
+
+ $fragment .= <<"END_MAKE";
checkdeps ::
\t\$(PERL) $0 --checkdeps
installdeps ::
\t$PostambleActions
+installdeps_notest ::
+\t$PostambleActionsNoTest
+
+upgradedeps ::
+\t$PostambleActionsUpgradeDeps
+
+upgradedeps_notest ::
+\t$PostambleActionsUpgradeDepsNoTest
+
+listdeps ::
+\t$PostambleActionsListDeps
+
+listalldeps ::
+\t$PostambleActionsListAllDeps
+
END_MAKE
+ return $fragment;
}
1;
__END__
-#line 1071
+#line 1178
View
@@ -31,7 +31,7 @@ BEGIN {
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '1.01';
+ $VERSION = '1.04';
# Storage for the pseudo-singleton
$MAIN = undef;
@@ -451,7 +451,7 @@ sub _version ($) {
}
sub _cmp ($$) {
- _version($_[0]) <=> _version($_[1]);
+ _version($_[1]) <=> _version($_[2]);
}
# Cloned from Params::Util::_CLASS
Oops, something went wrong.

0 comments on commit 12a54ba

Please sign in to comment.