-
Notifications
You must be signed in to change notification settings - Fork 80
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
Added custom ApplicationSetting so apps can add their on configuration values #29
Conversation
edgexSdk.LoggingClient.Error("ApplicationName application settings not found") | ||
} | ||
} else { | ||
edgexSdk.LoggingClient.Error("No application settings not found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this return
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the example I didn't think it was necessary to return so that the example will still run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding exit... ;-)
if ok { | ||
edgexSdk.LoggingClient.Info(fmt.Sprintf("%s now running...", appName)) | ||
} else { | ||
edgexSdk.LoggingClient.Error("ApplicationName application settings not found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this return
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the example I didn't think it was necessary to return so that the example will still run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding exit
examples/simple-filter-xml/main.go
Outdated
if ok { | ||
edgexSdk.LoggingClient.Info(fmt.Sprintf("%s now running...", appName)) | ||
} else { | ||
edgexSdk.LoggingClient.Error("ApplicationName application settings not found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this return
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the example I didn't think it was necessary to return so that the example will still run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding exit
examples/simple-filter-xml/main.go
Outdated
edgexSdk.LoggingClient.Error("ApplicationName application settings not found") | ||
} | ||
} else { | ||
edgexSdk.LoggingClient.Error("No application settings not found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this return
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the example I didn't think it was necessary to return so that the example will still run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding exit
sdk := AppFunctionsSDK {} | ||
|
||
sdk.configDir = "../../examples/simple-filter-xml/res" | ||
err := sdk.initializeConfiguration() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I'm fond of a unit test relying on the file system...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No much choice here since it needs to load the toml file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something that really needs to be unit tested? It's bootstrapping logic, not business logic. It's like unit testing a DI container. Is there going to be a mock RegistryClient added too then to cover if sdk.useRegistry {
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose was to validate that the new custom section in the toml file was un-marshed as expected. So useRegistry is out of scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, the test is for sdk.ApplicationSettings(). Calling initilizeConfiguration() is part of the test setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tsconn23 , FYI, the device-sdk-go is doing similar load from local file for their test.
https://github.com/edgexfoundry/device-sdk-go/blob/master/internal/config/loader_test.go#L113
I choose to not create a local test toml file since the one in the example has what is needed.
edgexSdk.LoggingClient.Error("ApplicationName application settings not found") | ||
} | ||
} else { | ||
edgexSdk.LoggingClient.Error("No application settings not found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double negative :) "No Application settings not found"?
1240480
to
d38ebed
Compare
recheck |
recheck |
1 similar comment
recheck |
d38ebed
to
88acf93
Compare
5c2d8d2
to
5213ad6
Compare
…n values Signed-off-by: lenny-intel <leonard.goodell@intel.com>
Closing PR due to issues and will re-create. |
No description provided.