Skip to content

Commit 1e3fc88

Browse files
Sync csa branch with main (#271)
2 parents 8cc2cf7 + cd58e5e commit 1e3fc88

File tree

357 files changed

+3122
-1394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

357 files changed

+3122
-1394
lines changed

.github/workflows/build.yaml

+8-14
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,6 @@ jobs:
8181
run: scripts/run_in_build_env.sh "ninja -C ./out"
8282
- name: Run Tests
8383
run: scripts/tests/gn_tests.sh
84-
# TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227
85-
# TODO https://github.com/project-chip/connectedhomeip/issues/1512
86-
# - name: Run Code Coverage
87-
# if: ${{ contains('main', env.BUILD_TYPE) }}
88-
# run: scripts/tools/codecoverage.sh
89-
# - name: Upload Code Coverage
90-
# if: ${{ contains('main', env.BUILD_TYPE) }}
91-
# run: bash <(curl -s https://codecov.io/bash)
9284
- name: Set up Build Without Detail Logging
9385
run: scripts/build/gn_gen.sh --args="chip_detail_logging=false"
9486
- name: Run Build Without Detail Logging
@@ -488,16 +480,16 @@ jobs:
488480
build_linux_gcc_coverage:
489481
name: Build on Linux (coverage)
490482

491-
runs-on: ubuntu-latest
483+
env:
484+
TSAN_OPTIONS: "halt_on_error=1 suppressions=scripts/tests/chiptest/tsan-linux-suppressions.txt"
485+
492486
if: github.actor != 'restyled-io[bot]'
487+
runs-on: ubuntu-latest
493488

494489
container:
495490
image: ghcr.io/project-chip/chip-build:104
496-
volumes:
497-
- "/:/runner-root-volume"
498-
- "/tmp/log_output:/tmp/test_logs"
499491
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
500-
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
492+
net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0"
501493

502494
steps:
503495
- name: Checkout
@@ -506,6 +498,8 @@ jobs:
506498
uses: ./.github/actions/checkout-submodules-and-bootstrap
507499
with:
508500
platform: linux
501+
bootstrap-log-name: bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }}
509502

510503
- name: Run Build Coverage
511-
run: ./scripts/build_coverage.sh
504+
run: ./scripts/build_coverage.sh --yaml
505+

.github/workflows/full-android.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
if: github.actor != 'restyled-io[bot]'
4040

4141
container:
42-
image: ghcr.io/project-chip/chip-build-android:106
42+
image: ghcr.io/project-chip/chip-build-android:108
4343
volumes:
4444
- "/tmp/log_output:/tmp/test_logs"
4545

.github/workflows/lint.yml

-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ jobs:
114114
--known-failure app/util/config.h \
115115
--known-failure app/util/DataModelHandler.cpp \
116116
--known-failure app/util/DataModelHandler.h \
117-
--known-failure app/util/ember-global-attribute-access-interface.h \
118117
--known-failure app/util/ember-io-storage.h \
119118
--known-failure app/util/endpoint-config-api.h \
120119
--known-failure app/util/generic-callbacks.h \
@@ -133,7 +132,6 @@ jobs:
133132
# for them. Keeping them as a list as they still need review ...
134133
# --known-failure app/util/attribute-table.cpp \
135134
# --known-failure app/util/ember-io-storage.cpp \
136-
# --known-failure app/util/ember-global-attribute-access-interface.cpp \
137135
# --known-failure app/util/attribute-storage.cpp \
138136
- name: Check for matter lint errors
139137
if: always()

.github/workflows/smoketest-android.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
if: github.actor != 'restyled-io[bot]'
3838

3939
container:
40-
image: ghcr.io/project-chip/chip-build-android:106
40+
image: ghcr.io/project-chip/chip-build-android:108
4141
volumes:
4242
- "/:/runner-root-volume"
4343
- "/tmp/log_output:/tmp/test_logs"

.github/workflows/tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ jobs:
537537
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/TestIdChecks.py'
538538
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/TestMatterTestingSupport.py'
539539
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/TestSpecParsingDeviceType.py'
540+
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/TestSpecParsingSelection.py'
540541
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/TestSpecParsingSupport.py'
541542
542543
- name: Run Tests

docs/guides/BUILDING.md

+62-15
Original file line numberDiff line numberDiff line change
@@ -589,30 +589,77 @@ SDK source code has been executed. It also provides information on how often the
589589
Matter SDK executes segments of the code and produces a copy of the source file,
590590
annotated with execution frequencies.
591591
592-
Run the following command to initiate the script:
592+
### How to Run
593+
594+
```
595+
./scripts/build_coverage.sh [OPTIONS]
596+
```
597+
598+
By default, the script
599+
600+
Builds the Matter SDK with coverage instrumentation (unless you specify a custom
601+
--output_root). Runs the unit tests to generate coverage data. Produces an HTML
602+
coverage report located at:
603+
604+
```
605+
out/coverage/coverage/html/index.html
606+
```
607+
608+
You can extend the coverage scope and test types with the following options:
609+
610+
Option Description -c, --code=<scope> Specify the scope to collect coverage
611+
data. - core (default): Coverage from the core Matter SDK stack - clusters:
612+
Coverage from cluster implementations - all: Coverage from the entire Matter SDK
613+
614+
--yaml Also run YAML-based tests, in addition to unit tests.
615+
616+
--python Also run Python-based tests, in addition to unit tests.
617+
618+
-o, --output_root=DIR If specified, skip the build phase and only run coverage
619+
on the provided build output directory. This directory must have been built with
620+
use_coverage=true and have had tests run already.
621+
622+
--target=<testname> When running unit tests, specifies a particular test target
623+
to run (e.g., TestEmberAttributeBuffer.run).
624+
625+
-h, --help Print script usage and exit.
626+
627+
### Examples
628+
629+
Run coverage with the default scope (core) and only unit tests:
593630
594631
```
595632
./scripts/build_coverage.sh
596633
```
597634
598-
By default, the code coverage script is performed at the unit testing level.
599-
Unit tests are created by developers, thus giving them the best overview of what
600-
tests to include in unit testing. You can extend the coverage test by scope and
601-
ways of execution with the following parameters:
635+
Run coverage including YAML tests (plus the always-enabled unit tests):
636+
637+
```
638+
./scripts/build_coverage.sh --yaml
639+
```
640+
641+
Run coverage including Python tests (plus the always-enabled unit tests):
602642
603643
```
604-
-c, --code Specify which scope to collect coverage data.
605-
'core': collect coverage data from core stack in Matter SDK. --default
606-
'clusters': collect coverage data from clusters implementation in Matter SDK.
607-
'all': collect coverage data from Matter SDK.
608-
-t, --tests Specify which tools to run the coverage check.
609-
'unit': Run unit test to drive the coverage check. --default
610-
'yaml': Run yaml test to drive the coverage check.
611-
'all': Run unit & yaml test to drive the coverage check.
644+
./scripts/build_coverage.sh --python
612645
```
613646
614-
Also, see the up-to-date unit testing coverage report of the Matter SDK
615-
(collected daily) at:
647+
Run coverage including both YAML and Python tests:
648+
649+
```
650+
./scripts/build_coverage.sh --yaml --python
651+
```
652+
653+
Change coverage scope to all (core + clusters) and run YAML tests:
654+
655+
```
656+
./scripts/build_coverage.sh --code=all --yaml
657+
```
658+
659+
### Viewing Coverage Results
660+
661+
After the script completes, open the following file in your web browser to view
662+
the HTML coverage report:
616663
[matter coverage](https://matter-build-automation.ue.r.appspot.com).
617664
618665
## Maintaining Matter

examples/air-purifier-app/air-purifier-common/air-purifier-app.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ cluster GeneralCommissioning = 48 {
739739
provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6;
740740
provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7;
741741
provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8;
742-
provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9;
742+
provisional readonly attribute access(read: administer) optional nullable int32u TCUpdateDeadline = 9;
743743
readonly attribute command_id generatedCommandList[] = 65528;
744744
readonly attribute command_id acceptedCommandList[] = 65529;
745745
readonly attribute event_id eventList[] = 65530;

examples/air-purifier-app/ameba/main/chipinterface.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
#include <air-purifier-manager.h>
3131
#include <app/clusters/identify-server/identify-server.h>
3232
#include <app/clusters/network-commissioning/network-commissioning.h>
33-
#include <app/server/OnboardingCodesUtil.h>
3433
#include <app/util/endpoint-config-api.h>
3534
#include <data-model-providers/codegen/Instance.h>
3635
#include <lib/core/ErrorStr.h>
3736
#include <platform/Ameba/AmebaConfig.h>
3837
#include <platform/Ameba/NetworkCommissioningDriver.h>
3938
#include <platform/CHIPDeviceLayer.h>
4039
#include <setup_payload/ManualSetupPayloadGenerator.h>
40+
#include <setup_payload/OnboardingCodesUtil.h>
4141
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
4242
#if CONFIG_ENABLE_AMEBA_CRYPTO
4343
#include <platform/Ameba/crypto/AmebaPersistentStorageOperationalKeystore.h>

examples/air-purifier-app/cc32xx/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
#include <platform/CHIPDeviceLayer.h>
4040

4141
#include <app/server/Dnssd.h>
42-
#include <app/server/OnboardingCodesUtil.h>
4342
#include <data-model-providers/codegen/Instance.h>
43+
#include <setup_payload/OnboardingCodesUtil.h>
4444

4545
#include <ti/drivers/apps/Button.h>
4646
#include <ti/drivers/apps/LED.h>

examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ cluster GeneralCommissioning = 48 {
739739
provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6;
740740
provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7;
741741
provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8;
742-
provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9;
742+
provisional readonly attribute access(read: administer) optional nullable int32u TCUpdateDeadline = 9;
743743
readonly attribute command_id generatedCommandList[] = 65528;
744744
readonly attribute command_id acceptedCommandList[] = 65529;
745745
readonly attribute event_id eventList[] = 65530;

examples/air-quality-sensor-app/silabs/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
#include <app-common/zap-generated/callback.h>
4040
#include <app-common/zap-generated/cluster-objects.h>
4141
#include <app-common/zap-generated/ids/Attributes.h>
42-
#include <app/server/OnboardingCodesUtil.h>
4342
#include <app/server/Server.h>
4443
#include <app/util/attribute-storage.h>
4544
#include <assert.h>
4645
#include <lib/support/CodeUtils.h>
4746
#include <platform/CHIPDeviceLayer.h>
4847
#include <platform/silabs/platformAbstraction/SilabsPlatform.h>
48+
#include <setup_payload/OnboardingCodesUtil.h>
4949
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
5050
#include <setup_payload/SetupPayload.h>
5151

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -1642,7 +1642,7 @@ cluster GeneralCommissioning = 48 {
16421642
provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6;
16431643
provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7;
16441644
provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8;
1645-
provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9;
1645+
provisional readonly attribute access(read: administer) optional nullable int32u TCUpdateDeadline = 9;
16461646
readonly attribute command_id generatedCommandList[] = 65528;
16471647
readonly attribute command_id acceptedCommandList[] = 65529;
16481648
readonly attribute event_id eventList[] = 65530;

examples/all-clusters-app/ameba/main/chipinterface.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131

3232
#include <app/clusters/identify-server/identify-server.h>
3333
#include <app/clusters/network-commissioning/network-commissioning.h>
34-
#include <app/server/OnboardingCodesUtil.h>
3534
#include <app/server/Server.h>
3635
#include <app/util/endpoint-config-api.h>
3736
#include <data-model-providers/codegen/Instance.h>
3837
#include <lib/core/ErrorStr.h>
38+
#include <setup_payload/OnboardingCodesUtil.h>
3939

4040
#include <platform/Ameba/AmebaConfig.h>
4141
#include <platform/Ameba/NetworkCommissioningDriver.h>

examples/all-clusters-app/asr/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <app-common/zap-generated/ids/Clusters.h>
3232
#include <app/clusters/network-commissioning/network-commissioning.h>
3333
#include <app/server/Dnssd.h>
34-
#include <app/server/OnboardingCodesUtil.h>
3534
#include <app/server/Server.h>
3635
#include <app/util/attribute-storage.h>
3736
#include <app/util/endpoint-config-api.h>
@@ -40,6 +39,7 @@
4039
#include <platform/ASR/NetworkCommissioningDriver.h>
4140
#include <platform/CHIPDeviceLayer.h>
4241
#include <protocols/interaction_model/StatusCode.h>
42+
#include <setup_payload/OnboardingCodesUtil.h>
4343
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
4444
#include <setup_payload/SetupPayload.h>
4545
#include <static-supported-modes-manager.h>

examples/all-clusters-app/esp32/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "esp_idf_version.h"
2929
#include "esp_log.h"
3030
#include "freertos/FreeRTOS.h"
31-
#include <app/server/OnboardingCodesUtil.h>
31+
#include <setup_payload/OnboardingCodesUtil.h>
3232

3333
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
3434
#include "esp_spi_flash.h"

examples/all-clusters-app/esp32/main/include/DeviceWithDisplay.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333

3434
#include <app-common/zap-generated/attributes/Accessors.h>
3535
#include <app/server/Dnssd.h>
36-
#include <app/server/OnboardingCodesUtil.h>
3736
#include <app/server/Server.h>
37+
#include <setup_payload/OnboardingCodesUtil.h>
3838

3939
#if CONFIG_HAVE_DISPLAY
4040
#include "Display.h"

examples/all-clusters-app/esp32/main/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "nvs_flash.h"
3434
#include "platform/PlatformManager.h"
3535
#include "shell_extension/launch.h"
36-
#include <app/server/OnboardingCodesUtil.h>
3736
#include <app/util/endpoint-config-api.h>
3837
#include <binding-handler.h>
3938
#include <common/CHIPDeviceManager.h>
@@ -42,6 +41,7 @@
4241
#include <credentials/DeviceAttestationCredsProvider.h>
4342
#include <credentials/examples/DeviceAttestationCredsExample.h>
4443
#include <platform/ESP32/ESP32Utils.h>
44+
#include <setup_payload/OnboardingCodesUtil.h>
4545
#include <static-supported-modes-manager.h>
4646
#include <static-supported-temperature-levels.h>
4747

examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <app-common/zap-generated/attributes/Accessors.h>
2727
#include <app-common/zap-generated/ids/Clusters.h>
2828
#include <app/server/Dnssd.h>
29-
#include <app/server/OnboardingCodesUtil.h>
3029
#include <app/server/Server.h>
3130
#include <app/util/attribute-storage.h>
3231
#include <app/util/endpoint-config-api.h>
@@ -36,6 +35,7 @@
3635
#include <cy_wcm.h>
3736
#include <data-model-providers/codegen/Instance.h>
3837
#include <platform/CHIPDeviceLayer.h>
38+
#include <setup_payload/OnboardingCodesUtil.h>
3939
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
4040
#include <setup_payload/SetupPayload.h>
4141

examples/all-clusters-app/mbed/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "AppTask.h"
2020
#include "LEDWidget.h"
2121
#include <DFUManager.h>
22-
#include <app/server/OnboardingCodesUtil.h>
22+
#include <setup_payload/OnboardingCodesUtil.h>
2323

2424
#include <app/server/Dnssd.h>
2525
#include <app/server/Server.h>

examples/all-clusters-app/nrfconnect/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
#include <DeviceInfoProviderImpl.h>
2626

27-
#include <app/server/OnboardingCodesUtil.h>
2827
#include <app/server/Server.h>
28+
#include <setup_payload/OnboardingCodesUtil.h>
2929

3030
#include <app/TestEventTriggerDelegate.h>
3131
#include <app/clusters/identify-server/identify-server.h>

examples/all-clusters-app/nxp/mw320/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
#include <lib/shell/Engine.h>
2121

22-
#include <app/server/OnboardingCodesUtil.h>
2322
#include <platform/CHIPDeviceLayer.h>
23+
#include <setup_payload/OnboardingCodesUtil.h>
2424
#include <setup_payload/SetupPayload.h>
2525

2626
#include <lib/core/CHIPCore.h>

examples/all-clusters-app/nxp/rt/rt1060/BUILD.gn

+4-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,10 @@ rt_executable("all_cluster_app") {
159159
"${common_example_dir}/matter_button/source/ButtonRegistrationDefault.cpp",
160160
]
161161

162-
deps = [ "${chip_root}/examples/${app_common_folder}" ]
162+
deps = [
163+
"${chip_root}/examples/${app_common_folder}",
164+
"${chip_root}/src/setup_payload:onboarding-codes-utils",
165+
]
163166

164167
sources += [
165168
"${chip_root}/examples/${app_common_folder}/src/bridged-actions-stub.cpp",

examples/all-clusters-app/nxp/rt/rt1170/BUILD.gn

+4-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ rt_executable("all_cluster_app") {
145145
"${common_example_dir}/matter_button/source/ButtonRegistrationEmpty.cpp",
146146
]
147147

148-
deps = [ "${chip_root}/examples/${app_common_folder}" ]
148+
deps = [
149+
"${chip_root}/examples/${app_common_folder}",
150+
"${chip_root}/src/setup_payload:onboarding-codes-utils",
151+
]
149152

150153
sources += [
151154
"${chip_root}/examples/${app_common_folder}/src/bridged-actions-stub.cpp",

examples/all-clusters-app/nxp/rt/rw61x/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ rt_executable("all_cluster_app") {
167167
deps = [
168168
"${chip_root}/examples/${app_common_folder}",
169169
"${chip_root}/src/platform/logging:default",
170+
"${chip_root}/src/setup_payload:onboarding-codes-utils",
170171
]
171172

172173
sources += [

examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter

+1-1
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,7 @@ cluster GeneralCommissioning = 48 {
15571557
provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6;
15581558
provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7;
15591559
provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8;
1560-
provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9;
1560+
provisional readonly attribute access(read: administer) optional nullable int32u TCUpdateDeadline = 9;
15611561
readonly attribute command_id generatedCommandList[] = 65528;
15621562
readonly attribute command_id acceptedCommandList[] = 65529;
15631563
readonly attribute event_id eventList[] = 65530;

0 commit comments

Comments
 (0)