Personal Programming Notes

To err is human; to debug, divine.

Jenkins Pipeline Unit Testing

Jenkins shared library is a powerful way for sharing Groovy code between multiple Jenkins pipelines. However, when many Jenkins pipelines, including mission-critical deployment pipelines, depend on such shared libraries, automated testing becomes necessary to prevent regressions whenever new changes are introduced into shared librariers. Despite its drawbacks, the third-party Pipeline Unit Testing framework satisfies some of automated testing needs. It would allow you to do mock execution of pipeline steps and checking for expected behaviors before actually running in Jenkins. However, documentation for this third-party framework is severely lacking (mentioned briefly here) and it is one of many reasons that unit testing for Jenkins shared libraries is usually an after-thought, instead of being integrated early. In this blog post, we will see how to do unit testing for Jenkins shared library with the Pipeline Unit Testing framework.

Design Patterns for Container-based Distributed Systems

In early and mid-1990s, object-oriented programming (OOP) revolutionized software development by dividing applications into modular components as objects and classes. Today, the rise of microservice architectures and containerization technologies enable a similar revolution in developing distributed systems and SaaS/PaaS products. “Containers” and “container images” are analogus to “objects” and “classes” in OOP, respectively, as a unit of development and deployment in distributed systems. In this paper, the authors argued that just like Design Patterns for Object-Oriented Programming, codified in the famous “Gang of Four” book, some Design Patterns have emerged for Container-based Distributed Systems. In the same paper, the authors attempted to do something similar, documenting the most common patterns and their usage.

Minikube in Corporate VPN

If you are connected to corporate VPN via Cisco’s AnyConnect client, you might have problem with starting Minikube.

tdongsi$ minikube start --disk-size=50g --kubernetes-version=v1.8.0
Starting local Kubernetes v1.8.0 cluster...
Starting VM...
Downloading Minikube ISO
 140.01 MB / 140.01 MB [============================================] 100.00% 0s


TCP Ping

This post explains a work-around for pinging hosts in network where ICMP requests are blocked.