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 Client Code, part 2 of several #197

Merged
merged 16 commits into from
Jan 16, 2020

Conversation

brandonforster
Copy link
Contributor

This PR is the second part of several working on #196.

This PR refactors all of metadata's clients and updates their unit tests.

To test, actuate the endpoints in the metadata device client. The blackbox tests for command should work for that.

}

// Helper method to request and decode a device service
func (s *deviceServiceRestClient) requestDeviceService(url string, ctx context.Context) (models.DeviceService, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed this helper method because it is only used once and is unlikely to be used anywhere else.

Copy link
Member

@michaelestrin michaelestrin left a comment

Choose a reason for hiding this comment

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

Rework based on comments in #195

brandonforster and others added 11 commits January 13, 2020 18:24
Signed-off-by: Brandon Forster <brandonforster@gmail.com>
Renamed EndpointerClient to Client.

Signed-off-by: Michael W. Estrin <me@michaelestrin.com>
Signed-off-by: Michael W. Estrin <me@michaelestrin.com>
Refactored client implementation to strategy pattern.

Updated package to only expose public Factory function.

Signed-off-by: Michael W. Estrin <me@michaelestrin.com>
… here).

Signed-off-by: Michael W. Estrin <me@michaelestrin.com>
Signed-off-by: Brandon Forster <brandonforster@gmail.com>
Signed-off-by: Brandon Forster <brandonforster@gmail.com>
Signed-off-by: Brandon Forster <brandonforster@gmail.com>
Signed-off-by: Brandon Forster <me@brandonforster.com>
Signed-off-by: Brandon Forster <me@brandonforster.com>
Signed-off-by: Brandon Forster <me@brandonforster.com>
@codecov-io
Copy link

codecov-io commented Jan 14, 2020

Codecov Report

Merging #197 into master will increase coverage by 0.38%.
The diff coverage is 25.95%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #197      +/-   ##
==========================================
+ Coverage   48.01%   48.39%   +0.38%     
==========================================
  Files          61       64       +3     
  Lines        2347     2093     -254     
==========================================
- Hits         1127     1013     -114     
+ Misses       1146     1002     -144     
- Partials       74       78       +4
Impacted Files Coverage Δ
clients/urlclient/local.go 100% <100%> (ø)
clients/urlclient/registry.go 100% <100%> (ø)
clients/urlclient/factory.go 100% <100%> (ø)
clients/coredata/reading.go 39.21% <100%> (+2.07%) ⬆️
clients/notifications/client.go 62.5% <100%> (-7.5%) ⬇️
clients/coredata/event.go 46.96% <100%> (+0.9%) ⬆️
clients/general/client.go 68.42% <100%> (-6.58%) ⬇️
clients/command/client.go 73.91% <100%> (-6.09%) ⬇️
clients/coredata/value_descriptor.go 55.07% <100%> (+0.81%) ⬆️
clients/metadata/device_profile.go 10.52% <11.11%> (-17.06%) ⬇️
... and 18 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 93abd0d...c9aeac5. Read the comment docs.

brandonforster and others added 5 commits January 14, 2020 13:24
Signed-off-by: Brandon Forster <me@brandonforster.com>
Signed-off-by: Brandon Forster <me@brandonforster.com>
Signed-off-by: Brandon Forster <brandonforster@gmail.com>
Signed-off-by: Brandon Forster <me@brandonforster.com>
Signed-off-by: Brandon Forster <brandonforster@gmail.com>
@michaelestrin michaelestrin marked this pull request as ready for review January 16, 2020 09:44
Copy link
Member

@michaelestrin michaelestrin left a comment

Choose a reason for hiding this comment

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

LGTM.

@michaelestrin michaelestrin merged commit 6abf550 into edgexfoundry:master Jan 16, 2020
@brandonforster brandonforster deleted the endpoint_metadata branch January 16, 2020 15:18
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