Kuadrant / kuadrantctl

Kuadrant configuration command line utility
Apache License 2.0
6 stars 13 forks source link

Command tests #24

Closed eguzki closed 2 years ago

eguzki commented 2 years ago

This PR adds test coverage to the current implemented commands:

Still missing tests for version and uninstall commands.

To test CLI commands built with cobra, some refactor was needed to avoid parsing command line flags at package init time.

Tests, which are implementing an integration approach testing, require k8s to be running.

The install command test runs on kuadrant-system namespace, but the remaining tests run isolated in dynamically created namespaces.

Ginkgo together with Omega (the matching library) have been used to implement the tests.

Additionally, adds generate coverage report and upload to codecov.io

This PR is built on #23. So, first #23 should be merged and then, rebase this PR to main.

codecov-commenter commented 2 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (refactor-api-create@195c93f). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@                  Coverage Diff                   @@
##             refactor-api-create      #24   +/-   ##
======================================================
  Coverage                       ?   31.75%           
======================================================
  Files                          ?       15           
  Lines                          ?      803           
  Branches                       ?        0           
======================================================
  Hits                           ?      255           
  Misses                         ?      507           
  Partials                       ?       41           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 195c93f...e80ab2f. Read the comment docs.