Skip to content

Commit 9bde938

Browse files
Documentation for YAML tests (project-chip#31575)
* YAML schema: add generator file * Docs: Start of testing documentation Pulls from the test harness presentations in Korea and Geneva * It's good to save before committing * docs: add generator for pseudocluster tables * add pseudoclusters into yaml doc * a bit more * fix loader * add titles * fix linter * Restyled by prettier-markdown * Restyled by autopep8 * Restyled by isort * fix spelling * add pics and pixit placeholder file * ignore generated files in spellcheck * update word list --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent db7d887 commit 9bde938

15 files changed

+816
-73
lines changed

.github/.wordlist.txt

+13
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ ASR
9595
AssertionError
9696
AST
9797
ASYNC
98+
ATLs
9899
atomics
99100
att
100101
attId
@@ -160,6 +161,7 @@ blockquote
160161
bluetoothd
161162
bluez
162163
BOOL
164+
booleans
163165
BooleanState
164166
bootable
165167
Bootloader
@@ -380,6 +382,7 @@ DefaultOTARequestor
380382
DefaultOTARequestorDriver
381383
DefaultOTARequestorStorage
382384
DefaultSuccess
385+
defaultValue
383386
definedValue
384387
DehumidificationControl
385388
DelayedActionTime
@@ -503,6 +506,7 @@ emberAfExternalAttributeReadCallback
503506
emberAfExternalAttributeWriteCallback
504507
EmberAfInitializeAttributes
505508
emberAfSetDynamicEndpoint
509+
emsp
506510
EnableNetwork
507511
EnableWiFiNetwork
508512
endian
@@ -604,6 +608,7 @@ GenericWiFiConfigurationManagerImpl
604608
GetDeviceId
605609
GetDeviceInfo
606610
GetDns
611+
GetInDevelopmentTests
607612
GetIP
608613
getManualTests
609614
GetSafeAttributePersistenceProvider
@@ -673,6 +678,7 @@ IasWd
673678
iaszone
674679
ibb
675680
ICA
681+
ICAC
676682
ICD
677683
ICDs
678684
iCloud
@@ -724,6 +730,7 @@ IoT
724730
ipaddr
725731
iPadOS
726732
ipadr
733+
IPK
727734
ipp
728735
iptables
729736
iputils
@@ -935,6 +942,7 @@ namespacing
935942
nano
936943
natively
937944
navpad
945+
nbsp
938946
NCP
939947
ncs
940948
nding
@@ -1076,6 +1084,7 @@ Pigweed
10761084
PinCode
10771085
pinrequest
10781086
PIXIT
1087+
PIXITs
10791088
pkgconfig
10801089
PKI
10811090
plaintext
@@ -1155,6 +1164,7 @@ RADVD
11551164
raspberryPi
11561165
RasPi
11571166
rAv
1167+
RCAC
11581168
RCP
11591169
ReadAttribute
11601170
ReadConfigValue
@@ -1219,6 +1229,7 @@ RTOS
12191229
RTT
12201230
RTX
12211231
runArgs
1232+
runIf
12221233
RUNAS
12231234
RunMain
12241235
runtime
@@ -1227,6 +1238,7 @@ rw
12271238
RXD
12281239
sandboxed
12291240
saveAs
1241+
saveDataVersschemaionAs
12301242
sbin
12311243
scalability
12321244
scalable
@@ -1377,6 +1389,7 @@ TestArray
13771389
TestCluster
13781390
TestConstraints
13791391
TestEmptyString
1392+
TestEqualities
13801393
TestGenExample
13811394
TestGroupDemoConfig
13821395
TestMultiRead

.spellcheck.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#
2121
# Actual run:
2222
#
23-
# pyspelling pyspelling --config .spellcheck.yml
23+
# pyspelling --config .spellcheck.yml
2424

2525
matrix:
2626
- name: markdown
@@ -65,6 +65,6 @@ matrix:
6565
# converts markdown to HTML
6666
- pyspelling.filters.markdown:
6767
sources:
68-
- '**/*.md|!third_party/**|!examples/common/**/repo/**|!docs/ERROR_CODES.md|!docs/clusters.md'
68+
- '**/*.md|!third_party/**|!examples/common/**/repo/**|!docs/ERROR_CODES.md|!docs/clusters.md|!docs/testing/yaml_schema.md|!docs/testing/yaml_pseudocluster.md'
6969
aspell:
7070
ignore-case: true

docs/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ cluster_and_device_type_dev/index
1616
guides/index
1717
style/index
1818
examples/index
19+
testing/index
1920
tools/index
2021
BUG_REPORT
2122
code_generation

docs/testing/ci_testing.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# CI testing
2+
3+
This file is a placeholder for information on how to run tests in the CI.
4+
5+
NOTE: discuss in particular triggers direct to the device, test event triggers
6+
and the CI pics.

docs/testing/index.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Testing Guides
2+
3+
The following guide provide an introduction to the testing mechanisms available
4+
in the SDK.
5+
6+
```{toctree}
7+
:glob:
8+
:maxdepth: 1
9+
:hidden:
10+
11+
*
12+
```
13+
14+
## Unit testing
15+
16+
- [Unit tests](./unit_testing.md)
17+
18+
## Integration and Certification tests
19+
20+
- [Integration and Certification tests](./integration_tests.md)
21+
- [YAML](./yaml.md)
22+
- [Python testing framework](./python.md)
23+
- [Enabling tests in the CI](./ci_testing.md)
24+
25+
## PICS and PIXIT
26+
27+
- [PICS and PIXIT](./pics_and_pixit.md)
28+
29+
## Testing in the CI
30+
31+
- [CI testing](./ci_testing.md)

docs/testing/integration_tests.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Integration and Certification Tests
2+
3+
Integration tests use a server and a controller or controllers to test the
4+
behavior of a device. Certification tests are all integration tests. For
5+
certified products, the device under test (DUT) is tested against one of the SDK
6+
controller implementations (either chip-tool or the python-based controller,
7+
depending on the test type). For software component certification, the software
8+
component is tested against a sample device built from the SDK.
9+
10+
Certification tests require an accompanying certification test plan in order to
11+
be used in the certification testing process. More information about test plans
12+
can be found in the
13+
[test plans repository](https://github.com/CHIP-Specifications/chip-test-plans/tree/master/docs).
14+
Integration testing can also be used outside of the certification testing
15+
program to test device behavior in the SDK. Certification tests are all run in
16+
the [CI](./ci_testing).
17+
18+
There are two main integration test types:
19+
20+
- [YAML](./yaml.md)
21+
- [Python framework](./python.md)
22+
23+
YAML is a human-readable serialization language that uses structured tags to
24+
define test steps. Tests are defined in YAML, and parsed and run through a
25+
runner that is backed by the chip-tool controller.
26+
27+
The Python framework tests are written in python and use the
28+
[Mobly](https://github.com/google/mobly) test framework to execute tests.
29+
30+
## Which test framework to use
31+
32+
Both types of tests can be run through the Test Harness for certification
33+
testing, locally for the purposes of development and in the CI for the SDK. The
34+
appropriate test framework to use is whatever lets you automate your tests in a
35+
way that is understandable, readable, and has the features you need
36+
37+
- YAML
38+
- pros: more readable, simpler to write, easy for ATLs to parse and
39+
understand
40+
- cons: conditionals are harder (not all supported), no branch control,
41+
schema not well documented
42+
- python
43+
- pros: full programming language, full control API with support for core
44+
(certs, commissioning, etc), less plumbing if you need to add features,
45+
can use python libraries
46+
- cons: more complex, can be harder to read

docs/testing/pics_and_pixit.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# PICS and PIXITs
2+
3+
Placeholder file for PICS and PIXIT info
4+
5+
- PICS formats - XML vs. test harness
6+
- PICS in CI
7+
- PICS tool and how we practically use it in Matter
8+
- PICS checker test
9+
- PIXITs in tests and how to set them
10+
- Why you should avoid using both of these things.

docs/testing/python.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Python framework tests
2+
3+
This file is a placeholder for python framework test information.
4+
5+
NOTE: be sure to include information about how you need to commission with the
6+
python controller, not chip-tool and how to do that in the scripts

docs/testing/unit_testing.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Unit testing
2+
3+
This doc is a placeholder for an guide around unit tests.

0 commit comments

Comments
 (0)