From 83a156d72b6d5dbb98b89a9e3155831741d2c032 Mon Sep 17 00:00:00 2001 From: Andrew Keesler Date: Wed, 11 Nov 2020 07:51:51 -0500 Subject: [PATCH] Enable debug logging in all testing scenarios It is really helpful to have verbose logs during test debugging. Signed-off-by: Andrew Keesler --- cmd/local-user-authenticator/main.go | 5 +++++ hack/lib/tilt/Tiltfile | 2 ++ hack/prepare-for-integration-tests.sh | 2 ++ 3 files changed, 9 insertions(+) diff --git a/cmd/local-user-authenticator/main.go b/cmd/local-user-authenticator/main.go index c4dd9db8..bd00bf36 100644 --- a/cmd/local-user-authenticator/main.go +++ b/cmd/local-user-authenticator/main.go @@ -395,6 +395,11 @@ func run() error { } func main() { + // Hardcode the logging level to debug, since this is a test app and it is very helpful to have + // verbose logs to debug test failures. + if err := plog.ValidateAndSetLogLevelGlobally(plog.LevelDebug); err != nil { + klog.Fatal(err) + } if err := run(); err != nil { klog.Fatal(err) } diff --git a/hack/lib/tilt/Tiltfile b/hack/lib/tilt/Tiltfile index 767582c8..9358451d 100644 --- a/hack/lib/tilt/Tiltfile +++ b/hack/lib/tilt/Tiltfile @@ -95,6 +95,7 @@ k8s_yaml(local([ '--data-value', 'namespace=supervisor', '--data-value', 'image_repo=image/supervisor', '--data-value', 'image_tag=tilt-dev', + '--data-value', 'log_level=debug', '--data-value-yaml', 'replicas=1', '--data-value-yaml', 'service_http_nodeport_port=80', '--data-value-yaml', 'service_http_nodeport_nodeport=31234', @@ -142,6 +143,7 @@ k8s_yaml(local([ '--data-value image_tag=tilt-dev ' + '--data-value kube_cert_agent_image=debian:10.6-slim ' + '--data-value discovery_url=$(TERM=dumb kubectl cluster-info | awk \'/Kubernetes master/ {print $NF}\') ' + + '--data-value log_level=debug ' + '--data-value-yaml replicas=1 ' + '--data-value-yaml "custom_labels={myConciergeCustomLabelName: myConciergeCustomLabelValue}"' ])) diff --git a/hack/prepare-for-integration-tests.sh b/hack/prepare-for-integration-tests.sh index e8512827..d3d7cb24 100755 --- a/hack/prepare-for-integration-tests.sh +++ b/hack/prepare-for-integration-tests.sh @@ -224,6 +224,7 @@ if ! tilt_mode; then --data-value "namespace=$supervisor_namespace" \ --data-value "image_repo=$registry_repo" \ --data-value "image_tag=$tag" \ + --data-value "log_level=debug" \ --data-value-yaml "custom_labels=$supervisor_custom_labels" \ --data-value-yaml 'service_http_nodeport_port=80' \ --data-value-yaml 'service_http_nodeport_nodeport=31234' \ @@ -253,6 +254,7 @@ if ! tilt_mode; then ytt --file . \ --data-value "app_name=$concierge_app_name" \ --data-value "namespace=$concierge_namespace" \ + --data-value "log_level=debug" \ --data-value-yaml "custom_labels=$concierge_custom_labels" \ --data-value "image_repo=$registry_repo" \ --data-value "image_tag=$tag" \