-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make attribute-write yaml tests play nicer with complex types. (#11457)
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.
- Loading branch information
1 parent
86d5410
commit 2319331
Showing
5 changed files
with
300 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.