Skip to content

Allow mandatory tests to be sideloaded - #346

Merged
antonio-amjr merged 2 commits into
project-chip:v2.15.1-developfrom
greens:fixup/sideload_mandatory
Aug 6, 2026
Merged

Allow mandatory tests to be sideloaded#346
antonio-amjr merged 2 commits into
project-chip:v2.15.1-developfrom
greens:fixup/sideload_mandatory

Conversation

@greens

@greens greens commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Fixes project-chip/certification-tool#1073

There was/is a small quirk in the logic that would prevent mandatory tests from this list: https://github.com/project-chip/certification-tool-backend/blob/main/test_collections/matter/sdk_tests/support/python_testing/models/python_test_parser.py#L36 from being added when custom tests were collated.

This is the lightest-touch fix. I think possibly there could be a total re-evaluation of the mandatory field that shows up in so many places, but for now this will fix the issue.

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

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.

Code Review

This pull request refactors the SDK Python test parsing logic by replacing the boolean mandatory flag with a new CollectionType enum, allowing for more granular control over test suite selection. Feedback on the changes points out that the CollectionType enum values are defined inconsistently, using single-element tuples for some members and a plain integer for another, and suggests standardizing them as simple integers.

@antonio-amjr

Copy link
Copy Markdown
Contributor

LGTM @greens,

Just need to point out one correction: please change the base of the PR to the target TH version.
If it's for Matter 1.6.1 Final (v2.15.1+summer2026) use the v2.15.1-develop for this Backend repo.

We usually just pull done releases to the main AFAIK.

@greens
greens changed the base branch from main to v2.15.1-develop August 5, 2026 15:22
@mergify

mergify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@antonio-amjr
antonio-amjr merged commit 030e171 into project-chip:v2.15.1-develop Aug 6, 2026
7 of 9 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in CSG issue tracking Aug 6, 2026
rquidute added a commit that referenced this pull request Aug 26, 2026
PR #346 ("Allow mandatory tests to be sideloaded") replaced the
mandatory: bool flag in __parse_python_tests() with a 3-valued
CollectionType enum, but the LEGACY-suite fallback branch lost its
python_test_type != MANDATORY guard in the process:

    elif collection_type != CollectionType.MANDATORY:
        suites[SuiteType.LEGACY].add_test_case(test_case)

This only checks the target collection, not the test's own type, so
when building the NON_MANDATORY ("SDK Python Tests") collection, any
test case whose type is MANDATORY falls through the
COMMISSIONING/NO_COMMISSIONING branches and lands in the LEGACY
("Old script format") suite anyway. The same test case is also
correctly added to SuiteType.MANDATORY when the MANDATORY collection
is built, so it ends up listed - and executed - in both collections.

Restore the type guard so mandatory tests are excluded from the
LEGACY suite when populating the NON_MANDATORY collection, while
still landing in SuiteType.MANDATORY for CollectionType.ALL (sideload)
per PR #346's intent.

Adds a dedicated fixture file (mandatory_tests_info.json) with a
mandatory-shaped test case, so the new regression test doesn't perturb
the existing python_tests_info.json fixture shared with
test_python_parser.py's hardcoded test-count assertion.

Fixes project-chip/certification-tool#1087
rquidute added a commit that referenced this pull request Aug 26, 2026
)

PR #346 ("Allow mandatory tests to be sideloaded") replaced the
mandatory: bool flag in __parse_python_tests() with a 3-valued
CollectionType enum, but the LEGACY-suite fallback branch lost its
python_test_type != MANDATORY guard in the process:

    elif collection_type != CollectionType.MANDATORY:
        suites[SuiteType.LEGACY].add_test_case(test_case)

This only checks the target collection, not the test's own type, so
when building the NON_MANDATORY ("SDK Python Tests") collection, any
test case whose type is MANDATORY falls through the
COMMISSIONING/NO_COMMISSIONING branches and lands in the LEGACY
("Old script format") suite anyway. The same test case is also
correctly added to SuiteType.MANDATORY when the MANDATORY collection
is built, so it ends up listed - and executed - in both collections.

Restore the type guard so mandatory tests are excluded from the
LEGACY suite when populating the NON_MANDATORY collection, while
still landing in SuiteType.MANDATORY for CollectionType.ALL (sideload)
per PR #346's intent.

Adds a dedicated fixture file (mandatory_tests_info.json) with a
mandatory-shaped test case, so the new regression test doesn't perturb
the existing python_tests_info.json fixture shared with
test_python_parser.py's hardcoded test-count assertion.

Fixes project-chip/certification-tool#1087
rquidute added a commit that referenced this pull request Aug 28, 2026
…fix (#360)

* Allow mandatory tests to be sideloaded (#346)

Cherry-picked from v2.15.1-develop.

There was/is a small quirk in the logic that would prevent mandatory
tests from the list in python_test_parser.py from being added when
custom tests were collated.

* Fix mandatory Python tests duplicated into Old Script Format suite (#358)

Cherry-picked from v2.15.1-develop.

PR #346 ("Allow mandatory tests to be sideloaded", cherry-picked in the
prior commit) replaced the mandatory: bool flag in
__parse_python_tests() with a 3-valued CollectionType enum, but the
LEGACY-suite fallback branch lost its python_test_type != MANDATORY
guard in the process:

    elif collection_type != CollectionType.MANDATORY:
        suites[SuiteType.LEGACY].add_test_case(test_case)

This only checks the target collection, not the test's own type, so
when building the NON_MANDATORY ("SDK Python Tests") collection, any
test case whose type is MANDATORY falls through the
COMMISSIONING/NO_COMMISSIONING branches and lands in the LEGACY
("Old script format") suite anyway. The same test case is also
correctly added to SuiteType.MANDATORY when the MANDATORY collection
is built, so it ends up listed - and executed - in both collections.

Restore the type guard so mandatory tests are excluded from the
LEGACY suite when populating the NON_MANDATORY collection, while
still landing in SuiteType.MANDATORY for CollectionType.ALL (sideload)
per PR #346's intent.

Fixes project-chip/certification-tool#1087
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[MVE] 1.6.1: TC-IDM-10.2 refusal to run

3 participants