-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[MatterYamlTests] Allow enum names in YAML instead of raw values #32107
[MatterYamlTests] Allow enum names in YAML instead of raw values #32107
Conversation
PR #32107: Size comparison from ea56e40 to d8f1c69 Full report (41 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32)
|
d8f1c69
to
cf40f0e
Compare
PR #32107: Size comparison from 06c5769 to cf40f0e Decreases (1 build for efr32)
Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32, telink)
|
PR #32107: Size comparison from 06c5769 to 46f5dbd Increases (17 builds for cc13x4_26x4, linux)
Decreases (46 builds for cc13x4_26x4, cyw30739, efr32, esp32, k32w, linux, nrfconnect, psoc6, qpg, telink)
Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32, telink)
|
0140253
to
2b8f0f7
Compare
I have updated the PR to be a little but more readable (I hope) and with some additional tests. |
PR #32107: Size comparison from 91ba8b6 to 2b8f0f7 Decreases (1 build for efr32)
Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32, telink)
|
2b8f0f7
to
47c4eaf
Compare
PR #32107: Size comparison from 598356c to 47c4eaf Decreases (1 build for efr32)
Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32, telink)
|
47c4eaf
to
1674946
Compare
PR #32107: Size comparison from 274719d to 1674946 Full report (6 builds for cc32xx, mbed, qpg, stm32)
|
1674946
to
33417c1
Compare
PR #32107: Size comparison from 274719d to 33417c1 Decreases (1 build for efr32)
Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32, telink)
|
33417c1
to
473a87d
Compare
PR #32107: Size comparison from 274719d to 473a87d Decreases (1 build for efr32)
Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32, telink)
|
Co-authored-by: Boris Zbarsky <[email protected]>
…ject-chip#32107) * [YAML] Allow the YAML tests to use the enum names instead of the raw value * Update the YAML tests * [MatterYamlTests] Get test_yaml_parser.py to be runned in CI * [MatterYamlTests] Add tests to test_yaml_parser.py * Update errors.py Co-authored-by: Boris Zbarsky <[email protected]> --------- Co-authored-by: Boris Zbarsky <[email protected]>
…ject-chip#32107) * [YAML] Allow the YAML tests to use the enum names instead of the raw value * Update the YAML tests * [MatterYamlTests] Get test_yaml_parser.py to be runned in CI * [MatterYamlTests] Add tests to test_yaml_parser.py * Update errors.py Co-authored-by: Boris Zbarsky <[email protected]> --------- Co-authored-by: Boris Zbarsky <[email protected]>
Problem
When writing tests using YAML, when a test specify an enum value it can not be used as if, one would need to write the raw value. As a result there are often steps where the "name" of the enum value is added next to the raw value.
This PR allows names to be specified instead of raw values. It also introduce a
UnknownEnumValue
that is automatically calculated based on the values from the enum definitions.Some tests may want to specify the invalid value they want to use, for those case writing
EnumName.UnknownEnumValue(66)
is allowed if the invalid value is66
.For now using an enum name is not enforced but I think we should ultimately do it when used in a as it make the test clearer and matches the test plan better.
The PR also updates some tests. Most of them are just valid tests that does not fit the new syntax but for 2 of them that looks like errors: