Skip to content
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

Make attribute-write yaml tests play nicer with complex types. #11457

Commits on Nov 5, 2021

  1. Make attribute-write yaml tests play nicer with complex types.

    The key change is using zapTypeToEncodableClusterObjectType to declare
    the type and the "commandValue" partial to set it to the given value,
    which is more similar to how we handle command arguments.  That makes
    things work for lists and nullables at the very least.
    
    The ignore="true" bit is probably not very well named, but it means
    "just use the 'container' value as-is, instead of treating it as a
    struct with member that stores the value".
    
    The fix in ClusterTestGeneration.js is just fixing a typo in the
    "type" values there that started to matter because we pass "type" to
    zapTypeToEncodableClusterObjectType.
    
    The fix in ClustersHelper.js is to give our synthetic "argument" to
    writeAttribute the same nullability as the actual attribute, so the
    types we get are right, and to set isArray for lists, because our
    templates key off of that (especially the "commandValue" partial).
    The "commandValue" partial also uses the "label" when dealing with
    lists, so we define that for attributes to just be the attribute name.
    
    The generated code changes are all no-ops so far, because we are not
    actually using any types that would be affected by this yet.
    bzbarsky-apple committed Nov 5, 2021
    Configuration menu
    Copy the full SHA
    756ef8e View commit details
    Browse the repository at this point in the history