Welcome! Log In Create A New Profile

Advanced

Re: Unit testing approach for nginx modules

Yichun Zhang (agentzh)
November 24, 2015 09:12AM
Hello!

On Sun, Nov 22, 2015 at 5:40 AM, Ritesh Jha <ritesh.jha@hotmail.com> wrote:
> Hello everyone,
> We are developing nginx modules to implement few usecases in our product.
> Most of the other usecases cases have been implemented using Java. At my
> office we follow TDD for Java development. TDD for Java development is easy
> due to availability of unit-testing and mocking frameworks. We are wondering
> if we can follow TDD for development of nginx modules as well. We have tried
> couple of unit-testing frameworks for C (Unity and CMocka) but we have found
> it very difficult to write useful testcases using these frameworks.
>
> Can you please suggest a suitable approach? Also if unit testing is not the
> way to go, then what should be the approach for developing, testing and
> maintaining large nginx modules?
>

I've been using my Test::Nginx module on CPAN for all my nginx
modules' test suite for years:

https://metacpan.org/pod/Test::Nginx::Socket

We've also been using subclasses of this test framework to drive
CloudFlare's Lua business systems' test suites :)

Almost all the test suites of the NGINX components listed in the
following page for my Amazon EC2 test cluster's test report are driven
by Test::Nginx:

http://qa.openresty.org

All these opensource modules' test suites can serve as live examples.

Oh yeah, we definitely need more hands-on tutorials to explain all the
powerful features of this test framework. I'll write up something soon
:)

Best regards,
-agentzh

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

Unit testing approach for nginx modules

Ritesh Jha 555 November 21, 2015 04:42PM

Re: Unit testing approach for nginx modules

Maxim Dounin 310 November 22, 2015 07:44PM

Re: Unit testing approach for nginx modules

Anatoli Marinov 305 November 23, 2015 09:48AM

Re: Unit testing approach for nginx modules

Yichun Zhang (agentzh) 471 November 24, 2015 09:12AM



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

Online Users

Guests: 132
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