From 9729102857caab078c76223306d4b1b763bc8d4d Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 16 Oct 2023 14:53:08 -0700 Subject: [PATCH] [CI] Add pairing test for Kotlin API --- .github/workflows/java-tests.yaml | 11 +++++++++++ scripts/tests/run_kotlin_test.py | 12 +++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/java-tests.yaml b/.github/workflows/java-tests.yaml index 197ecbcb736326..575193e80f5218 100644 --- a/.github/workflows/java-tests.yaml +++ b/.github/workflows/java-tests.yaml @@ -210,6 +210,17 @@ jobs: --tool-args "code --nodeid 1 --setup-payload 34970112332 --discover-once 1 --use-only-onnetwork-discovery 0 -t 1000" \ --factoryreset \ ' + - name: Run Pairing Onnetwork Test + run: | + scripts/run_in_python_env.sh out/venv \ + './scripts/tests/run_kotlin_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-kotlin-matter-controller \ + --tool-cluster "pairing" \ + --tool-args "onnetwork-long --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ + --factoryreset \ + ' - name: Run Kotlin IM Invoke Test run: | scripts/run_in_python_env.sh out/venv \ diff --git a/scripts/tests/run_kotlin_test.py b/scripts/tests/run_kotlin_test.py index c4c6c992fd221a..45fef7c6e41de3 100755 --- a/scripts/tests/run_kotlin_test.py +++ b/scripts/tests/run_kotlin_test.py @@ -27,6 +27,7 @@ import coloredlogs from colorama import Fore, Style from java.base import DumpProgramOutputToQueue +from java.commissioning_test import CommissioningTest from java.im_test import IMTest @@ -96,7 +97,16 @@ def main(app: str, app_args: str, tool_path: str, tool_cluster: str, tool_args: ]), 'com.matter.controller.MainKt'] - if tool_cluster == 'im': + if tool_cluster == 'pairing': + logging.info("Testing pairing") + + test = CommissioningTest(log_cooking_threads, log_queue, command, tool_args) + try: + test.RunTest() + except Exception as e: + logging.error(e) + sys.exit(1) + elif tool_cluster == 'im': logging.info("Testing IM") test = IMTest(log_cooking_threads, log_queue, command, tool_args)