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:
20
cmd/testdata/TestRootGoldenOutput/rootCmd-with-defaults.golden
vendored
Normal file
20
cmd/testdata/TestRootGoldenOutput/rootCmd-with-defaults.golden
vendored
Normal 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.
|
||||
15
cmd/testdata/TestRootGoldenOutput/specialized-rootCmd-with-bootstrap.golden
vendored
Normal file
15
cmd/testdata/TestRootGoldenOutput/specialized-rootCmd-with-bootstrap.golden
vendored
Normal 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.
|
||||
Reference in New Issue
Block a user