Repository navigation
Fix IS-04 grouphint role scoping - #915
iibaranov-IG wants to merge 1 commit into
Conversation
|
The change to If we accept the unit tests, they will need AMWA copyright and license, as per the repo's CONTRIBUTING.pdf. |
|
Thanks, this looks good. Could you also add the following? BCP-002-01 says an empty string in the grouphint tag doesn't indicate membership of any group, and an empty array should be handled like a missing tag. Currently In for tag_name, tag_value in resource["tags"].items():
if tag_name != grouphint:
continue
- if not isinstance(tag_value, list) or len(tag_value) == 0:
- return test.FAIL("Group tag for {} {} is not an array or has too few items"
+ if not isinstance(tag_value, list):
+ return test.FAIL("Group tag for {} {} is not an array"
.format(resource_name.capitalize().rstrip("s"), resource["id"]))
- found_groups = True
for group_def in tag_value:
+ # An empty string indicates no group membership
+ if group_def == "":
+ continue
+ found_groups = True
group_params = group_def.split(":")
group_scope = "device"In def test_empty_string_indicates_no_group(self):
sender = self.resource("sender-a")
sender["tags"][GROUPHINT] = [""]
result = self.run_test_23([sender], [])
self.assertEqual(TestStates.OPTIONAL, result.state)
def test_empty_array_indicates_no_group(self):
sender = self.resource("sender-a")
sender["tags"][GROUPHINT] = []
result = self.run_test_23([sender], [])
self.assertEqual(TestStates.OPTIONAL, result.state)Both new tests fail on the current head of this PR and pass with the change. Co-authored-by: Gareth's 🤖 buddy |
|
The register clarification is now in AMWA-TV/nmos-parameter-registers#80. It makes role uniqueness per resource type and covers the empty array and empty string cases that the change above handles. Co-authored-by: Gareth's 🤖 buddy |
Fixes #859.
IS-04-01 test_23 now checks grouphint role uniqueness separately for Senders and Receivers within each group scope. This permits matching roles across signal-flow directions while retaining failures for duplicate roles among resources of the same type.
Regression coverage includes:
Validated with: