-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the hasValue constraint test by adding a dedicated file #25344
Update the hasValue constraint test by adding a dedicated file #25344
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this match existing YAML semantics in terms of how constraints other than "hasValue" are applied (or not) to missing optional values?
For the moment this is stricter in the sense that a missing value with a a constraint other than
Removing those should bring us back to the same behaviour. I would like to run the CI against this PR to check if we do have some constraints on missing fields that were unexpected, but we can definitively remove it afterward. |
4a0e3e9
to
1e254f7
Compare
1e254f7
to
344d8da
Compare
@@ -124,6 +140,11 @@ def __init__(self, context, types: list, is_null_allowed: bool = False): | |||
self._context = context | |||
|
|||
def validate(self, value, value_type_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, add type hinting value as ConstraintValue
@@ -181,6 +181,8 @@ def main(context, dry_run, log_level, target, target_glob, target_skip_glob, | |||
# Figures out selected test that match the given name(s) | |||
if runtime == TestRunTime.CHIP_REPL_PYTHON: | |||
all_tests = [test for test in chiptest.AllYamlTests()] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we expect to converge on using the same subset of test? What is preventing us from using the same subset right now? The only thing that is not enabled for chip-repl is Test_TC_OO_2_4.yaml
which is due to a real issue with the test which is only masked with the chip-tool due to some delays happening during runtime.
Andrei's argument is right now we have an allow list with src/app/tests/suites/ciTests.json
when really we should have a blocklist somewhat to what we are doing already in this file going forward
@@ -125,6 +125,13 @@ def _GetSlowTests() -> Set[str]: | |||
} | |||
|
|||
|
|||
def _GetPythonYamlOnlyTests() -> Set[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is currently making this a test that only works in python and not codegen?
@@ -1823,8 +1823,8 @@ DESC.C.A0002=1 | |||
DESC.C.A0003=1 | |||
|
|||
# Secure Channel | |||
MCORE.SC.SII_COMM_DISCOVERY_KEY=1 | |||
MCORE.SC.SAI_COMM_DISCOVERY_KEY=1 | |||
MCORE.SC.SII_COMM_DISCOVERY_KEY=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these PICS values changing?
Running CI is not enough. We can have YAMLs that have such constraints on fields that all-clusters-app (which is what we use in CI) sends but that other devices might not send. If we change semantics here we need to look at all the relevant places in the YAML and make sure that it's correctly expressing the intent of the test plan. The real check is: are there optionals that have constraints other than hasValue listed at all? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This is an old PR that does not seem to be updated, is in draft and has several merge conflicts. Closing as stale. |
Problem
matter_yamltests
is mixingnull
values andmissing
values. This PR add the necessary bits to differentiate both and also adds a new attribute of type struct tounittesting
in order to properly validate that optional in struct are handled properly.This is a draft until #25343 lands since
chip-tool
does not clean up optional fields properly at the moment.