Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Change all unit tests to use logger.NewMockCient() #555

Merged
merged 1 commit into from
Oct 21, 2020

Conversation

lenny-goodell
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

File logging is used and causes unneeded local log files to be created.
Test results are not cluttered with log messages.

Issue Number: #477

What is the new behavior?

Mock Logger doesn't log anything, so test results are no longer cluttered with log messages.

Does this PR introduce a breaking change?

  • Yes
  • No

Are there any new imports or modules? If so, what are they used for and why?

No

Are there any specific instructions or things that should be known prior to reviewing?

Other information

This is so test.log files are no longer created and the test results are not cluttered with log messages.

closes #477

Signed-off-by: lenny <leonard.goodell@intel.com>
@codecov-io
Copy link

Codecov Report

Merging #555 into master will decrease coverage by 3.68%.
The diff coverage is 58.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #555      +/-   ##
==========================================
- Coverage   64.65%   60.97%   -3.69%     
==========================================
  Files          35       42       +7     
  Lines        2105     2196      +91     
==========================================
- Hits         1361     1339      -22     
- Misses        663      770     +107     
- Partials       81       87       +6     
Impacted Files Coverage Δ
appcontext/context.go 80.00% <ø> (-0.96%) ⬇️
internal/bootstrap/handlers/secrets.go 0.00% <0.00%> (ø)
internal/bootstrap/handlers/storeclient.go 0.00% <ø> (ø)
internal/runtime/runtime.go 71.60% <ø> (-1.34%) ⬇️
internal/security/credentials.go 51.25% <ø> (-3.70%) ⬇️
internal/security/mockprovider.go 0.00% <0.00%> (ø)
pkg/transforms/jsonlogic.go 89.47% <ø> (-1.01%) ⬇️
pkg/transforms/mqtt.go 0.00% <0.00%> (ø)
pkg/transforms/mqttsecret.go 23.43% <0.00%> (-31.57%) ⬇️
pkg/util/helpers.go 95.65% <0.00%> (-4.35%) ⬇️
... and 59 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 812c8b5...9043c56. Read the comment docs.

Copy link
Contributor

@jim-wang-intel jim-wang-intel left a comment

Choose a reason for hiding this comment

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

LGTM

@lenny-goodell lenny-goodell merged commit 02b6e43 into edgexfoundry:master Oct 21, 2020
@lenny-goodell lenny-goodell deleted the unittest-logger branch March 25, 2021 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants