Setting up Unit Tests and a proper Git Flow (CI/CD) and upcoming features


Wue - The SEO friendly Vue.js WordPress Theme is getting complex and fancy / high-tech / cutting-edge

Hey guys, the last two weeks I’ve spend on a proper product development setup with an appropriate Git Flow and Unit Testing.

Why looking for the right git flow and caring about unit tests?

I’ve never worked within a proper developer team. Throughout my whole developer carrier I was freelancing as a lonely wolf and was responsible for choosing the right technology and tools myself. As all of my WordPress projects so far were quite easy to maintain, to debug and to update I was just using a simple git workflow working only within the master branch and was testing all the changes manually in the web browser and on different devices – which was always more than enough so far if only executing once the project is done. Thus git was to me “just” a cool tool to backup and to deploy projects quick and easily to the live/staging server and I’ve successfully avoided writing unit tests.

But working on the Wue Theme I’ve now reached the limitations of this approach. First the app has got so many fancy features, that some changes in one component / script might cause bugs in some other without having me noticing it when manually testing the new features in the browser or browser stack. But I can’t just run manual tests for the whole app on all devices each time I implement any new feature due to the growing number of functionalities. So I need an automation of testing.

Second thing: the previous git approach does not fulfil the requirements of a proper versioned software. I needed two branches for staging environment and production for this site and a branching strategy for the features.

Both was huge pain in the ass to figure out the right concept for my custom needs. But now I’ve implemented great working strategies and next weeks there should be a lot of stuff get done, e.g:

Loading routes after the initial load dropped literally to ZERO!!! (using asynchronous preload of related/important posts/pages)

Improved custom endpoints for anything

as the default WP REST API Endpoints queries to much (at least in case of the Wue Theme) useless stuff, which has dropped the loading time for huge collections by factor 8-10 from 10 seconds to almost 1 second (requisting 160 dummy posts) on my local machine, which means on a proper dedicated or at least a VPS server it should need even less time.

Some cool UI improvement

Polylang support

Comments