Skip to content

Skill for Running Python Tests#72253

Open
zaid-google wants to merge 9 commits into
project-chip:masterfrom
zaid-google:python_test_skill
Open

Skill for Running Python Tests#72253
zaid-google wants to merge 9 commits into
project-chip:masterfrom
zaid-google:python_test_skill

Conversation

@zaid-google
Copy link
Copy Markdown
Contributor

Summary

This PR is adding a new skill on how to run python tests in this repo. It goes over how to read the test file's CI arguments, build the relevant apps needed for a test, setting up the python environment, and the different methods a test can be run in.

Testing

  • Documentation change only
  • CI should still pass

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new markdown file, SKILL.md, under .agents/skills/python-test-runner/ which provides comprehensive guidelines and instructions for setting up and running Python-based integration and certification tests. The feedback identifies a syntax error in one of the command-line examples due to an unmatched trailing double quote.

Comment thread .agents/skills/python-test-runner/SKILL.md Outdated
Comment thread .agents/skills/python-test-runner/SKILL.md Outdated
Comment thread .agents/skills/python-test-runner/SKILL.md Outdated
Comment thread .agents/skills/python-test-runner/SKILL.md
Comment thread .agents/skills/python-test-runner/SKILL.md Outdated
Comment thread .agents/skills/python-test-runner/SKILL.md Outdated
Comment thread .agents/skills/python-test-runner/SKILL.md Outdated
Comment thread .agents/skills/python-test-runner/SKILL.md
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.52%. Comparing base (939306e) to head (2c32d46).
⚠️ Report is 16 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #72253   +/-   ##
=======================================
  Coverage   55.52%   55.52%           
=======================================
  Files        1629     1629           
  Lines      111095   111092    -3     
  Branches    13416    13415    -1     
=======================================
- Hits        61684    61683    -1     
+ Misses      49411    49409    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

PR #72253: Size comparison from 507b108 to 0f4ef55

Full report (31 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 507b108 0f4ef55 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094196 1094196 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105508 1105508 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593280 1593280 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057208 1057208 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896004 896004 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776932 776932 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789628 789628 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738752 738752 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718908 718908 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568670 568670 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596166 596166 0 0.0
RAM 205256 205256 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834236 834236 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733900 1733900 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622692 1622692 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470180 1470180 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503316 1503316 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845060 845060 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783808 783808 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688600 688600 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729664 729664 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478372 478372 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813010 813010 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606462 606462 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731374 731374 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851730 851730 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843058 843058 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731864 731864 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795090 795090 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731794 731794 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614510 614510 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841172 841176 4 0.0
RAM 97364 97364 0 0.0

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

PR #72253: Size comparison from 507b108 to 2c32d46

Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 507b108 2c32d46 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094196 1094196 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105508 1105508 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593280 1593280 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057208 1057208 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896004 896004 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776932 776932 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789628 789628 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738752 738752 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718908 718908 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568670 568670 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596166 596166 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994072 994072 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798669 798661 -8 -0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100496 1100496 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621488 1621488 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834236 834236 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733900 1733900 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622692 1622692 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470180 1470180 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503316 1503316 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845060 845060 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783808 783808 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688600 688600 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729664 729664 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478372 478372 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813010 813010 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606462 606462 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731374 731374 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851730 851730 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843058 843058 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731864 731864 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795090 795090 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731794 731794 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614510 614510 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841172 841176 4 0.0
RAM 97364 97364 0 0.0


---

## Running Tests: Method 1 (CI Meta Runner - Recommended)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we recommend this? local.py is optimized to "run all tests" but this also means the build-apps will build a lot of things.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion this is the nicest way (once things are setup) as it runs what CI does!

You can always use --test-filter {test_name} to filter things out

### 1. Identify the Required Application

Open the Python test file (e.g., `src/python_testing/TC_FAN_3_3.py`) and locate
the **`=== BEGIN CI TEST ARGUMENTS ===`** block near the top of the file. Under
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we mention the possibility of multiple runs? we may want to ask the user which run if more exists (or run all, which may need to run more applications.

--override-binary-path ALL_CLUSTERS_APP out/linux-x64-all-clusters-no-ble/chip-all-clusters-app
```

### Notable Arguments for `local.py python-tests`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there's also a --app-filter if I remember correctly? That enables you to filter by both test name and app name.

For example, if you want to run all of the FAN tests only against the all-devices-app you could do something like --test-filter TC_FAN --app-filter ALL_DEVICES

Need to check if this still works

@soares-sergio soares-sergio added the sdk-maintainer-approved PR marked by `matter-sdk-maintainers` as suitable for MERGE - meets guideline & sufficient reviews. label May 29, 2026
and running python-based integration and certification tests located in
`src/python_testing/`. Use this skill to run important regression tests
during developement or, when building new example apps, or when there is a
need to execute python test scripts or "certification test scripts" or
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably teach it to run device basic composition tests and device conformance tests.

# Python Test Runner

This skill provides expert guidelines for running Python-based integration and
certification tests located in `src/python_testing/`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also teach it to collect a data model dump by running the TC_IDM test that generates the files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review - pending sdk-maintainer-approved PR marked by `matter-sdk-maintainers` as suitable for MERGE - meets guideline & sufficient reviews.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants