UNCLASSIFIED - NO CUI

Skip to content

cmd/values: add test coverage

Daniel Dides requested to merge dd/values-testing into main

General MR

Summary

I wanted to increase test coverage for the cmd/values function and noticed that a few of our packages could use improvements to make them testable.

This MR:

  • Refactors constants.go to be more testable and allow downstream consumers to inject mock clients if desired
  • Adds in mockery (as well as a script and make target) to generate testify/mock compatible test fixtures
  • Refactors cmd/values.go to be allow more test injections
  • Adds additional testing hooks and methods to the FakeFactory and the FakeHelmClient to allow method overriding to force errors
  • Increases test coverage of values from ~70% to 90%

Relevant logs/screenshots

Before

Screenshot_2024-06-11_at_5.57.15_PM

Linked Issue

After

Screenshot_2024-06-14_at_11.48.02_AM

Closes #57 (closed) Closes #62 (closed)

Upgrade Notices

N/A

Edited by Daniel Dides

Merge request reports