Over the past 6 months I’ve developed the Custom Pod Autoscaler Framework (CPA), an open source framework for building autoscalers in Kubernetes, similar to the Horizontal Pod Autoscaler. As part of this I built the Predictive Horizontal Pod Autoscaler (PHPA) which is in pre-release to provide predictive autoscaling functionality ontop of the Horizontal Pod Autoscaler using statistical models.
I’ve been writing unit tests for jthomperoo/custom-pod-autoscaler, and I needed to write unit tests for some functions that used the
exec.Command in Go. Outlined below is the method for writing these tests.
All code in this article can be found in jthomperoo/test-exec-command-golang .
I’ve been trying to learn how collision detection works; this lead me to the Gilbert-Johnson-Keerthi (GJK) algorithm.
All code samples in this post are in TypeScript. The code samples make use of some structures I have created and won’t detail in this post, but they are simple and you can see them in the GitHub repo: