Skip to content

Commit

Permalink
Allow gating self-selecting tests on PICS
Browse files Browse the repository at this point in the history
  • Loading branch information
cecille committed Oct 4, 2024
1 parent 9113441 commit 9eaec67
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/python_testing/matter_testing_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -2171,8 +2171,9 @@ def run_if_endpoint_matches(accept_function: EndpointCheckFunction):
"""
def run_if_endpoint_matches_internal(body):
def per_endpoint_runner(self: MatterBaseTest, *args, **kwargs):
asserts.assert_false(self.get_test_pics(self.current_test_info.name),
"pics_ method supplied for run_if_endpoint_matches.")
# Disabling this for now so the TH does not need to spend the time to run these tests. We can PICS-gate these and re-evaluate in 1.5
# asserts.assert_false(self.get_test_pics(self.current_test_info.name),
# "pics_ method supplied for run_if_endpoint_matches.")
runner_with_timeout = asyncio.wait_for(should_run_test_on_endpoint(self, accept_function), timeout=60)
should_run_test = asyncio.run(runner_with_timeout)
if not should_run_test:
Expand Down
11 changes: 6 additions & 5 deletions src/python_testing/test_testing/TestDecorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,12 @@ def main():
if not ok:
failures.append("Test case failure: test_endpoints")

test_name = 'test_endpoint_with_pics'
test_runner.set_test('TestDecorators.py', 'TestDecorators', test_name)
ok = test_runner.run_test_with_mock_read(read_resp, hooks)
if ok:
failures.append(f"Did not get expected test assertion on {test_name}")
# Disabling this for now - in 1.4 we will allow self-selecting tests that are also gated by PICS
# test_name = 'test_endpoint_with_pics'
# test_runner.set_test('TestDecorators.py', 'TestDecorators', test_name)
# ok = test_runner.run_test_with_mock_read(read_resp, hooks)
# if ok:
# failures.append(f"Did not get expected test assertion on {test_name}")

# Test should run once for the whole node, regardless of the number of endpoints
def run_check(test_name: str, read_response: Attribute.AsyncReadTransaction.ReadResponse, expect_skip: bool) -> None:
Expand Down

0 comments on commit 9eaec67

Please sign in to comment.