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

Initial tests for uncompressed structs with ordered maps. #870

Merged
merged 28 commits into from
Jun 12, 2023

Conversation

wenovus
Copy link
Collaborator

@wenovus wenovus commented Jun 9, 2023

No description provided.

wenovus added 17 commits June 6, 2023 19:15
When comparing two GoStructs where a YANG `ordered-by user` list is
involved, it is not possible using a single Notification to represent
the diff such that the Notification can do the following:
1. update a gNMI cache correctly with the atomic notification.
2. unmarshal the notification to the `orig` to get back the `modified`
   GoStruct.

This function achieves this functionality, sharing the underlying
implementation with Diff, where a disclaimer has been added to the doc
comment.

Other helpers have been created as well to be shared with
`TogNMINotifications`.

Other changes:
- `TogNMINotifications` has been changed to follow the same convention of
  putting the non-atomic Notification as the first message instead of
  the last. The reason is that current code MAY be using `notifs[0]` and
  I don't want to break that, and this also seems slightly better from a
  usability perspective.
@wenovus wenovus requested a review from DanG100 June 9, 2023 01:38
@coveralls
Copy link

coveralls commented Jun 9, 2023

Coverage Status

coverage: 89.65%. remained the same when pulling 4692f74 on uncompressed-orderedmap into cfe027b on export-others-orderedmap.

)

* Move TestTogNMINotifications's ordered map tests to exported tests

* lint
"github.com/openconfig/ygot/ygot"
)

func GetOrderedMap(t *testing.T) *Ctestschema_OrderedLists_OrderedList_OrderedMap {
Copy link
Contributor

@DanG100 DanG100 Jun 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

godoc for funcs in this file
nit: GetSampleOrderedMap or something to indicate that this returns an ordered with populated values

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I'll also move these to an internal package in a subsequent PR.

Base automatically changed from export-others-orderedmap to master June 12, 2023 22:36
@wenovus wenovus merged commit e8dd757 into master Jun 12, 2023
@wenovus wenovus deleted the uncompressed-orderedmap branch June 12, 2023 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants