Repository navigation
[core] Remove dead plasma client code and create mock - #53205
Conversation
Signed-off-by: dayshah <[email protected]>
4215c31 to
a23bb5a
Compare
|
|
||
| class MockPlasmaClient : public PlasmaClientInterface { | ||
| public: | ||
| MOCK_METHOD(Status, |
There was a problem hiding this comment.
In general I'd recommend we avoid mocking and prefer to write fake implementations instead. These implementations can/should be reused across multiple test cases and should mirror the behaviors of the real implementation where possible.
(In an ideal world, IMO, we wouldn't even need the gmock dependency)
There was a problem hiding this comment.
So concretely in this PR I'd prefer we write a basic fake that does not use gmock and instead implements the minimal functionality required for the dependent unit tests
Over time, we can build out the functionality here and reuse it across multiple tests
There was a problem hiding this comment.
By basic fake, something that just returns the ok status? The mocks do that by default. Or something that will actually call the reply callbacks and do something?
I was thinking kind of the opposite where unit tests can override if they want some functionality out of it, but most times they'll just want the default return value and can invoke something specific with the mock in the test if the test requires something out of it. This is generally how all the unit testing happens now.
There was a problem hiding this comment.
Yes something that just returns the ok status. In an ideal world we'd have a fake that can be reused across multiple test cases.
This is an OK place to start, let's see how it goes.
Signed-off-by: Dhyey Shah <[email protected]>
Signed-off-by: dayshah <[email protected]>
|
|
||
| class MockPlasmaClient : public PlasmaClientInterface { | ||
| public: | ||
| MOCK_METHOD(Status, |
There was a problem hiding this comment.
Yes something that just returns the ok status. In an ideal world we'd have a fake that can be reused across multiple test cases.
This is an OK place to start, let's see how it goes.
Why are these changes needed?
There's some dead plasma eviction code that's not used anywhere. Removing the dead code and creating a mock for the PlasmaClient here.
This is split up from #53120 to make reviewing that less intimidating.
Related issue number
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/under thecorresponding
.rstfile.