Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[RSDK-7335] Remove Close() from and Add Write() to Analog interface in board #3809
[RSDK-7335] Remove Close() from and Add Write() to Analog interface in board #3809
Changes from 4 commits
def34d2
9562017
045ee92
2a05ca7
6d62f89
90a80c9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
The current flow for the pi/generic linux:
This can probably be better. Probably by obliterating it.
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.
I think the numato code can either not use the analog smoother or implement a
Close
more gracefully. We'll handle this driver in our next bug bash.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.
Looking at the documentation you left for
WriteCap
, I suspect we should also store the value here....though TBH I don't understand when you'd ever need to call
WriteCap()
orReadCap()
and don't really get why this code exists at all. The one use ofReadCap
in our codebase is used to assert that the context passed into a function really is the context passed in, which seems like kind of a useless test.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.
I'm not going to change the pattern of inject implementations as part of this pr. They could probably be better, but they do their job of injecting interfaces for testing, and I'm happy with that.
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.
I did not mean to change the pattern; I don't think you're following the pre-existing pattern here. For example, in testutils/inject/gpio_pin.go, the captures store all of the arguments except
extra
, which would include storingvalue
here.I wonder if there's some other reason not to store
value
and to set things up the way you did, but I don't see that reason myself, partly because I don't understand why the pattern has been set up this way in the first place.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.
Ah I see, no you're right, we should store value here. tbh I do think our injects could be better. The
Cap
functions are usually to capture the input arguments to the injected function to be checked against in server-client code tests. But to be frank our team almost never has a need to use the Cap functions in testing the drivers, because we care about testing the behaviour of inputs not validating that we've sent the inputs. TheCap
functions are usually used in server tests for resource APIs.... the inject package could be better and lessconfusing overall, maybe one day.