Skip to content

Commit

Permalink
Run RVC test against the RVC example app in CI. (#32079)
Browse files Browse the repository at this point in the history
* Run RVC test against the RVC example app in CI.

* Restyled by gn

* Added the RVC example app to the built examples.

* Removed -app to make things consistent with other appliences.

* Added missing copy instructons and fixed typos in the rvc app name.

* Added the rvc-app pics values to the ci-pics-values since the tests are run against the rvc-app and there isn't currently a way to select a different YICS file when running the yaml tests.

* Added missing PICS to the ci-pics-values.

* Fixed typos in the tests workflow.

* Update src/app/tests/suites/certification/ci-pics-values

Co-authored-by: Petru Lauric <[email protected]>

* Added 1 ms sleep after sending pipe commands form the test scripts. This removes the test flakyness in CI.

* Restyled by autopep8

* Restyled by isort

* Removed the RVC and MWO apps from the cirque tests as they are not needed following review comments.

* Added todo with link to issue.

---------

Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Petru Lauric <[email protected]>
  • Loading branch information
3 people authored Feb 20, 2024
1 parent a3d0a86 commit 19c49a8
Show file tree
Hide file tree
Showing 18 changed files with 180 additions and 70 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/darwin-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ jobs:
--target darwin-x64-bridge-${BUILD_VARIANT} \
--target darwin-x64-lit-icd-${BUILD_VARIANT} \
--target darwin-x64-microwave-oven-${BUILD_VARIANT} \
--target darwin-x64-rvc-${BUILD_VARIANT} \
build \
--copy-artifacts-to objdir-clone \
"
Expand All @@ -120,6 +121,7 @@ jobs:
--tv-app ./out/darwin-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \
--bridge-app ./out/darwin-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \
--microwave-oven-app ./out/darwin-x64-microwave-oven-${BUILD_VARIANT}/chip-microwave-oven-app \
--rvc-app ./out/darwin-x64-rvc-${BUILD_VARIANT}/chip-rvc-app \
"
- name: Run OTA Test
run: |
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/tests.yaml

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
enable_linux_lit_icd_app_build =
enable_default_builds && (host_os == "linux" || host_os == "mac")

# Build the Linux RVC app example.
enable_linux_rvc_app_build =
enable_default_builds && (host_os == "linux" || host_os == "mac")

# Build the cc13x2x7_26x2x7 lock app example.
enable_cc13x2x7_26x2x7_lock_app_build = enable_ti_simplelink_builds

Expand Down Expand Up @@ -744,6 +748,14 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
extra_build_deps += [ ":genio_shell_app" ]
}

if (enable_linux_rvc_app_build) {
group("linux_rvc_app") {
deps = [ "${chip_root}/examples/rvc-app/linux(${standalone_toolchain})" ]
}

extra_build_deps += [ ":linux_rvc_app" ]
}

group("default") {
deps = extra_build_deps + builds
}
Expand Down
4 changes: 4 additions & 0 deletions integrations/docker/images/chip-cert-bins/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ RUN case ${TARGETPLATFORM} in \
--target linux-x64-lit-icd-ipv6only \
--target linux-x64-energy-management-ipv6only \
--target linux-x64-microwave-oven-ipv6only \
--target linux-x64-rvc-ipv6only \
build \
&& mv out/linux-x64-chip-tool-ipv6only-platform-mdns/chip-tool out/chip-tool \
&& mv out/linux-x64-shell-ipv6only-platform-mdns/chip-shell out/chip-shell \
Expand All @@ -213,6 +214,7 @@ RUN case ${TARGETPLATFORM} in \
&& mv out/linux-x64-lit-icd-ipv6only/lit-icd-app out/lit-icd-app \
&& mv out/linux-x64-energy-management-ipv6only/chip-energy-management-app out/chip-energy-management-app \
&& mv out/linux-x64-microwave-oven-ipv6only/chip-microwave-oven-app out/chip-microwave-oven-app \
&& mv out/linux-x64-rvc-ipv6only/chip-rvc-app out/chip-rvc-app \
;; \
"linux/arm64")\
set -x \
Expand Down Expand Up @@ -255,6 +257,7 @@ RUN case ${TARGETPLATFORM} in \
&& mv out/linux-arm64-lit-icd-ipv6only/lit-icd-app out/lit-icd-app \
&& mv out/linux-arm64-energy-management-ipv6only/chip-energy-management-app out/chip-energy-management-app \
&& mv out/linux-arm64-microwave-oven-ipv6only/chip-microwave-oven-app out/chip-microwave-oven-app \
&& mv out/linux-arm64-rvc-ipv6only/chip-rvc-app out/chip-rvc-app \
;; \
*) ;; \
esac
Expand Down Expand Up @@ -287,6 +290,7 @@ COPY --from=chip-build-cert-bins /root/connectedhomeip/out/chip-app1 chip-app1
COPY --from=chip-build-cert-bins /root/connectedhomeip/out/lit-icd-app lit-icd-app
COPY --from=chip-build-cert-bins /root/connectedhomeip/out/chip-energy-management-app chip-energy-management-app
COPY --from=chip-build-cert-bins /root/connectedhomeip/out/chip-microwave-oven-app chip-microwave-oven-app
COPY --from=chip-build-cert-bins /root/connectedhomeip/out/chip-rvc-app chip-rvc-app

# Stage 3.1: Setup the Matter Python environment
COPY --from=chip-build-cert-bins /root/connectedhomeip/out/python_lib python_lib
Expand Down
4 changes: 2 additions & 2 deletions scripts/build/builders/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ def OutputNames(self):
yield 'refrigerator-app'
yield 'refrigerator-app.map'
elif self == HostApp.RVC:
yield 'rvc-app'
yield 'rvc-app.map'
yield 'chip-rvc-app'
yield 'chip-rvc-app.map'
elif self == HostApp.AIR_PURIFIER:
yield 'air-purifier-app'
yield 'air-purifier-app.map'
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/gn_gen_cirque.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ echo "Setup build environment"
source "./scripts/activate.sh"

echo "Build: GN configure"
gn --root="$CHIP_ROOT" gen --check --fail-on-unused-args out/debug --args='target_os="all"'"chip_build_tests=false chip_enable_wifi=false chip_im_force_fabric_quota_check=true enable_default_builds=false enable_host_gcc_build=true enable_standalone_chip_tool_build=true enable_linux_all_clusters_app_build=true enable_linux_lighting_app_build=true enable_microwave_oven_app_build=true enable_linux_lit_icd_app_build=true"
gn --root="$CHIP_ROOT" gen --check --fail-on-unused-args out/debug --args='target_os="all"'"chip_build_tests=false chip_enable_wifi=false chip_im_force_fabric_quota_check=true enable_default_builds=false enable_host_gcc_build=true enable_standalone_chip_tool_build=true enable_linux_all_clusters_app_build=true enable_linux_lighting_app_build=true enable_linux_lit_icd_app_build=true"

echo "Build: Ninja build"
time ninja -C out/debug all check
2 changes: 2 additions & 0 deletions scripts/tests/chiptest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ def target_for_name(name: str):
return TestTarget.LIT_ICD
if name.startswith("Test_TC_MWOCTRL_") or name.startswith("Test_TC_MWOM_"):
return TestTarget.MWO
if name.startswith("Test_TC_RVCRUNM_") or name.startswith("Test_TC_RVCCLEANM_") or name.startswith("Test_TC_RVCOPSTATE_"):
return TestTarget.RVC
return TestTarget.ALL_CLUSTERS


Expand Down
1 change: 1 addition & 0 deletions scripts/tests/chiptest/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def PathsWithNetworkNamespaces(paths: ApplicationPaths) -> ApplicationPaths:
tv_app='ip netns exec app'.split() + paths.tv_app,
lit_icd_app='ip netns exec app'.split() + paths.lit_icd_app,
microwave_oven_app='ip netns exec app'.split() + paths.microwave_oven_app,
rvc_app='ip netns exec app'.split() + paths.rvc_app,
bridge_app='ip netns exec app'.split() + paths.bridge_app,
chip_repl_yaml_tester_cmd='ip netns exec tool'.split() + paths.chip_repl_yaml_tester_cmd,
chip_tool_with_python_cmd='ip netns exec tool'.split() + paths.chip_tool_with_python_cmd,
Expand Down
6 changes: 5 additions & 1 deletion scripts/tests/chiptest/test_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ class TestTarget(Enum):
BRIDGE = auto()
LIT_ICD = auto()
MWO = auto()
RVC = auto()


@dataclass
Expand All @@ -191,10 +192,11 @@ class ApplicationPaths:
microwave_oven_app: typing.List[str]
chip_repl_yaml_tester_cmd: typing.List[str]
chip_tool_with_python_cmd: typing.List[str]
rvc_app: typing.List[str]

def items(self):
return [self.chip_tool, self.all_clusters_app, self.lock_app, self.ota_provider_app, self.ota_requestor_app,
self.tv_app, self.bridge_app, self.lit_icd_app, self.microwave_oven_app, self.chip_repl_yaml_tester_cmd, self.chip_tool_with_python_cmd]
self.tv_app, self.bridge_app, self.lit_icd_app, self.microwave_oven_app, self.chip_repl_yaml_tester_cmd, self.chip_tool_with_python_cmd, self.rvc_app]


@dataclass
Expand Down Expand Up @@ -305,6 +307,8 @@ def Run(self, runner, apps_register, paths: ApplicationPaths, pics_file: str,
target_app = paths.lit_icd_app
elif self.target == TestTarget.MWO:
target_app = paths.microwave_oven_app
elif self.target == TestTarget.RVC:
target_app = paths.rvc_app
else:
raise Exception("Unknown test target - "
"don't know which application to run")
Expand Down
9 changes: 8 additions & 1 deletion scripts/tests/run_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ def cmd_list(context):
@click.option(
'--microwave-oven-app',
help='what microwave oven app to use')
@click.option(
'--rvc-app',
help='what rvc app to use')
@click.option(
'--chip-repl-yaml-tester',
help='what python script to use for running yaml tests using chip-repl as controller')
Expand Down Expand Up @@ -288,7 +291,7 @@ def cmd_list(context):
help='Number of tests that are expected to fail in each iteration. Overall test will pass if the number of failures matches this. Nonzero values require --keep-going')
@click.pass_context
def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, ota_requestor_app,
tv_app, bridge_app, lit_icd_app, microwave_oven_app, chip_repl_yaml_tester, chip_tool_with_python, pics_file, keep_going, test_timeout_seconds, expected_failures):
tv_app, bridge_app, lit_icd_app, microwave_oven_app, rvc_app, chip_repl_yaml_tester, chip_tool_with_python, pics_file, keep_going, test_timeout_seconds, expected_failures):
if expected_failures != 0 and not keep_going:
logging.exception(f"'--expected-failures {expected_failures}' used without '--keep-going'")
sys.exit(2)
Expand Down Expand Up @@ -321,6 +324,9 @@ def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, o
if microwave_oven_app is None:
microwave_oven_app = paths_finder.get('chip-microwave-oven-app')

if rvc_app is None:
rvc_app = paths_finder.get('chip-rvc-app')

if chip_repl_yaml_tester is None:
chip_repl_yaml_tester = paths_finder.get('yamltest_with_chip_repl_tester.py')

Expand All @@ -341,6 +347,7 @@ def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, o
bridge_app=[bridge_app],
lit_icd_app=[lit_icd_app],
microwave_oven_app=[microwave_oven_app],
rvc_app=[rvc_app],
chip_repl_yaml_tester_cmd=['python3'] + [chip_repl_yaml_tester],
chip_tool_with_python_cmd=['python3'] + [chip_tool_with_python],
)
Expand Down
161 changes: 98 additions & 63 deletions src/app/tests/suites/certification/ci-pics-values
Original file line number Diff line number Diff line change
Expand Up @@ -2477,97 +2477,132 @@ REFALM.S.E00=1
REFALM.S.C00.Rsp=1
REFALM.S.C01.Rsp=1

# RVC CLEAN MODE CLUSTER

# PICS for the RVC app
# These are required to be here because currently there isn't a way to select a different PICS
# file when running the yaml tests in CI
RVCCLEANM.S=1

#Server
RVCCLEANM.S.A0000=1
RVCCLEANM.S.A0001=1

#Feature
RVCCLEANM.S.F00=0

#commands
RVCCLEANM.S.C00.Rsp=1
RVCCLEANM.S.C01.Tx=1

RVCCLEANM.S.F00=0
RVCCLEANM.S.M.CAN_TEST_MODE_FAILURE=1

#PIXIT
PIXIT.RVCCLEANM.MODE_CHANGE_FAIL=1
PIXIT.RVCCLEANM.MODE_CHANGE_OK=1

# RVC OPERATIONAL STATE CLUSTER
RVCOPSTATE.S=1
RVCOPSTATE.C=1

#ManuallyControlled
# These are the PICS supported by the all-clusters-app

RVCOPSTATE.S.M.ST_STOPPED=1
RVCOPSTATE.S.M.ST_RUNNING=1
RVCOPSTATE.S.M.ST_PAUSED=1
RVCOPSTATE.S.M.ST_ERROR=0
RVCOPSTATE.S.M.ST_SEEKING_CHARGER=0
RVCOPSTATE.S.M.ST_CHARGING=0
RVCOPSTATE.S.M.ST_DOCKED=0
RVCOPSTATE.S.M.ERR_NO_ERROR=1
RVCOPSTATE.S.M.ERR_UNABLE_TO_START_OR_RESUME=0
RVCOPSTATE.S.M.ERR_UNABLE_TO_COMPLETE_OPERATION=0
RVCOPSTATE.S.M.ERR_COMMAND_INVALID_IN_STATE=0
RVCOPSTATE.S.M.ERR_FAILED_TO_FIND_CHARGING_DOCK=0
RVCOPSTATE.S.M.ERR_STUCK=0
RVCOPSTATE.S.M.ERR_DUST_BIN_MISSING=0
RVCOPSTATE.S.M.ERR_DUST_BIN_FULL=0
RVCOPSTATE.S.M.ERR_WATER_TANK_EMPTY=0
RVCOPSTATE.S.M.ERR_WATER_TANK_MISSING=0
RVCOPSTATE.S.M.ERR_WATER_TANK_LID_OPEN=0
RVCOPSTATE.S.M.ERR_MOP_CLEANING_PAD_MISSING=0

#Events
RVCOPSTATE.S.E00=1
RVCOPSTATE.S.E01=1

#Server
RVCOPSTATE.S.A0000=1
RVCOPSTATE.S.A0001=1
RVCOPSTATE.S.A0002=1
RVCOPSTATE.S.A0002=0
RVCOPSTATE.S.A0003=1
RVCOPSTATE.S.A0004=1
RVCOPSTATE.S.A0005=1

#Commands
RVCOPSTATE.S.E00=1
RVCOPSTATE.S.E01=1
RVCOPSTATE.S.C00.Rsp=1
RVCOPSTATE.S.C01.Rsp=0
RVCOPSTATE.S.C02.Rsp=0
RVCOPSTATE.S.C03.Rsp=1
RVCOPSTATE.S.C04.Tx=1
RVCOPSTATE.S.C128.Rsp=1
RVCOPSTATE.C.C00.Tx=1
RVCOPSTATE.C.C01.Tx=1
RVCOPSTATE.C.C02.Tx=1
RVCOPSTATE.C.C04.Tx=1

RVCOPSTATE.S.M.ST_STOPPED=1
RVCOPSTATE.S.M.ST_RUNNING=1
RVCOPSTATE.S.M.ST_PAUSED=1
RVCOPSTATE.S.M.ST_ERROR=1
RVCOPSTATE.S.M.ST_SEEKING_CHARGER=1
RVCOPSTATE.S.M.ST_CHARGING=1
RVCOPSTATE.S.M.ST_DOCKED=1
RVCOPSTATE.S.M.ERR_NO_ERROR=1
RVCOPSTATE.S.M.ERR_UNABLE_TO_START_OR_RESUME=1
RVCOPSTATE.S.M.ERR_UNABLE_TO_COMPLETE_OPERATION=1
RVCOPSTATE.S.M.ERR_COMMAND_INVALID_IN_STATE=1
RVCOPSTATE.S.M.ERR_FAILED_TO_FIND_CHARGING_DOCK=1
RVCOPSTATE.S.M.ERR_STUCK=1
RVCOPSTATE.S.M.ERR_DUST_BIN_MISSING=1
RVCOPSTATE.S.M.ERR_DUST_BIN_FULL=1
RVCOPSTATE.S.M.ERR_WATER_TANK_EMPTY=1
RVCOPSTATE.S.M.ERR_WATER_TANK_MISSING=1
RVCOPSTATE.S.M.ERR_WATER_TANK_LID_OPEN=1
RVCOPSTATE.S.M.ERR_MOP_CLEANING_PAD_MISSING=1
RVCOPSTATE.C=0
RVCOPSTATE.C.C00.Tx=0
RVCOPSTATE.C.C01.Tx=0
RVCOPSTATE.C.C02.Tx=0
RVCOPSTATE.C.C04.Tx=0

# RVC RUN MODE CLUSTER
RVCRUNM.S=1
RVCRUNM.S.F00=0

#Server
RVCRUNM.S.A0000=1
RVCRUNM.S.A0001=1

#Commands
RVCRUNM.S.C00.Rsp=1
RVCRUNM.S.C01.Tx=1

RVCRUNM.S.F00=0
RVCRUNM.S.M.CAN_TEST_MODE_FAILURE=1
RVCRUNM.S.M.CAN_MANUALLY_CONTROLLED=1

#PIXIT
PIXIT.RVCRUNM.MODE_CHANGE_FAIL=1
PIXIT.RVCRUNM.MODE_CHANGE_OK=1
# These are useless as these values are set where the python tests are run.
# They are only here because a list test wants then to be.
PIXIT.RVCCLEANM.MODE_CHANGE_FAIL=0
PIXIT.RVCCLEANM.MODE_CHANGE_OK=0
PIXIT.RVCRUNM.MODE_CHANGE_FAIL=0
PIXIT.RVCRUNM.MODE_CHANGE_OK=0

# These are the RVC PICS for the all-clustrs-app.
# These PICS are commented out because the yaml tests are being run against the rvc-app.
# RVCCLEANM.S=1
# RVCCLEANM.S.A0000=1
# RVCCLEANM.S.A0001=1
# RVCCLEANM.S.F00=0
# RVCCLEANM.S.C00.Rsp=1
# RVCCLEANM.S.C01.Tx=1
# RVCCLEANM.S.M.CAN_TEST_MODE_FAILURE=1

# RVCOPSTATE.S=1
# RVCOPSTATE.C=1
# RVCOPSTATE.S.M.ST_STOPPED=1
# RVCOPSTATE.S.M.ST_RUNNING=1
# RVCOPSTATE.S.M.ST_PAUSED=1
# RVCOPSTATE.S.M.ST_ERROR=0
# RVCOPSTATE.S.M.ST_SEEKING_CHARGER=0
# RVCOPSTATE.S.M.ST_CHARGING=0
# RVCOPSTATE.S.M.ST_DOCKED=0
# RVCOPSTATE.S.M.ERR_NO_ERROR=1
# RVCOPSTATE.S.M.ERR_UNABLE_TO_START_OR_RESUME=0
# RVCOPSTATE.S.M.ERR_UNABLE_TO_COMPLETE_OPERATION=0
# RVCOPSTATE.S.M.ERR_COMMAND_INVALID_IN_STATE=0
# RVCOPSTATE.S.M.ERR_FAILED_TO_FIND_CHARGING_DOCK=0
# RVCOPSTATE.S.M.ERR_STUCK=0
# RVCOPSTATE.S.M.ERR_DUST_BIN_MISSING=0
# RVCOPSTATE.S.M.ERR_DUST_BIN_FULL=0
# RVCOPSTATE.S.M.ERR_WATER_TANK_EMPTY=0
# RVCOPSTATE.S.M.ERR_WATER_TANK_MISSING=0
# RVCOPSTATE.S.M.ERR_WATER_TANK_LID_OPEN=0
# RVCOPSTATE.S.M.ERR_MOP_CLEANING_PAD_MISSING=0
# RVCOPSTATE.S.E00=1
# RVCOPSTATE.S.E01=1
# RVCOPSTATE.S.A0000=1
# RVCOPSTATE.S.A0001=1
# RVCOPSTATE.S.A0002=1
# RVCOPSTATE.S.A0003=1
# RVCOPSTATE.S.A0004=1
# RVCOPSTATE.S.A0005=1
# RVCOPSTATE.S.C00.Rsp=1
# RVCOPSTATE.S.C01.Rsp=0
# RVCOPSTATE.S.C02.Rsp=0
# RVCOPSTATE.S.C03.Rsp=1
# RVCOPSTATE.S.C04.Tx=1
# RVCOPSTATE.S.C128.Rsp=1
# RVCOPSTATE.C.C00.Tx=1
# RVCOPSTATE.C.C01.Tx=1
# RVCOPSTATE.C.C02.Tx=1
# RVCOPSTATE.C.C04.Tx=1

# RVCRUNM.S=1
# RVCRUNM.S.F00=0
# RVCRUNM.S.A0000=1
# RVCRUNM.S.A0001=1
# RVCRUNM.S.C00.Rsp=1
# RVCRUNM.S.C01.Tx=1
# RVCRUNM.S.M.CAN_TEST_MODE_FAILURE=1
# RVCRUNM.S.M.CAN_MANUALLY_CONTROLLED=1


#Refrigerator and Temperature Controlled Cabinet Mode Cluster(TCCM)

Expand Down
4 changes: 4 additions & 0 deletions src/python_testing/TC_RVCCLEANM_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#

import logging
from time import sleep

import chip.clusters as Clusters
from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches
Expand Down Expand Up @@ -56,6 +57,9 @@ async def send_run_change_to_mode_cmd(self, newMode) -> Clusters.Objects.RvcRunM
def write_to_app_pipe(self, command):
with open(self.app_pipe, "w") as app_pipe:
app_pipe.write(command + "\n")
# Delay for pipe command to be processed (otherwise tests are flaky)
# TODO(#31239): centralize pipe write logic and remove the need of sleep
sleep(0.001)

def pics_TC_RVCCLEANM_2_1(self) -> list[str]:
return ["RVCCLEANM.S"]
Expand Down
Loading

0 comments on commit 19c49a8

Please sign in to comment.