-
-
Notifications
You must be signed in to change notification settings - Fork 341
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
test: add command tests #487
Conversation
@@ -130,6 +134,10 @@ func (t *Tree) ToProto() *acl.SubjectTree { | |||
|
|||
// swagger:ignore | |||
func TreeFromProto(t *acl.SubjectTree) (*Tree, error) { | |||
if t == nil { | |||
return nil, nil |
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.
Is passing a nil value here not an error?
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.
That depends on whether the expand engine should never return nil. Currently there are two cases:
But that can be fixed, although I don't think they are an error.
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.
Ok, as long as the code is able to deal with nil trees downstream I think this is fine. Is that tested?
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.
Not too much (that's why I found it right now), I will add some more tests.
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.
lgtm from my side
Locally, this resulted in flaky tests as up and down migrations where applied racy.
Related issue
multiple comments from the review
Proposed changes