I’m no regular WordPress Plugin Developer – I spend most of my day managing projects or other stuff. So when I do develop, I want a trusted, reliable, repeatable workflow setup that is always testing, always building and always telling me whats going on. That’s why I believe in Continuous Integration … and why I’ve turned to Jenkins as my CI Tool and use Apache Ant and Selenium for testing.
A bit of background on Continuous Integration and Tools
Continuous Integration is a fundamentally different approach to software development where the project team work to continuously test as you build software. This leads to quicker feedback to developers and that means bugs can be fixed immediately. Ultimately, once something is tested, then it could be integrated or delivered into production.
In layman’s terms — rather than a waterfall approach to software like – – developing, testing, fixing, testing, fixing, preparing to deliver, deliver, fixing .. you can remove some of your testing & fixing cycles.
CI tools like Jenkins have been around for a few years now … and for me, automated testing with Selenium (a web browser automated test suite) means I can create user experience based tests for my plugins. At the heart of this is Git for source code management and Bitbucket which hosts all my code – these 2 ‘tools’ drive everything else.
While I use Selenium to manage the ‘user experience’ testing, I’ve come to rely on Apache Ant for grunt work – things like deleting temp files before running tests and creating my plugin .zip archives.
Getting started with Continuous Integration
The basic principle is — every time you commit new code, it gets tested. This testing is run continuously and I get instant feedback on my code. I’ve already done a unit test on my Macbook Pro (developer environment, setup with MAMP) and checked that the code works before committing it to the source code repository.
If the basic user experience test pasts, then a longer test is run with extra scenarios like activate the plugin, add a page and check that WordPress and the plugin functions as expected.
Every successful plugin test is saved / compiled as a .zip file and is then ready for me to transfer to my website for you all to use.
So .. today, all my plugins now have a suite of tests running — and before any plugin gets released to you … it’s passed a number of automated tests and checks, which mean I don’t cut corners.