From 1c2d15ab4b2e040eb81cc7f25cc13a418103bd2f Mon Sep 17 00:00:00 2001 From: Avin Agrawal Date: Mon, 17 May 2021 16:51:12 -0700 Subject: [PATCH 1/3] Add warning for qos deprecation and update contributing guide --- CONTRIBUTING.md | 11 +++++------ azext_iot/_params.py | 5 +++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1e2322253..4b199d06c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -98,10 +98,10 @@ pip install -r path/to/source/dev_requirements ``` _Hub:_ -`pytest azext_iot/tests/test_iot_ext_unit.py` +`pytest azext_iot/tests/iothub/test_iot_ext_unit.py` _DPS:_ -`pytest azext_iot/tests/test_iot_dps_unit.py` +`pytest azext_iot/tests/dps/test_iot_dps_unit.py` ### Integration Tests @@ -127,7 +127,6 @@ You can either manually set the environment variables or use the `pytest.ini.exa AZURE_TEST_RUN_LIVE=True azext_iot_testrg="Resource Group that contains your IoT Hub" azext_iot_testhub="IoT Hub Name" - azext_iot_testhub_cs="IoT Hub Connection String" azext_iot_testdps="IoT Hub DPS Name" azext_iot_teststorageuri="Blob Container SAS Uri" azext_iot_identity_teststorageid="Storage Account ID" @@ -141,13 +140,13 @@ You can either manually set the environment variables or use the `pytest.ini.exa Execute the following command to run the IoT Hub integration tests: -`pytest azext_iot/tests/test_iot_ext_int.py` +`pytest azext_iot/tests/iothub/test_iot_ext_int.py` ##### Device Provisioning Service Execute the following command to run the IoT Hub DPS integration tests: -`pytest azext_iot/tests/test_iot_dps_int.py` +`pytest azext_iot/tests/dps/test_iot_dps_int.py` #### Unit and Integration Tests Single Command @@ -264,7 +263,7 @@ https://medium.com/@marcobelo/setting-up-python-black-on-visual-studio-code-5318 https://docs.python.org/3/library/pdb.html -1. `pip install pdb` +1. `pip install pdbpp` 2. If you need a breakpoint, put `import pdb; pdb.set_trace()` in your code 3. Run your command, it should break execution wherever you put the breakpoint. diff --git a/azext_iot/_params.py b/azext_iot/_params.py index 99f3cfcca..47ca46553 100644 --- a/azext_iot/_params.py +++ b/azext_iot/_params.py @@ -82,7 +82,8 @@ type=str, nargs="?", choices=["0", "1"], - help="Quality of Service. 0 = At most once, 1 = At least once. 2 (Exactly once) is not supported.", + help="Quality of Service. 0 = At most once, 1 = At least once. 2 (Exactly once) is not supported." + "This command parameter has been deprecated and will be removed in the next release." ) event_timeout_type = CLIArgumentType( @@ -557,7 +558,7 @@ def load_arguments(self, _): arg_type=get_enum_type(ProtocolType), help="Indicates device-to-cloud message protocol", ) - context.argument("qos", arg_type=qos_type) + context.argument("qos", arg_type=qos_type, deprecate_info=context.deprecate(expiration='0.10.12')) with self.argument_context("iot device simulate") as context: context.argument( From f5265b7b0d5f07fadb63db4abbf8de77e18ef0a2 Mon Sep 17 00:00:00 2001 From: Avin Agrawal Date: Mon, 17 May 2021 16:57:05 -0700 Subject: [PATCH 2/3] removing version from deprecate_info --- azext_iot/_params.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azext_iot/_params.py b/azext_iot/_params.py index 47ca46553..f8e3982b4 100644 --- a/azext_iot/_params.py +++ b/azext_iot/_params.py @@ -558,7 +558,7 @@ def load_arguments(self, _): arg_type=get_enum_type(ProtocolType), help="Indicates device-to-cloud message protocol", ) - context.argument("qos", arg_type=qos_type, deprecate_info=context.deprecate(expiration='0.10.12')) + context.argument("qos", arg_type=qos_type, deprecate_info=context.deprecate()) with self.argument_context("iot device simulate") as context: context.argument( From bad3201fe379dd61148f2c67d8ac671a6f64b807 Mon Sep 17 00:00:00 2001 From: Avin Agrawal Date: Mon, 17 May 2021 17:06:33 -0700 Subject: [PATCH 3/3] Integration tests command update in Contributing guide --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b199d06c..8301c0439 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -140,13 +140,13 @@ You can either manually set the environment variables or use the `pytest.ini.exa Execute the following command to run the IoT Hub integration tests: -`pytest azext_iot/tests/iothub/test_iot_ext_int.py` +`pytest azext_iot/tests/iothub/ -k "_int"` ##### Device Provisioning Service Execute the following command to run the IoT Hub DPS integration tests: -`pytest azext_iot/tests/dps/test_iot_dps_int.py` +`pytest azext_iot/tests/dps/ -k "_int"` #### Unit and Integration Tests Single Command