Added a simple stress test that hits every URI in the test suite
Andy Grundman [Mon, 24 Oct 2005 02:47:13 +0000 (02:47 +0000)]
MANIFEST
t/optional/stress.t [new file with mode: 0644]
t/optional/stress.yml [new file with mode: 0644]

index 6088c95..f7fda5e 100644 (file)
--- 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 (file)
index 0000000..10ee561
--- /dev/null
@@ -0,0 +1,35 @@
+#!perl\r
+\r
+use strict;\r
+use warnings;\r
+\r
+use FindBin;\r
+use lib "$FindBin::Bin/../live/lib";\r
+\r
+use Test::More;\r
+use Catalyst::Test 'TestApp';\r
+use YAML;\r
+\r
+our ($iters, $tests);\r
+BEGIN { \r
+    plan skip_all => 'set CAT_STRESS to enable this test' unless $ENV{CAT_STRESS};\r
+    \r
+    $iters = $ENV{CAT_STRESS} || 10;\r
+    $tests = YAML::LoadFile( "$FindBin::Bin/stress.yml" );\r
+    \r
+    my $total_tests = 0;\r
+    map { $total_tests += scalar @{ $tests->{$_} } } keys %{$tests};\r
+    plan tests => $iters * $total_tests;\r
+}\r
+\r
+for ( 1 .. $iters ) {\r
+    run_tests();\r
+}\r
+\r
+sub run_tests {\r
+    foreach my $test_group ( keys %{$tests} ) {\r
+        foreach my $test ( @{ $tests->{$test_group} } ) {\r
+            ok( request( $test ), $test_group . ' - ' . $test );\r
+        }\r
+    }\r
+}\r
diff --git a/t/optional/stress.yml b/t/optional/stress.yml
new file mode 100644 (file)
index 0000000..a3a9e61
--- /dev/null
@@ -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