Skip to content

Commit

Permalink
Pipeline fixes (#564)
Browse files Browse the repository at this point in the history
* force no sys identity
* add quality of life + fix up init
* central test fix
  • Loading branch information
vilit1 authored Sep 7, 2022
1 parent 376118d commit 41e5179
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion azext_iot/tests/central/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,12 @@ def _create_app(self):
# Create the min version app and assign the correct roles
if not target_app:
self.cmd(
"iot central app create -n {} -g {} -s {} --mi-system-assigned -l {}".format(
"iot central app create -n {} -g {} -s {} -l {}".format(
self.app_id, APP_RG, self.app_id, "westus"
),
include_opt_args=False,
)

self.app_primary_key = None
# Will be repopulated with get_app_scope_id for tests that need it
self._scope_id = None
Expand Down
9 changes: 5 additions & 4 deletions azext_iot/tests/central/test_iot_central_devices_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ def test_central_device_module_properties_methods(self):
api_version=self._api_version,
device_id=device_id,
module_name='testModule')
# Module properties update response is an empty object {}
assert update_device_properties == {}
assert update_device_properties['$metadata']['testFirstProperty']['desiredValue'] == 'updatedTestFirstProperty'
assert update_device_properties['$metadata']['testSecondProperty']['desiredValue'] == 'updatedTestSecondProperty'

# Show module properties
command = f'''
Expand All @@ -346,8 +346,9 @@ def test_central_device_module_properties_methods(self):
device_id=device_id,
module_name='testModule',
component_name='ModuleComponent')
# Module properties update response is an empty object {}
assert update_device_component_properties == {}
metadata = update_device_component_properties['$metadata']
assert metadata['testComponentFirstProperty']['desiredValue'] == 'updatedTestComponentFirstProperty'
assert metadata['testComponentSecondProperty']['desiredValue'] == 'updatedTestComponentSecondProperty'

# Show module component properties
command = f'''
Expand Down
3 changes: 3 additions & 0 deletions azext_iot/tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ def __init__(self, req_env_set: list = None, opt_env_set: list = None):
def _build_config(self, env_set: list, optional: bool = False):
for key in env_set:
value = environ.get(key)
# Null out value if it is set to default pipeline value
if value == "sentinel":
value = None
if not value:
if not optional:
raise RuntimeError(
Expand Down

0 comments on commit 41e5179

Please sign in to comment.