Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

[WKP-468] test for debug log level #173

Merged
merged 27 commits into from
May 7, 2020
Merged

[WKP-468] test for debug log level #173

merged 27 commits into from
May 7, 2020

Conversation

D3nn
Copy link
Contributor

@D3nn D3nn commented Apr 28, 2020

  • wksctl with --verbose flag should set log level to debug on wks-controller
  • test should check logs to ensure debug level messages are output from kubectl logs wks-controller

@D3nn D3nn force-pushed the WKP-468-verify-log-level branch 2 times, most recently from 2bda482 to ac1c23d Compare April 28, 2020 23:27
@D3nn D3nn self-assigned this Apr 29, 2020
@D3nn D3nn marked this pull request as ready for review April 29, 2020 15:42
@palemtnrider
Copy link
Contributor

I don't see in your test code where you set the logging level to verbose? I only see you looking for a log message saying it's in debug mode.

@D3nn
Copy link
Contributor Author

D3nn commented May 1, 2020

I don't see in your test code where you set the logging level to verbose? I only see you looking for a log message saying it's in debug mode.

In TestApply, you should find this:

	// Install the Cluster.
	run, err := apply(exe, "--cluster="+clusterManifestPath, "--machines="+machinesManifestPath, "--namespace=default",
		"--config-directory="+configDir, "--sealed-secret-key="+configPath("ss.key"), "--sealed-secret-cert="+configPath("ss.cert"),
		"--verbose=true", "--ssh-key="+sshKeyPath)
	assert.NoError(t, err)
	assert.Equal(t, 0, run.ExitCode())
...

@D3nn D3nn force-pushed the WKP-468-verify-log-level branch from 64b57e9 to e797a03 Compare May 5, 2020 16:16
Copy link
Contributor

@jrryjcksn jrryjcksn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM \o/

@D3nn D3nn force-pushed the WKP-468-verify-log-level branch from e797a03 to 4c49f09 Compare May 5, 2020 16:31
@D3nn D3nn force-pushed the WKP-468-verify-log-level branch from 4c49f09 to 9ce4112 Compare May 5, 2020 16:43
Copy link
Contributor

@palemtnrider palemtnrider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that we are now checking both verbose and not.

@D3nn D3nn changed the title test for debug log level [WKP-468] test for debug log level May 6, 2020
@D3nn D3nn force-pushed the WKP-468-verify-log-level branch from 44100b5 to c803fee Compare May 7, 2020 01:05
@D3nn D3nn force-pushed the WKP-468-verify-log-level branch from dc57614 to 8919b49 Compare May 7, 2020 17:28
@D3nn D3nn merged commit 84a21a1 into master May 7, 2020
D3nn added a commit that referenced this pull request May 8, 2020
* test for debug log level

* make verbose setting configurable in test

* test for debug log level

* make verbose setting configurable in test

* updates to verbose logging testcase

* test for debug log level

* make verbose setting configurable in test

* test for debug log level

* make verbose setting configurable in test

* updates to verbose logging testcase

* check verbose from json output

* add logging debug statement

* fixes for TestApply

* print run object in test for debugging

* Old version of kubectl doesn't support -A

* test fixes to work with outdated kubectl

* Wait for all output to complete in test executor

* select specific output from kubectl command looking for "--verbose"

* switch to standard exec.Cmd

* small fix

* fix missing imports that "make lint" did not catch

* debug logging for pods

* debug

* debug

* switch to default namespace in test because that's how the cluster is created

Co-authored-by: Mark Emeis <mark.emeis@weave.works>
Co-authored-by: Jerry Jackson <jerry@weave.works>
D3nn added a commit that referenced this pull request May 20, 2020
* test for debug log level

* make verbose setting configurable in test

* test for debug log level

* make verbose setting configurable in test

* updates to verbose logging testcase

* test for debug log level

* make verbose setting configurable in test

* test for debug log level

* make verbose setting configurable in test

* updates to verbose logging testcase

* check verbose from json output

* add logging debug statement

* fixes for TestApply

* print run object in test for debugging

* Old version of kubectl doesn't support -A

* test fixes to work with outdated kubectl

* Wait for all output to complete in test executor

* select specific output from kubectl command looking for "--verbose"

* switch to standard exec.Cmd

* small fix

* fix missing imports that "make lint" did not catch

* debug logging for pods

* debug

* debug

* switch to default namespace in test because that's how the cluster is created

Co-authored-by: Mark Emeis <mark.emeis@weave.works>
Co-authored-by: Jerry Jackson <jerry@weave.works>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants