trafficserver-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Peach <>
Subject Re: TDD/Unit testing ATS plugins
Date Tue, 31 Dec 2013 21:53:10 GMT
On Dec 31, 2013, at 8:44 AM, Alan D. Cabrera <> wrote:

> I'm looking for an example of an ATS plugin that has extensive unit tests.

There are none.

> I'm having problems linking my Boost unit tests against the plugin library for obvious
reasons, it's a module not a shared library.
> I tried setting up an internal static library that the tests would link against but can't
seem to get the object files directly included into the ATS plugin.

There's no reason, in principle, that this would not work. For many plugins it would be reasonable
to separate core functions from the Traffic Server bindings, and use a TDD approach for developing
the core.

For the remainder of the tests, I'd recommend an integration testing approach. There is a
very simple integration test harness in the ci/tsqa directory on master. You can use that
to set up an independent ATS installation and drive integration tests through it.

Finally, the core has the concept of "action tags", which are useful for testing, but not
exposed through the API. Action tags would let you test corner cases, by setting tags to force
particular APIs to fail, for example.

View raw message