Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YAML][CI] Update the test runner to implement type checking #21354

Merged
merged 36 commits into from
Jul 29, 2022

Conversation

vivien-apple
Copy link
Contributor

Problem

This PR add basic type checking to YAML tests.
In summary this PR just checks that the type that is used as a constraint match with the type that is declared in the XML.
The actual value checking itself is done when chip::app::DataModel::Decode(*data, value) is called by the test framework, which fails if the payload can not be decoded/converted to the types eclared in the XML.

As a followup to this PR it would be nice to actually use the type name from the spec instead of the current type name from chip-types.xml. For example the spec says bool where chip-types.xml says boolean, or the spec says map32where chip-types.xml says bitmap32, etc...

Change overview

  • Update src/app/tests/suites tests constraints to make sure the type is correct
  • Update src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml to use uint8 for CurrentFabricIndex instead of fabric_idx since this is what is in the spec (I'm not sure the spec is right here...)
  • Update src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml to use vendor_id type for the vendorID attribute per spec
  • Update the test runner to take the type constraint into accou

Testing

A lot of generated tests are now failing instead of issuing a warning if the type is incorrect

…uster.xml to use vendor_id type for the vendorID attribute per spec
…ist when reading the current channel attribute
…ml to use utc instead of epoch_s for SetpointChangeSourceTimestamp per spec
@woody-apple woody-apple enabled auto-merge (squash) July 29, 2022 05:10
@github-actions
Copy link

github-actions bot commented Jul 29, 2022

PR #21354: Size comparison from 375e841 to 99234a1

Increases (3 builds for cc13x2_26x2, mbed)
platform target config section 375e841d 99234a1 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 668515 668523 8 0.0
.text 580004 580012 8 0.0
pump-controller-app LP_CC2652R7 (read only) 666519 666527 8 0.0
.text 581360 581368 8 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read/write) 2450608 2450672 64 0.0
.text 1413252 1413316 64 0.0
Decreases (6 builds for bl602, cc13x2_26x2, cyw30739, linux)
platform target config section 375e841d 99234a1 change % change
bl602 lighting-app bl602+rpc .text 1083556 1083552 -4 -0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read/write) 182828 182820 -8 -0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 634107 634099 -8 -0.0
.text 556372 556364 -8 -0.0
pump-controller-app LP_CC2652R7 (read/write) 175984 175976 -8 -0.0
cyw30739 light cyw930739m2evb_01 (read/write) 583414 583406 -8 -0.0
.app_xip_area 460232 460224 -8 -0.0
linux chip-tool-ipv6only arm64 (read only) 9881988 9878692 -3296 -0.0
.rodata 468196 468132 -64 -0.0
.text 7798660 7795428 -3232 -0.0
Full report (32 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 375e841d 99234a1 change % change
bl602 lighting-app bl602 (read/write) 1381618 1381618 0 0.0
.bss 117618 117618 0 0.0
.data 4480 4480 0 0.0
.text 1051888 1051888 0 0.0
bl602+rpc (read/write) 1427034 1427034 0 0.0
.bss 125058 125058 0 0.0
.data 4600 4600 0 0.0
.text 1083556 1083552 -4 -0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 668515 668523 8 0.0
(read/write) 182828 182820 -8 -0.0
.bss 74236 74236 0 0.0
.data 3372 3372 0 0.0
.rodata 88195 88195 0 0.0
.text 580004 580012 8 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 634107 634099 -8 -0.0
(read/write) 157820 157820 0 0.0
.bss 73532 73532 0 0.0
.data 3372 3372 0 0.0
.rodata 77411 77411 0 0.0
.text 556372 556364 -8 -0.0
lock-ftd LP_CC2652R7 (read only) 671495 671495 0 0.0
(read/write) 170040 170040 0 0.0
.bss 71316 71316 0 0.0
.data 3296 3296 0 0.0
.rodata 76263 76263 0 0.0
.text 594752 594752 0 0.0
lock-mtd LP_CC2652R7 (read only) 653595 653595 0 0.0
(read/write) 183628 183628 0 0.0
.bss 67004 67004 0 0.0
.data 3296 3296 0 0.0
.rodata 100875 100875 0 0.0
.text 552240 552240 0 0.0
pump-app LP_CC2652R7 (read only) 680959 680959 0 0.0
(read/write) 161408 161408 0 0.0
.bss 71380 71380 0 0.0
.data 3296 3296 0 0.0
.rodata 88863 88863 0 0.0
.text 591612 591612 0 0.0
pump-controller-app LP_CC2652R7 (read only) 666519 666527 8 0.0
(read/write) 175984 175976 -8 -0.0
.bss 71516 71516 0 0.0
.data 3292 3292 0 0.0
.rodata 84679 84679 0 0.0
.text 581360 581368 8 0.0
shell LP_CC2652R7 (read only) 661206 661206 0 0.0
(read/write) 185656 185656 0 0.0
.bss 76556 76556 0 0.0
.data 3376 3376 0 0.0
.rodata 85166 85166 0 0.0
.text 575724 575724 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 583414 583406 -8 -0.0
.app_xip_area 460232 460224 -8 -0.0
.bss 65624 65624 0 0.0
.data 744 744 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 589158 589158 0 0.0
.app_xip_area 461248 461248 0 0.0
.bss 70352 70352 0 0.0
.data 748 748 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 588970 588970 0 0.0
.app_xip_area 466604 466604 0 0.0
.bss 64864 64864 0 0.0
.data 688 688 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read/write) 1088048 1088048 0 0.0
.bss 133260 133260 0 0.0
.data 2064 2064 0 0.0
.text 952704 952704 0 0.0
BRD4161A+rpc (read/write) 1142356 1142356 0 0.0
.bss 149940 149940 0 0.0
.data 2276 2276 0 0.0
.text 990120 990120 0 0.0
BRD4161A+rs911x (read/write) 973912 973912 0 0.0
.bss 161736 161736 0 0.0
.data 2048 2048 0 0.0
.text 810108 810108 0 0.0
lock-app BRD4161A+wf200 (read/write) 1128392 1128392 0 0.0
.bss 144368 144368 0 0.0
.data 2056 2056 0 0.0
.text 981948 981948 0 0.0
window-app BRD4161A (read/write) 1081316 1081316 0 0.0
.bss 134732 134732 0 0.0
.data 2092 2092 0 0.0
.text 944468 944468 0 0.0
esp32 all-clusters-app c3devkit (read only) 1022806 1022806 0 0.0
(read/write) 1486274 1486274 0 0.0
.dram0.bss 70296 70296 0 0.0
.dram0.data 14600 14600 0 0.0
.flash.rodata 215936 215936 0 0.0
.flash.text 1022806 1022806 0 0.0
.iram0.text 62902 62902 0 0.0
m5stack (read only) 1076295 1076295 0 0.0
(read/write) 488312 488312 0 0.0
.dram0.bss 75808 75808 0 0.0
.dram0.data 34144 34144 0 0.0
.flash.rodata 246364 246364 0 0.0
.flash.text 1070911 1070911 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w0+release (read/write) 642800 642800 0 0.0
.bss 69712 69712 0 0.0
.data 2044 2044 0 0.0
.text 568316 568316 0 0.0
lock k32w0+release (read/write) 699920 699920 0 0.0
.bss 70152 70152 0 0.0
.data 2052 2052 0 0.0
.text 624988 624988 0 0.0
linux chip-tool-ipv6only arm64 (read only) 9881988 9878692 -3296 -0.0
(read/write) 689041 689041 0 0.0
.bss 32897 32897 0 0.0
.data 3272 3272 0 0.0
.data.rel.ro 634336 634336 0 0.0
.dynamic 560 560 0 0.0
.got 13584 13584 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 468196 468132 -64 -0.0
.text 7798660 7795428 -3232 -0.0
thermostat-no-ble arm64 (read only) 2343516 2343516 0 0.0
(read/write) 141633 141633 0 0.0
.bss 55313 55313 0 0.0
.data 1672 1672 0 0.0
.data.rel.ro 75880 75880 0 0.0
.dynamic 560 560 0 0.0
.got 4992 4992 0 0.0
.init 24 24 0 0.0
.init_array 408 408 0 0.0
.rodata 138964 138964 0 0.0
.text 1967312 1967312 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2450608 2450672 64 0.0
.bss 214516 214516 0 0.0
.data 5872 5872 0 0.0
.text 1413252 1413316 64 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1172915 1172915 0 0.0
bss 143120 143120 0 0.0
rodata 141828 141828 0 0.0
text 809024 809024 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1152967 1152967 0 0.0
bss 142356 142356 0 0.0
rodata 133360 133360 0 0.0
text 798336 798336 0 0.0
p6 all-clusters-app default (read only) 881560 881560 0 0.0
(read/write) 1686972 1686972 0 0.0
.bss 149136 149136 0 0.0
.data 2648 2648 0 0.0
.text 1526800 1526800 0 0.0
all-clusters-minimal-app default (read only) 882280 882280 0 0.0
(read/write) 1631084 1631084 0 0.0
.bss 148416 148416 0 0.0
.data 2648 2648 0 0.0
.text 1471632 1471632 0 0.0
light-app default (read only) 890584 890584 0 0.0
(read/write) 1552492 1552492 0 0.0
.bss 140320 140320 0 0.0
.data 2440 2440 0 0.0
.text 1401344 1401344 0 0.0
lock-app default (read only) 886112 886112 0 0.0
(read/write) 1589908 1589908 0 0.0
.bss 144776 144776 0 0.0
.data 2456 2456 0 0.0
.text 1434288 1434288 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 804472 804472 0 0.0
bss 70964 70964 0 0.0
noinit 43488 43488 0 0.0
text 568540 568540 0 0.0
lighting-app tlsr9518adk80d (read/write) 824912 824912 0 0.0
bss 71808 71808 0 0.0
noinit 43488 43488 0 0.0
text 585428 585428 0 0.0

@woody-apple woody-apple merged commit f93e6cb into project-chip:master Jul 29, 2022
github-actions bot pushed a commit that referenced this pull request Jul 29, 2022
* [YAML][CI] Update the test runner to implement type checking

* Update src/app/tests/suites/ with boolean instead of bool types

* Update src/app/tests/suites/ with int*u instead of uint* types

* Update src/app/tests/suites/ with int*s instead of int* types

* Update src/app/tests/suites/ with bitmap* instead of map* types

* Update src/app/tests/suites/ with char_string instead of string types

* Update src/app/tests/suites/ with octet_string instead of octstr types

* Update src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml to use uint8 for CurrentFabricIndex instead of fabric_idx

* NODE_ID to node_id

* ENUM8 -> enum8

* Update Test_TC_DGWIFI_2_1.yaml to check for enum8 for SecurityType instead of enum

* Use int8s in Test_TC_TSTAT_2_2 instead of temp-s8 which is a type defined in the Thermostat spec but that does not match with anything specific in the SDK

* Convert OutPutInfo to list since OutputInfo is the inner type

* Check for enum8 instead of RoutingRole in Test_TC_DGTHREAD_2_1

* Use ApplicationBasicApplication instead of struct in Test_TC_APBSC_9_1

* vendor-id to vendor_id

* Update src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml to use vendor_id type for the vendorID attribute per spec

* Update Test_TC_BINFO_2_1 to check for type vendor_id instead of int16u for the vendorID attribute

* Update Test_TC_CHANNEL_5_3 to check for type ChannelInfo instead of list when reading the current channel attribute

* Update generated code
woody-apple added a commit that referenced this pull request Jul 29, 2022
…#21404)

* [YAML][CI] Update the test runner to implement type checking

* Update src/app/tests/suites/ with boolean instead of bool types

* Update src/app/tests/suites/ with int*u instead of uint* types

* Update src/app/tests/suites/ with int*s instead of int* types

* Update src/app/tests/suites/ with bitmap* instead of map* types

* Update src/app/tests/suites/ with char_string instead of string types

* Update src/app/tests/suites/ with octet_string instead of octstr types

* Update src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml to use uint8 for CurrentFabricIndex instead of fabric_idx

* NODE_ID to node_id

* ENUM8 -> enum8

* Update Test_TC_DGWIFI_2_1.yaml to check for enum8 for SecurityType instead of enum

* Use int8s in Test_TC_TSTAT_2_2 instead of temp-s8 which is a type defined in the Thermostat spec but that does not match with anything specific in the SDK

* Convert OutPutInfo to list since OutputInfo is the inner type

* Check for enum8 instead of RoutingRole in Test_TC_DGTHREAD_2_1

* Use ApplicationBasicApplication instead of struct in Test_TC_APBSC_9_1

* vendor-id to vendor_id

* Update src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml to use vendor_id type for the vendorID attribute per spec

* Update Test_TC_BINFO_2_1 to check for type vendor_id instead of int16u for the vendorID attribute

* Update Test_TC_CHANNEL_5_3 to check for type ChannelInfo instead of list when reading the current channel attribute

* Update generated code

Co-authored-by: Vivien Nicolas <[email protected]>
isiu-apple pushed a commit to isiu-apple/connectedhomeip that referenced this pull request Sep 16, 2022
…-chip#21354)

* [YAML][CI] Update the test runner to implement type checking

* Update src/app/tests/suites/ with boolean instead of bool types

* Update src/app/tests/suites/ with int*u instead of uint* types

* Update src/app/tests/suites/ with int*s instead of int* types

* Update src/app/tests/suites/ with bitmap* instead of map* types

* Update src/app/tests/suites/ with char_string instead of string types

* Update src/app/tests/suites/ with octet_string instead of octstr types

* Update src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml to use uint8 for CurrentFabricIndex instead of fabric_idx

* NODE_ID to node_id

* ENUM8 -> enum8

* Update Test_TC_DGWIFI_2_1.yaml to check for enum8 for SecurityType instead of enum

* Use int8s in Test_TC_TSTAT_2_2 instead of temp-s8 which is a type defined in the Thermostat spec but that does not match with anything specific in the SDK

* Convert OutPutInfo to list since OutputInfo is the inner type

* Check for enum8 instead of RoutingRole in Test_TC_DGTHREAD_2_1

* Use ApplicationBasicApplication instead of struct in Test_TC_APBSC_9_1

* vendor-id to vendor_id

* Update src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml to use vendor_id type for the vendorID attribute per spec

* Update Test_TC_BINFO_2_1 to check for type vendor_id instead of int16u for the vendorID attribute

* Update Test_TC_CHANNEL_5_3 to check for type ChannelInfo instead of list when reading the current channel attribute

* Update generated code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants