#889·k8sgpt

Increase Analysers' test coverage

Author: arbreezyCreated Jan 24, 2024Updated Aug 31, 2026

K8sGPT analysers are the first step of K8sGPT analysis whereby we scan K8s clusters and identify issues with K8s resources. To gain more confidence every analyser should come with its own unit testing of various use cases we aim to identify.

There are a few analysers that have either limited or absent unit tests. The goal of this work is to increase code coverage of K8sGPT analysers by mocking a K8s environment. e.g Statefulset analyser

Here is a non-exhaustive list but a rather good start of enhancing or adding unit testing.

  • validating webhook
  • pvc
  • replicaset
  • events
  • logs analyser
  • analyzers' wrapper functions