Skip to content

Commit 33aaac8

Browse files
authored
Merge branch 'master' into feature/app-install-flow-public
2 parents 3f815e9 + f83d67b commit 33aaac8

File tree

110 files changed

+6782
-553
lines changed

Some content is hidden

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

110 files changed

+6782
-553
lines changed

.github/workflows/build.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ on:
2626
run-codeql:
2727
required: false
2828
type: boolean
29-
29+
3030
concurrency:
3131
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
3232
cancel-in-progress: true
3333

3434
env:
3535
CHIP_NO_LOG_TIMESTAMPS: true
36-
36+
3737
jobs:
3838
build_linux_gcc_debug:
3939
name: Build on Linux (gcc_debug)
@@ -210,7 +210,7 @@ jobs:
210210
./scripts/run_in_build_env.sh \
211211
"./scripts/run-clang-tidy-on-compile-commands.py \
212212
--compile-database out/sanitizers/compile_commands.json \
213-
--file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|-ReadImpl|-InvokeSubscribeImpl|CodegenDataModel_Write' \
213+
--file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|-ReadImpl|-InvokeSubscribeImpl|CodegenDataModel_Write|QuieterReporting' \
214214
check \
215215
"
216216
- name: Clean output
@@ -243,7 +243,7 @@ jobs:
243243
run: |
244244
rm -rf ./zzz_pregenerated
245245
mv scripts/codegen.py.renamed scripts/codegen.py
246-
mv scripts/tools/zap/generate.py.renamed scripts/tools/zap/generate.py
246+
mv scripts/tools/zap/generate.py.renamed scripts/tools/zap/generate.py
247247
- name: Run fake linux tests with build_examples
248248
run: |
249249
./scripts/run_in_build_env.sh \
@@ -253,7 +253,7 @@ jobs:
253253
uses: ./.github/actions/perform-codeql-analysis
254254
with:
255255
language: cpp
256-
256+
257257
- name: Uploading core files
258258
uses: actions/upload-artifact@v4
259259
if: ${{ failure() && !env.ACT }}
@@ -430,7 +430,7 @@ jobs:
430430
./scripts/run_in_build_env.sh \
431431
"./scripts/run-clang-tidy-on-compile-commands.py \
432432
--compile-database out/default/compile_commands.json \
433-
--file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|CodegenDataModel_Write' \
433+
--file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|CodegenDataModel_Write|QuieterReporting' \
434434
check \
435435
"
436436
- name: Uploading diagnostic logs
@@ -445,7 +445,7 @@ jobs:
445445
uses: ./.github/actions/perform-codeql-analysis
446446
with:
447447
language: cpp
448-
448+
449449
# TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227
450450
# TODO https://github.com/project-chip/connectedhomeip/issues/1512
451451

.github/workflows/tests.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ jobs:
112112
src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml \
113113
src/app/zap-templates/zcl/data-model/chip/clusters-extensions.xml \
114114
src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml \
115+
src/app/zap-templates/zcl/data-model/chip/commissioner-control-cluster.xml \
115116
src/app/zap-templates/zcl/data-model/chip/concentration-measurement-cluster.xml \
116117
src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml \
117118
src/app/zap-templates/zcl/data-model/chip/content-app-observer-cluster.xml \
@@ -494,7 +495,7 @@ jobs:
494495
- name: Run Tests
495496
run: |
496497
mkdir -p out/trace_data
497-
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --quiet --app-args "--trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--log-level INFO -t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
498+
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/controller/python/test/test_scripts/mobile-device-test.py'
498499
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ACE_1_2.py'
499500
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ACE_1_3.py'
500501
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ACE_1_4.py'

docs/testing/python.md

+62-52
Original file line numberDiff line numberDiff line change
@@ -85,58 +85,8 @@ The default_matter_test_main() function is used to run the test on the command
8585
line. These two lines should appear verbatim at the bottom of every python test
8686
file.
8787

88-
## Defining the test arguments
89-
90-
Below is the format:
91-
92-
```
93-
# test-runner-runs: <run_identifier>
94-
# test-runner-run/<run_identifier>/app: ${TYPE_OF_APP}
95-
# test-runner-run/<run_identifier>/factoryreset: <True|False>
96-
# test-runner-run/<run_identifier>/quiet: <True|False>
97-
# test-runner-run/<run_identifier>/app-args: <app_arguments>
98-
# test-runner-run/<run_identifier>/script-args: <script_arguments>
99-
```
100-
101-
### Description of Parameters
102-
103-
- test-runner-runs: Specifies the identifier for the run. This can be any
104-
unique identifier.
105-
106-
- Example: run1
107-
108-
- test-runner-run/<run_identifier>/app: Indicates the application to be used
109-
in the test. Different app types as needed could be referenced from section
110-
[name: Generate an argument environment file ] of the file
111-
[.github/workflows/tests.yaml](https://github.com/project-chip/connectedhomeip/blob/master/.github/workflows/tests.yaml)
112-
113-
- Example: \${TYPE_OF_APP}
114-
115-
- test-runner-run/<run_identifier>/factoryreset: Determines whether a factory
116-
reset should be performed before the test.
117-
118-
- Example: True
119-
120-
- test-runner-run/<run_identifier>/quiet: Sets the verbosity level of the test
121-
run. When set to True, the test run will be quieter.
122-
123-
- Example: True
124-
125-
- test-runner-run/<run_identifier>/app-args: Specifies the arguments to be
126-
passed to the application during the test.
127-
128-
- Example: --discriminator 1234 --KVS kvs1 --trace-to
129-
json:\${TRACE_APP}.json
130-
131-
- test-runner-run/<run_identifier>/script-args: Specifies the arguments to be
132-
passed to the test script.
133-
- Example: --storage-path admin_storage.json --commissioning-method
134-
on-network --discriminator 1234 --passcode 20202021 --trace-to
135-
json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
136-
137-
This structured format ensures that all necessary configurations are clearly
138-
defined and easily understood, allowing for consistent and reliable test
139-
execution.
88+
The structured comments above the class definition are used to set up the CI for
89+
the tests. Please see [Running tests in CI](#running-tests-in-ci).
14090

14191
## Cluster Codegen
14292

@@ -610,3 +560,63 @@ example DUT on the host and includes factory reset support
610560
- if there are things in your test that will fail on CI (ex. test vendor
611561
checks), gate them on the PICS_SDK_CI_ONLY
612562
- is_ci = self.check_pics('PICS_SDK_CI_ONLY')
563+
564+
The CI test runner uses a structured environment setup that can be declared
565+
using structured comments at the top of the test file. To use this structured
566+
format, use the --load-from-env flag with the run_python_tests.py runner.
567+
568+
Ex:
569+
`scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ICDM_2_1.py'`
570+
571+
## Defining the CI test arguments
572+
573+
Below is the format:
574+
575+
```
576+
# test-runner-runs: <run_identifier>
577+
# test-runner-run/<run_identifier>/app: ${TYPE_OF_APP}
578+
# test-runner-run/<run_identifier>/factoryreset: <True|False>
579+
# test-runner-run/<run_identifier>/quiet: <True|False>
580+
# test-runner-run/<run_identifier>/app-args: <app_arguments>
581+
# test-runner-run/<run_identifier>/script-args: <script_arguments>
582+
```
583+
584+
### Description of Parameters
585+
586+
- test-runner-runs: Specifies the identifier for the run. This can be any
587+
unique identifier.
588+
589+
- Example: run1
590+
591+
- test-runner-run/<run_identifier>/app: Indicates the application to be used
592+
in the test. Different app types as needed could be referenced from section
593+
[name: Generate an argument environment file ] of the file
594+
[.github/workflows/tests.yaml](https://github.com/project-chip/connectedhomeip/blob/master/.github/workflows/tests.yaml)
595+
596+
- Example: \${TYPE_OF_APP}
597+
598+
- test-runner-run/<run_identifier>/factoryreset: Determines whether a factory
599+
reset should be performed before the test.
600+
601+
- Example: True
602+
603+
- test-runner-run/<run_identifier>/quiet: Sets the verbosity level of the test
604+
run. When set to True, the test run will be quieter.
605+
606+
- Example: True
607+
608+
- test-runner-run/<run_identifier>/app-args: Specifies the arguments to be
609+
passed to the application during the test.
610+
611+
- Example: --discriminator 1234 --KVS kvs1 --trace-to
612+
json:\${TRACE_APP}.json
613+
614+
- test-runner-run/<run_identifier>/script-args: Specifies the arguments to be
615+
passed to the test script.
616+
- Example: --storage-path admin_storage.json --commissioning-method
617+
on-network --discriminator 1234 --passcode 20202021 --trace-to
618+
json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
619+
620+
This structured format ensures that all necessary configurations are clearly
621+
defined and easily understood, allowing for consistent and reliable test
622+
execution.

docs/zap_clusters.md

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ Generally regenerate using one of:
131131
| 1294 | 0x50E | AccountLogin |
132132
| 1295 | 0x50F | ContentControl |
133133
| 1296 | 0x510 | ContentAppObserver |
134+
| 1873 | 0x751 | CommissionerControl |
134135
| 2820 | 0xB04 | ElectricalMeasurement |
135136
| 4294048773 | 0xFFF1FC05 | UnitTesting |
136137
| 4294048774 | 0xFFF1FC06 | FaultInjection |

examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CHIPCommandBridge : public Command {
3939
{
4040
AddArgument("commissioner-name", &mCommissionerName);
4141
AddArgument("commissioner-nodeId", 0, UINT64_MAX, &mCommissionerNodeId,
42-
"Sets the commisser node ID of the given "
42+
"Sets the commissioner node ID of the given "
4343
"commissioner-name. Interactive mode will only set a single commissioner on the inital command. "
4444
"The commissioner node ID will be persisted until a different one is specified.");
4545
AddArgument("paa-trust-store-path", &mPaaTrustStorePath,

examples/darwin-framework-tool/commands/pairing/DeviceControllerDelegateBridge.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ - (void)controller:(MTRDeviceController *)controller statusUpdate:(MTRCommission
3636
ChipLogError(chipTool, "MTRCommissioningStatusDiscoveringMoreDevices: This should not happen.");
3737
break;
3838
case MTRCommissioningStatusUnknown:
39-
ChipLogError(chipTool, "Uknown Pairing Status");
39+
ChipLogError(chipTool, "Unknown Pairing Status");
4040
break;
4141
}
4242
}

scripts/rules.matterlint

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/chip-ota.xml";
1919
load "../src/app/zap-templates/zcl/data-model/chip/chip-types.xml";
2020
load "../src/app/zap-templates/zcl/data-model/chip/clusters-extensions.xml";
2121
load "../src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml";
22+
load "../src/app/zap-templates/zcl/data-model/chip/commissioner-control-cluster.xml";
2223
load "../src/app/zap-templates/zcl/data-model/chip/concentration-measurement-cluster.xml";
2324
load "../src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml";
2425
load "../src/app/zap-templates/zcl/data-model/chip/content-app-observer-cluster.xml";

scripts/setup/zap.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
"mac-amd64",
99
"windows-amd64"
1010
],
11-
"tags": ["version:2@v2024.06.10-nightly.1"]
11+
"tags": ["version:2@v2024.07.10-nightly.1"]
1212
},
1313
{
1414
"_comment": "Always get the amd64 version on mac until usable arm64 zap build is available",
1515
"path": "fuchsia/third_party/zap/mac-amd64",
1616
"platforms": ["mac-arm64"],
17-
"tags": ["version:2@v2024.06.10-nightly.1"]
17+
"tags": ["version:2@v2024.07.10-nightly.1"]
1818
}
1919
]
2020
}

scripts/setup/zap.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2024.06.10-nightly
1+
v2024.07.10-nightly

scripts/tools/zap/zap_execution.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# Use scripts/tools/zap/version_update.py to manage ZAP versioning as many
2424
# files may need updating for versions
2525
#
26-
MIN_ZAP_VERSION = '2024.6.6'
26+
MIN_ZAP_VERSION = '2024.7.10'
2727

2828

2929
class ZapTool:

scripts/tools/zap_regen_all.py

+22-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,8 @@ def setupArgumentsParser():
350350

351351
parser.add_argument('--parallel', action='store_true')
352352
parser.add_argument('--no-parallel', action='store_false', dest='parallel')
353-
parser.set_defaults(parallel=True)
353+
parser.add_argument('--no-rerun-in-env', action='store_false', dest='rerun_in_env')
354+
parser.set_defaults(parallel=True, rerun_in_env=True)
354355

355356
args = parser.parse_args()
356357

@@ -495,6 +496,26 @@ def main():
495496
level=logging.INFO,
496497
format='%(asctime)s %(name)s %(levelname)-7s %(message)s'
497498
)
499+
500+
# The scripts executed by this generally MUST be within a bootstrapped environment because
501+
# we need:
502+
# - zap-cli in PATH
503+
# - scripts/codegen.py uses click (can be in current pyenv, but guaranteed in bootstrap)
504+
# - formatting is using bootstrapped clang-format
505+
# Figure out if bootstrapped. For now assume `PW_ROOT` is such a marker in the environment
506+
if "PW_ROOT" not in os.environ:
507+
logging.error("Script MUST be run in a bootstrapped environment.")
508+
509+
# using the `--no-rerun-in-env` to avoid recursive infinite calls
510+
if '--no-rerun-in-env' not in sys.argv:
511+
import shlex
512+
logging.info("Will re-try running in a build environment....")
513+
514+
what_to_run = sys.argv + ['--no-rerun-in-env']
515+
launcher = os.path.join(CHIP_ROOT_DIR, 'scripts', 'run_in_build_env.sh')
516+
os.execv(launcher, [launcher, shlex.join(what_to_run)])
517+
sys.exit(1)
518+
498519
checkPythonVersion()
499520
os.chdir(CHIP_ROOT_DIR)
500521
args = setupArgumentsParser()

src/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ if (chip_build_tests) {
5151
deps = []
5252
tests = [
5353
"${chip_root}/src/app/data-model/tests",
54+
"${chip_root}/src/app/cluster-building-blocks/tests",
5455
"${chip_root}/src/app/data-model-interface/tests",
5556
"${chip_root}/src/access/tests",
5657
"${chip_root}/src/crypto/tests",

src/app/AttributeAccessInterfaceCache.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class AttributeAccessInterfaceCache
4848
kDefinitelyUsed
4949
};
5050

51-
constexpr AttributeAccessInterfaceCache() = default;
51+
AttributeAccessInterfaceCache() { Invalidate(); }
5252

5353
/**
5454
* @brief Invalidate the whole cache. Must be called every time list of AAI registrations changes.
@@ -106,8 +106,6 @@ class AttributeAccessInterfaceCache
106106
private:
107107
struct AttributeAccessCacheEntry
108108
{
109-
constexpr AttributeAccessCacheEntry() = default;
110-
111109
EndpointId endpointId = kInvalidEndpointId;
112110
ClusterId clusterId = kInvalidClusterId;
113111
AttributeAccessInterface * accessor = nullptr;
@@ -139,8 +137,8 @@ class AttributeAccessInterfaceCache
139137
return &mCacheSlots[0];
140138
}
141139

142-
AttributeAccessCacheEntry mCacheSlots[1] = {};
143-
AttributeAccessCacheEntry mLastUnusedEntry{};
140+
AttributeAccessCacheEntry mCacheSlots[1];
141+
AttributeAccessCacheEntry mLastUnusedEntry;
144142
};
145143

146144
} // namespace app

src/app/BUILD.gn

+18-2
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static_library("interaction-model") {
207207

208208
public_deps = [
209209
":app_config",
210-
":command-handler",
210+
":command-handler-impl",
211211
":constants",
212212
":paths",
213213
":subscription-info-provider",
@@ -333,16 +333,32 @@ source_set("status-response") {
333333
]
334334
}
335335

336-
source_set("command-handler") {
336+
source_set("command-handler-interface") {
337337
sources = [
338338
"CommandHandler.cpp",
339339
"CommandHandler.h",
340340
"CommandHandlerExchangeInterface.h",
341+
]
342+
343+
public_deps = [
344+
":paths",
345+
"${chip_root}/src/access:types",
346+
"${chip_root}/src/app/data-model",
347+
"${chip_root}/src/lib/core",
348+
"${chip_root}/src/lib/support",
349+
"${chip_root}/src/messaging",
350+
"${chip_root}/src/protocols/interaction_model",
351+
]
352+
}
353+
354+
source_set("command-handler-impl") {
355+
sources = [
341356
"CommandHandlerImpl.cpp",
342357
"CommandHandlerImpl.h",
343358
]
344359

345360
public_deps = [
361+
":command-handler-interface",
346362
":paths",
347363
":required-privileges",
348364
":status-response",

src/app/EventLoggingTypes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ struct Timestamp
100100
kSystem = 0,
101101
kEpoch
102102
};
103-
constexpr Timestamp() = default;
103+
Timestamp() {}
104104
Timestamp(Type aType, uint64_t aValue) : mType(aType), mValue(aValue) {}
105105
Timestamp(System::Clock::Timestamp aValue) : mType(Type::kSystem), mValue(aValue.count()) {}
106106
static Timestamp Epoch(System::Clock::Timestamp aValue)

0 commit comments

Comments
 (0)