Antoine Bonavita (personal)
March 16, 2011 05:40AM
Thanks a lot for your time and openness.
I started thinking a little about all this and here are 3 suggestions
which I'm willing to work on if you think they are worth it:

1 - Regarding the ability to chain multiple requests in requests, the
only way I can think of is to make request and
error_code/response_body/response_body_like/etc. potential arrays and
adapt the code to handle arrays/strings. There is probably a lot of
impact on the code but I cannot think of any other way.
2 - Regarding the restart of nginx, I had two ideas:
2.1 - Add a section (--- NO_RESTART). This is probably a very simple
solution but it relies on the order tests are run, so I think it can
be quite error-prone (especially if you shuffle tests and have
different configs).
2.2 - Restart only when the config changes between two tests. This
behavior can even be controlled by something like
TEST_NGINX_FORCE_RESTART_ON_TEST which would happen to default to true
(to preserve current behavior).
3 - Regarding the documentation, I was thinking of improving the doc
of Socket.pm by putting a small example next to each item (at least
the ones I know, I could not figure out the syntax of skip_nginx and
skip_nginx2). And maybe completely removing request_eval.

Let me know what you think.

Antoine,

--
Antoine Bonavita.
Follow my progress with nginx at: <a
href="http://www.nginx-discovery.com">http://www.nginx-discovery.com</a>

On Wed, Mar 16, 2011 at 8:06 AM, agentzh <agentzh@gmail.com> wrote:
> On Tue, Mar 15, 2011 at 11:13 PM, Antoine Bonavita (personal)
> <antoine.bonavita@gmail.com> wrote:
>>
>> I actually wrote a few posts on the migration to Test::Nginx:
>> * http://www.nginx-discovery.com/2011/03/day-32-moving-to-testnginx.html
>> * http://www.nginx-discovery.com/2011/03/day-33-testnginx-pipelinedrequests.html
>>
>
> I've just read through your posts. And I do understand all those
> frustrations involved ;)
>
> You're very welcome to provide patches for bug fixes, new features,
> and documentation and I'm very willing to give you a commit bit to the
> test-nginx repository :)
>
>> * Being able to run multiple requests in one test. The
>> pipelined_requests use the same connection which might not be what I
>> want. I was thinking of something more natural like : send request 1,
>> wait for response 1, check response 1, send request 2, wait for
>> response 2, check response 2, etc.
>>
>
> After reading your posts, I now understand your actual requirement
> here a bit more. In our tests, we usually make use of nginx
> subrequests to achieve similar results, though not exactly the same
> ones:
>
>    === TEST 1:
>    --- config
>         location /foo { ... }
>         location /main {
>              echo_subrequest POST /foo -b 'correct value';
>              echo_subrequest POST /foo -b 'bad value';
>              echo_subrequest POST /foo -b 'correct value';
>         }
>    --- request
>         GET /main
>    --- response_body
>    OK
>    ERROR
>    OK
>
> I agree this is not ideal though ;) We've been using this paradigm extensively.
>
> Cheers,
> -agentzh
>

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Use Test::Nginx with etcproxy and/or valgrind (Was Re: Test::Nginx::LWP vs. Test::Nginx::Socket)

agentzh 3270 March 02, 2011 10:50PM

Re: Use Test::Nginx with etcproxy and/or valgrind (Was Re: Test::Nginx::LWP vs. Test::Nginx::Socket)

Antoine BONAVITA 1067 March 03, 2011 08:58AM

Re: Fw: Use Test::Nginx with etcproxy and/or valgrind (Was Re: Test::Nginx::LWP vs. Test::Nginx::Socket)

Antoine Bonavita (personal) 1023 March 15, 2011 11:14AM

Re: Fw: Use Test::Nginx with etcproxy and/or valgrind (Was Re: Test::Nginx::LWP vs. Test::Nginx::Socket)

agentzh 871 March 16, 2011 02:50AM

Re: Fw: Use Test::Nginx with etcproxy and/or valgrind (Was Re: Test::Nginx::LWP vs. Test::Nginx::Socket)

agentzh 876 March 16, 2011 03:08AM

Re: Fw: Use Test::Nginx with etcproxy and/or valgrind (Was Re: Test::Nginx::LWP vs. Test::Nginx::Socket)

Antoine Bonavita (personal) 914 March 16, 2011 05:40AM

Re: Fw: Use Test::Nginx with etcproxy and/or valgrind (Was Re: Test::Nginx::LWP vs. Test::Nginx::Socket)

agentzh 901 March 16, 2011 11:44PM

Re: Fw: Use Test::Nginx with etcproxy and/or valgrind (Was Re: Test::Nginx::LWP vs. Test::Nginx::Socket)

Antoine Bonavita 1004 March 17, 2011 04:54PM

Re: Fw: Use Test::Nginx with etcproxy and/or valgrind (Was Re: Test::Nginx::LWP vs. Test::Nginx::Socket)

agentzh 1137 March 17, 2011 11:36PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 234
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready