fluxcd-flux2/cmd/flux
Allen Porter 351d287d88 Add tests for flux trace command
Add tests for flux trace command that fake out the kubernetes client,
load objects from a yaml file and create them in the client, and
assert on the output of the trace command to an expected golden file.

This is a follow up from the suggestions in PR https://github.com/fluxcd/flux2/pull/1626 which suggested that additional
testing would be helpful. This test approach is modeled after the helm command tests.

This required some changes to the kubernetes client setup to make it
possible to use a fake. If we agree this pattern makes sense, it can be
applied to other commands.

Signed-off-by: Allen Porter <allen@thebends.org>
2021-08-03 06:35:13 -07:00
..
testdata/trace Add tests for flux trace command 2021-08-03 06:35:13 -07:00
alert.go Format go imports 2021-04-07 16:40:16 +01:00
alert_provider.go Format go imports 2021-04-07 16:40:16 +01:00
bootstrap.go chore: remove deprecated io/ioutil 2021-07-30 20:51:46 +02:00
bootstrap_git.go chore: remove deprecated io/ioutil 2021-07-30 20:51:46 +02:00
bootstrap_github.go chore: remove deprecated io/ioutil 2021-07-30 20:51:46 +02:00
bootstrap_gitlab.go chore: remove deprecated io/ioutil 2021-07-30 20:51:46 +02:00
check.go Tidy up command descriptions 2021-03-26 10:20:42 +01:00
completion.go Rename gotk binary to flux 2020-10-29 16:25:16 +01:00
completion_bash.go Tidy up command descriptions 2021-03-26 10:20:42 +01:00
completion_fish.go Tidy up command descriptions 2021-03-26 10:20:42 +01:00
completion_powershell.go Tidy up command descriptions 2021-03-26 10:20:42 +01:00
completion_zsh.go Tidy up command descriptions 2021-03-26 10:20:42 +01:00
create.go Refactor cmd global variables into structs 2021-01-22 10:42:31 +01:00
create_alert.go Switch StringArrayVar flags to use StringSliceVar 2021-05-06 10:09:36 +01:00
create_alertprovider.go Tidy up command descriptions 2021-03-26 10:20:42 +01:00
create_helmrelease.go chore: remove deprecated io/ioutil 2021-07-30 20:51:46 +02:00
create_image.go Tidy up command descriptions 2021-03-26 10:20:42 +01:00
create_image_policy.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
create_image_repository.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
create_image_update.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
create_kustomization.go Switch StringArrayVar flags to use StringSliceVar 2021-05-06 10:09:36 +01:00
create_receiver.go Switch StringArrayVar flags to use StringSliceVar 2021-05-06 10:09:36 +01:00
create_secret.go Add sourcesecret and kustomization manifestgen 2021-02-26 16:58:41 +01:00
create_secret_git.go Fix yq example for create secret git 2021-06-11 12:58:46 +03:00
create_secret_helm.go Tidy up command descriptions 2021-03-26 10:20:42 +01:00
create_secret_tls.go Tidy up command descriptions 2021-03-26 10:20:42 +01:00
create_source.go Rename gotk binary to flux 2020-10-29 16:25:16 +01:00
create_source_bucket.go chore: remove deprecated io/ioutil 2021-07-30 20:51:46 +02:00
create_source_git.go chore: remove deprecated io/ioutil 2021-07-30 20:51:46 +02:00
create_source_helm.go chore: remove deprecated io/ioutil 2021-07-30 20:51:46 +02:00
create_tenant.go Tidy up command descriptions 2021-03-26 10:20:42 +01:00
delete.go Refactor cmd global variables into structs 2021-01-22 10:42:31 +01:00
delete_alert.go Format go imports 2021-04-07 16:40:16 +01:00
delete_alertprovider.go Format go imports 2021-04-07 16:40:16 +01:00
delete_helmrelease.go Format go imports 2021-04-07 16:40:16 +01:00
delete_image.go Rename flux delete auto to flux delete image 2021-02-04 11:57:40 +00:00
delete_image_policy.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
delete_image_repository.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
delete_image_update.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
delete_kustomization.go Format go imports 2021-04-07 16:40:16 +01:00
delete_receiver.go Format go imports 2021-04-07 16:40:16 +01:00
delete_source.go Rename gotk binary to flux 2020-10-29 16:25:16 +01:00
delete_source_bucket.go Format go imports 2021-04-07 16:40:16 +01:00
delete_source_git.go Format go imports 2021-04-07 16:40:16 +01:00
delete_source_helm.go Format go imports 2021-04-07 16:40:16 +01:00
docgen.go Remove ' command' from Flux CLI docs title 2021-05-06 08:52:36 +02:00
export.go Refactor all remaining create, delete, export, get command to use adapter 2021-03-25 21:54:58 +01:00
export_alert.go Format go imports 2021-04-07 16:40:16 +01:00
export_alertprovider.go Format go imports 2021-04-07 16:40:16 +01:00
export_helmrelease.go Format go imports 2021-04-07 16:40:16 +01:00
export_image.go Rename "auto" subcommands to "image" 2020-12-11 16:34:18 +00:00
export_image_policy.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
export_image_repository.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
export_image_update.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
export_kustomization.go Format go imports 2021-04-07 16:40:16 +01:00
export_receiver.go Format go imports 2021-04-07 16:40:16 +01:00
export_secret.go Format go imports 2021-04-07 16:40:16 +01:00
export_source.go Rename gotk binary to flux 2020-10-29 16:25:16 +01:00
export_source_bucket.go Format go imports 2021-04-07 16:40:16 +01:00
export_source_git.go Format go imports 2021-04-07 16:40:16 +01:00
export_source_helm.go Format go imports 2021-04-07 16:40:16 +01:00
get.go add an example to the status-selector flag's description 2021-07-07 14:21:26 +07:00
get_alert.go implement status selector 2021-07-06 22:59:03 +07:00
get_alertprovider.go implement status selector 2021-07-06 22:59:03 +07:00
get_all.go Add get all command 2021-04-21 15:45:38 +01:00
get_helmrelease.go implement status selector 2021-07-06 22:59:03 +07:00
get_image.go Add support for getting resources by name 2021-02-05 16:35:23 +02:00
get_image_all.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
get_image_policy.go implement status selector 2021-07-06 22:59:03 +07:00
get_image_repository.go implement status selector 2021-07-06 22:59:03 +07:00
get_image_update.go implement status selector 2021-07-06 22:59:03 +07:00
get_kustomization.go implement status selector 2021-07-06 22:59:03 +07:00
get_receiver.go implement status selector 2021-07-06 22:59:03 +07:00
get_source.go Add support for getting resources by name 2021-02-05 16:35:23 +02:00
get_source_all.go Add get all command 2021-04-21 15:45:38 +01:00
get_source_bucket.go implement status selector 2021-07-06 22:59:03 +07:00
get_source_chart.go implement status selector 2021-07-06 22:59:03 +07:00
get_source_git.go implement status selector 2021-07-06 22:59:03 +07:00
get_source_helm.go implement status selector 2021-07-06 22:59:03 +07:00
helmrelease.go Format go imports 2021-04-07 16:40:16 +01:00
image.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
install.go chore: remove deprecated io/ioutil 2021-07-30 20:51:46 +02:00
kustomization.go Format go imports 2021-04-07 16:40:16 +01:00
log.go Add Warningf to logger interface amd impl 2021-04-08 10:48:27 +03:00
logs.go Update flux logs examples 2021-03-18 11:10:21 +01:00
main.go Add tests for flux trace command 2021-08-03 06:35:13 -07:00
manifests.embed.go Improve build process embedded manifests 2021-03-08 16:06:44 +01:00
object.go Implement get all for sources and images 2021-03-18 13:00:49 +02:00
receiver.go Format go imports 2021-04-07 16:40:16 +01:00
reconcile.go Format go imports 2021-04-07 16:40:16 +01:00
reconcile_alert.go Format go imports 2021-04-07 16:40:16 +01:00
reconcile_alertprovider.go Format go imports 2021-04-07 16:40:16 +01:00
reconcile_helmrelease.go Fix reconcile with source in a different namespace 2021-04-16 08:53:30 +01:00
reconcile_image.go Rename "auto" subcommands to "image" 2020-12-11 16:34:18 +00:00
reconcile_image_repository.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
reconcile_image_updateauto.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
reconcile_kustomization.go Fix reconcile with source in a different namespace 2021-04-16 08:53:30 +01:00
reconcile_receiver.go Format go imports 2021-04-07 16:40:16 +01:00
reconcile_source.go Rename gotk binary to flux 2020-10-29 16:25:16 +01:00
reconcile_source_bucket.go Format go imports 2021-04-07 16:40:16 +01:00
reconcile_source_git.go Format go imports 2021-04-07 16:40:16 +01:00
reconcile_source_helm.go Format go imports 2021-04-07 16:40:16 +01:00
reconcile_with_source.go Fix reconcile with source in a different namespace 2021-04-16 08:53:30 +01:00
resume.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
resume_alert.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
resume_helmrelease.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
resume_image.go Rename "auto" subcommands to "image" 2020-12-11 16:34:18 +00:00
resume_image_repository.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
resume_image_updateauto.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
resume_kustomization.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
resume_receiver.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
resume_source.go Add resume source commands 2020-11-26 16:40:54 +02:00
resume_source_bucket.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
resume_source_chart.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
resume_source_git.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
resume_source_helm.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
source.go Implement get all for sources and images 2021-03-18 13:00:49 +02:00
status.go Move StatusChecker to separate and generic pkg 2021-03-15 11:41:02 +01:00
suspend.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
suspend_alert.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
suspend_helmrelease.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
suspend_image.go Rename "auto" subcommands to "image" 2020-12-11 16:34:18 +00:00
suspend_image_repository.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
suspend_image_updateauto.go Use image API v1beta1 2021-06-28 16:20:05 +01:00
suspend_kustomization.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
suspend_receiver.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
suspend_source.go Add suspend source commands 2020-11-26 16:22:47 +02:00
suspend_source_bucket.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
suspend_source_chart.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
suspend_source_git.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
suspend_source_helm.go Adds suspend and resume all cmd 2021-04-28 10:44:51 +01:00
trace.go Add tests for flux trace command 2021-08-03 06:35:13 -07:00
trace_test.go Add tests for flux trace command 2021-08-03 06:35:13 -07:00
uninstall.go Tidy up command descriptions 2021-03-26 10:20:42 +01:00
version.go Embed the install manifests in flux binary 2021-02-25 12:53:04 +02:00