-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Adding tests for Service Fabric commands and fixing some arugment parsing logic #3424
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3424 +/- ##
==========================================
+ Coverage 71.62% 72.12% +0.49%
==========================================
Files 420 422 +2
Lines 26209 26289 +80
Branches 3968 3977 +9
==========================================
+ Hits 18773 18961 +188
+ Misses 6258 6112 -146
- Partials 1178 1216 +38
Continue to review full report at Codecov.
|
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.
Looks good besides a few minor issues. Please rebase your change to the latest master. We've updated pylint.
if using_ca == "True": | ||
return self.az_config.get("servicefabric", "ca_path", fallback=None) | ||
else: | ||
return None |
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.
Per Pylint 1.7.1
if using_ca == "True":
return self.az_config.get("servicefabric", "ca_path", fallback=None)
return None
@@ -34,7 +34,8 @@ | |||
DEPENDENCIES = [ | |||
'azure-servicefabric==5.6.130', | |||
'azure-cli-core', | |||
'adal>=0.4.3' | |||
'adal>=0.4.3', | |||
'mock==2.0.0' |
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.
mock>=2.0.0
do not fix version in setup. We want the user to be able to patch a dependency. And why do we need mock
in the production code? It is a testing utility.
@@ -3,6 +3,7 @@ | |||
# Licensed under the MIT License. See License.txt in the project root for license information. | |||
# -------------------------------------------------------------------------------------------- | |||
# pylint: disable=too-many-lines | |||
# pylint: disable=too-many-locals |
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.
Can you mark this disable statement to the function where it is needed? It is not encouraged to disable a pylint rule for the scope of the entire file.
|
||
|
||
def parse_app_metrics(formatted_metrics): | ||
from azure.servicefabric.models.application_metric_description import ( |
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 parentheses don't seem to be necessary.
NamedPartitionSchemeDescription | ||
) | ||
# pylint: disable=line-too-long | ||
from azure.servicefabric.models.singleton_partition_scheme_description import ( # noqa: justification, no way to shorten |
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.
# noqa
is not needed.
Please also take into the account that the line limitation is 120 instead if 100 now. |
ping @samedder |
@troydai. On vacation currently, can this wait till next week? I agree with all your comments. |
@samedder sure. no hurry. enjoy your vacation. |
@samedder please update the pull request when you have time. |
@troydai will get to this tommorrow |
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.
Looks good to me overall. Please the only comments about dependency version and this is good to go.
@@ -35,7 +35,7 @@ | |||
'azure-servicefabric==5.6.130', |
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.
In the setup, the version of the dependencies shouldn't be pinned. Otherwise it will prevents user from applying patch.
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.
We want to specifically pin this because we don't want to users to auto-upgrade at this time. I know we have pending work to move into our own CLI, so for the time being I'd just like to leave this as-is, since this version won't change until then anyways. Lets discuss over email what's the right thing to do with others.
endpoint = sf_get_connection_endpoint() | ||
def cf_sf_client(_): | ||
sf_config = SfConfigParser() | ||
endpoint = sf_config.connection_endpoint() | ||
if endpoint is None: |
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.
if not endpoint:
Unless endpoint == ''
as any special meaning and should be accepted.
|
||
def ca_cert_info(self): | ||
using_ca = self.az_config.get("servicefabric", "use_ca", fallback="False") | ||
if using_ca == "True": |
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.
Just want to make sure that you understand the string comparison is case-sensitive.
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.
Yes, but since we are the only ones who set these strings we expect with the casing that we set them.
@troydai I think we may have a transient fault in the CI:
|
I restart the build. Let's see if the issue persist. |
New changes for Service Fabric: