Test::Stream going stable
Test-Stream, the intended successor of Test-Simple (Test::Builder, Test::More), is moving out of the experimental phase. The experimental notice has been removed from all but a couple modules in the distribution. Now is a good time to start writing new testing tools using Test-Streams capabilities.
What does this mean for Test::More, Test::Builder or my existing test tools?
At the moment it means very little. Test::Builder is still around, and not going anywhere any time soon. At the moment Test::Builder based tools and Test::Stream based tools will not work together in a single test script, though they can both be used in different files in a single test suite.
Will Test::Stream and Test::Builder tools work together?
Not with the current stable Test::Builder release. However the latest developer release changes that. With the developer release most Test::Builder and Test::Stream tools will play nicely together. The exception is with tools that rely on replacing or modifying the Test::Builder singleton itself. Tools that modify the Test::Builder singleton will still work as expected for most situations, but will likely have no effect (desired or undesired) on tools that do not also use Test::Builder.
What is the future for Test::Builder?
The current dev releases of Test::Builder change it so that under the hood it uses Test::Stream. These changes are fairly significant, and could be seen as scary. These changes effectively turn Test::Builder into a compatibility wrapper around Test::Stream. I plan to release these changes once the perl-qa group, Ricardo Signes, and I all agree it is ready and stable. This process is called the "punchlist" and was devised at the 2015 perl-qa hackathon in Berlin. Several things have changed, so the punchlist is no longer completely accurate, but is good enough to explain what has to happen before these changes go stable.
How can I help?
Start writing new testing tools that use Test::Stream. You could also update existing test tools to work as plugins for Test::Stream. At the moment a full conversion of an old tool is not recommended, since Test::Stream and Test::Builder do not yet work together you can cause a lot of headaches and breakages by simply converting a tool. Instead it would be better to abstract the tools logic so that the main module continues to use Test::Builder, and the plugin form (Test::Stream::Plugin::YourModule) uses Test::Stream.
You can also help by testing the Test::Builder dev release. 'cpanm --dev Test::More' will install the dev release, and the latest version of Test::Stream along with it.
Where can I find out more about Test::Stream?
- Test::Stream for people writing tests
- Test::Stream for people writing tools
- Test::Stream for people interested in the internals
Why should I use Test::Stream?
Test::Builder and Test::More have been around for a long time, and have proven their worth. On the other hand it has been years since they saw any significant development. In addition there is a multitude of tools that have to hack Test::Builder to make it do what they want.
Test::Stream addresses most, if not all, the limitations and complaints about Test::Builder. Test::Stream has more capabilities and hooks for people writing tools. In addition Test::Stream provides an improved API for people writing tests, one that still looks and feels like Test::More, but makes changes that cannot be made in Test::More itself for compatibility reasons.
Leave a comment