From: Andy Grundman Date: Mon, 24 Oct 2005 02:47:13 +0000 (+0000) Subject: Added a simple stress test that hits every URI in the test suite X-Git-Tag: 5.7099_04~1111 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=ec54df42267dea495c23522cafc72b5bb282dd9a;hp=2ec03726337ab41e0feb274eab238d7883055e3f Added a simple stress test that hits every URI in the test suite --- diff --git a/MANIFEST b/MANIFEST index 6088c95..f7fda5e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -114,6 +114,8 @@ t/optional/apache-cgi.pl t/optional/apache-fastcgi.pl t/optional/http-server-restart.t t/optional/http-server.t +t/optional/stress.t +t/optional/stress.yml t/unit/core/component.t t/unit/core/threads.t t/unit/core/uri_for.t diff --git a/t/optional/stress.t b/t/optional/stress.t new file mode 100644 index 0000000..10ee561 --- /dev/null +++ b/t/optional/stress.t @@ -0,0 +1,35 @@ +#!perl + +use strict; +use warnings; + +use FindBin; +use lib "$FindBin::Bin/../live/lib"; + +use Test::More; +use Catalyst::Test 'TestApp'; +use YAML; + +our ($iters, $tests); +BEGIN { + plan skip_all => 'set CAT_STRESS to enable this test' unless $ENV{CAT_STRESS}; + + $iters = $ENV{CAT_STRESS} || 10; + $tests = YAML::LoadFile( "$FindBin::Bin/stress.yml" ); + + my $total_tests = 0; + map { $total_tests += scalar @{ $tests->{$_} } } keys %{$tests}; + plan tests => $iters * $total_tests; +} + +for ( 1 .. $iters ) { + run_tests(); +} + +sub run_tests { + foreach my $test_group ( keys %{$tests} ) { + foreach my $test ( @{ $tests->{$test_group} } ) { + ok( request( $test ), $test_group . ' - ' . $test ); + } + } +} diff --git a/t/optional/stress.yml b/t/optional/stress.yml new file mode 100644 index 0000000..a3a9e61 --- /dev/null +++ b/t/optional/stress.yml @@ -0,0 +1,106 @@ +--- +component/controller/action/auto: + - http://localhost/action/auto/one + - http://localhost/action/auto/anything + - http://localhost/action/auto/deep/one + - http://localhost/action/auto/deep/anything + - http://localhost/action/auto/abort/one + - http://localhost/action/auto/abort/anything +component/controller/action/begin: + - http://localhost/action/begin +component/controller/action/default: + - http://localhost/action/default + - http://localhost/foo/bar/action + - http://localhost/action/default/arg1/arg2 +component/controller/action/detach: + - http://localhost/action/detach/one + - http://localhost/action/detach/path + - http://localhost/action/detach/with_args/old + - http://localhost/action/detach/with_method_and_args/old +component/controller/action/end: + - http://localhost/action/end +component/controller/action/forward: + - http://localhost/action/forward/global + - http://localhost/action/forward/one + - http://localhost/action/forward/jojo + - http://localhost/action/forward/with_args/old + - http://localhost/action/forward/with_method_and_args/old + - http://localhost/action/forward/args_embed_relative + - http://localhost/action/forward/args_embed_absolute +component/controller/action/global: + - http://localhost/action_global_one + - http://localhost/action_global_two + - http://localhost/action_global_three +component/controller/action/index: + - http://localhost/ + - http://localhost + - http://localhost/index/ + - http://localhost/index + - http://localhost/action/index/ + - http://localhost/action/index + - http://localhost/action/index/foo +component/controller/action/inheritance: + - http://localhost/action/inheritance + - http://localhost/action/inheritance/a + - http://localhost/action/inheritance/a/b +component/controller/action/local: + - http://localhost/action/local/one + - http://localhost/action/local/two + - http://localhost/action/local/three + - http://localhost/action/local/four/five/six +component/controller/action/multipath: + - http://localhost/action/multipath/multipath + - http://localhost/multipath + - http://localhost/multipath1 + - http://localhost/action/multipath/multipath2 +component/controller/action/path: + - http://localhost/action/path/a + - path + - with + - spaces + - http://localhost/action/path/åäö +component/controller/action/private: + - http://localhost/action/private/one + - http://localhost/action/private/two + - http://localhost/three + - http://localhost/action/private/four + - http://localhost/action/private/five +component/controller/action/regexp: + - http://localhost/action/regexp/10/hello + - http://localhost/action/regexp/hello/10 +component/controller/action/streaming: + - http://localhost/streaming + - http://localhost/action/streaming/body +engine/request/body: [] +engine/request/cookies: [] +engine/request/headers: [] +engine/request/parameters: [] +engine/request/uploads: [] +engine/request/uri: + - http://localhost/engine/request/uri/change_path + - http://localhost/engine/request/uri/change_base + - http://localhost/engine/request/uri + - http://localhost/engine/request/uri?a=1;a=2;b=3 + - http://localhost/engine/request/uri?text=Catalyst%20Rocks +engine/response/cookies: + - http://localhost/engine/response/cookies/one + - http://localhost/engine/response/cookies/two +engine/response/errors: + - http://localhost/engine/response/errors/one + - http://localhost/engine/response/errors/two + - http://localhost/engine/response/errors/three +engine/response/headers: + - http://localhost/engine/response/headers/one +engine/response/large: + - http://localhost/engine/response/large/ +engine/response/redirect: + - http://localhost/engine/response/redirect/one + - http://localhost/engine/response/redirect/two + - http://localhost/engine/response/redirect/three + - http://localhost/engine/response/redirect/four +engine/response/status: + - http://localhost/engine/response/status/s200 + - http://localhost/engine/response/status/s400 + - http://localhost/engine/response/status/s403 + - http://localhost/engine/response/status/s404 + - http://localhost/engine/response/status/s500