[Tests] Improve logger configuration#43548
[Tests] Improve logger configuration#43548MarekPikula wants to merge 11 commits intoproject-chip:masterfrom
Conversation
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors and extends logging for the Python test runner infrastructure to better support upcoming concurrent test execution, including introducing a shared logging configuration helper and improving log readability (process/thread/task context).
Changes:
- Added
chiptest.log_utils.LogConfig+ filter to centralize coloredlogs configuration and support temporary per-scope formatting/level changes. - Introduced
--log-level-teststo apply a different log level only during test execution. - Improved log readability by naming threads (XML RPC server, LogPipe stdout/stderr) and reducing namespace command noise.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/python_testing/matter_testing_infrastructure/matter/testing/linux/namespace.py |
Logs executed netns commands more clearly and silences command output. |
scripts/tests/run_test_suite.py |
Switches to LogConfig, adds --log-level-tests, and applies per-test log formatting/verbosity via context managers. |
scripts/tests/chiptest/runner.py |
Renames LogPipe threads for clearer identification in logs. |
scripts/tests/chiptest/log_utils.py |
New centralized logging config + filter injecting process/thread/task fields. |
scripts/tests/chiptest/accessories.py |
Names the XML RPC server thread to improve log traceability. |
You can also share your feedback on Copilot code review. Take the survey.
src/python_testing/matter_testing_infrastructure/matter/testing/linux/namespace.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Code Review
The pull request introduces a new LogConfig class to centralize logger configuration and format management, which is a good step towards supporting concurrent test execution. It also adds process, thread, and task information to log formats, enhancing log readability and traceability. The new --log-level-tests option allows for more granular control over logging verbosity during test runs, which is a valuable feature for debugging. Additionally, the changes improve log messages for Linux namespaces and suppress unnecessary stdout/stderr from subprocesses, contributing to cleaner output. Overall, these changes are well-aligned with the stated goals of improving logger configuration and preparing for future concurrent tests.
|
PR #43548: Size comparison from be49d55 to a1eab84 Full report (5 builds for cc32xx, realtek, stm32)
|
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
You can also share your feedback on Copilot code review. Take the survey.
src/python_testing/matter_testing_infrastructure/matter/testing/linux/namespace.py
Show resolved
Hide resolved
|
PR #43548: Size comparison from be49d55 to bacee4f Full report (34 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #43548 +/- ##
=======================================
Coverage 54.07% 54.07%
=======================================
Files 1548 1548
Lines 106709 106709
Branches 13308 13308
=======================================
Hits 57704 57704
Misses 49005 49005 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
|
PR #43548: Size comparison from be49d55 to 2ec344b Full report (34 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
|
@MarekPikula it seems we get a: maybe logging naming had a conflict. We could try with other names to not clash with standard imports. It is unfortunate imports are not structural enough. |
I think that the problem is because we are running |
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
You can also share your feedback on Copilot code review. Take the survey.
|
PR #43548: Size comparison from be49d55 to 1514e3a Full report (34 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
You can also share your feedback on Copilot code review. Take the survey.
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
You can also share your feedback on Copilot code review. Take the survey.
|
PR #43548: Size comparison from fa956ce to ad108b4 Full report (34 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
Summary
Changes to logging as a preparation to further changes in direction of concurrent tests.
--log-level-tests) which sets log level only while executing a test. That means that now we can execute the test suite with verbose regular level and minimal output for the tests (e.g., with--log-level DEBUG --log-level-tests INFO). This way we can have debug logs for the main script (e.g., initialization of Linux namespaces), while not polluting the logs with huge logs from executed tests. This is especially useful for future concurrent test execution.LogPipethread names for better readability.Related issues
Part of the next batch of patches with the final goal of introducing concurrent test execution:
Testing
Local tests with
run_test_suite.py.Readability checklist
The checklist below will help the reviewer finish PR review in time and keep the
code readable:
descriptive
“When in Rome…”
rule (coding style)
See: Pull Request Guidelines