Add coverage checks

This commit adds a makefile target for generating a report for unit test
coverage. It also adds the coverage_check tool to assert that the actual
test coverage meets the specified requirement.

This also improves various aspects of the testing utilities:
* The "test" package has been renamed to "testutil"
* The "Objs" member has been removed from the CmdTest object
* The "Cmd" member has been added to the CmdTest object. This allows
  testing of multiple variants of a root airshipctl command

Finally, this commit includes additional tests for root.go. These are
required in order to meet the required coverage threshold.

Change-Id: Id48343166c0488c543a405ec3143e4a75355ba43
This commit is contained in:
Ian Howell
2019-07-11 08:29:15 -05:00
parent 7c8ee26de4
commit 1c999e2095
9 changed files with 140 additions and 27 deletions

View File

@@ -0,0 +1,20 @@
airshipctl is a unified entrypoint to various airship components
Usage:
airshipctl [command]
Available Commands:
argo argo is the command line interface to Argo
bootstrap bootstraps airshipctl
completion Generate autocompletions script for the specified shell (bash or zsh)
help Help about any command
kubeadm kubeadm: easily bootstrap a secure Kubernetes cluster
kubectl kubectl controls the Kubernetes cluster manager
kustomize Build a kustomization target from a directory or a remote url.
version Show the version number of airshipctl
Flags:
--debug enable verbose output
-h, --help help for airshipctl
Use "airshipctl [command] --help" for more information about a command.

View File

@@ -0,0 +1,15 @@
airshipctl is a unified entrypoint to various airship components
Usage:
airshipctl [command]
Available Commands:
bootstrap bootstraps airshipctl
help Help about any command
version Show the version number of airshipctl
Flags:
--debug enable verbose output
-h, --help help for airshipctl
Use "airshipctl [command] --help" for more information about a command.