mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrei Sekretenko <asekrete...@mesosphere.io>
Subject Re: Review Request 70671: Added a class for setting expectations on master V1 API events in tests.
Date Tue, 28 May 2019 17:48:16 GMT


> On May 24, 2019, 2:54 p.m., Benjamin Mahler wrote:
> > src/tests/mock_master_api_subscriber.hpp
> > Lines 60-63 (patched)
> > <https://reviews.apache.org/r/70671/diff/2/?file=2146059#file2146059line60>
> >
> >     Per my comment above, since we want to use this class to improve the existing
testing as well, let's just include all the possible events to start with and no `other` case.
> >     
> >     I suppose I haven't seen this before, the `_T` here lets you define these mock
methods without them overriding anything? In this sense, this class isn't really a "mock"
that mocks an existing interface or implementation, but I suppose calling it a "Mock" is ok.
(the alternative would be "TestMasterAPISubscriber", but then rather than a mocks/ folder
we probably would want to group master/ tests together).

Added all the existing events and removed the defaults in switches, as you suggesteded.

Actually, the `_T` is not needed (and this is not the intended use of `_T`, so I replaced
them with non-`_T` macros. It turns out that the part of `MOCK_METHOD*` macro which adds the
method declaration, uses neither `virtual` nor `override`.

Calling this a "Mock" is objectionable since it mocks nothing, but I cannot come up with a
better name for something that has gmock's mock methods and is intended for use with gmock's
API.


- Andrei


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70671/#review215497
-----------------------------------------------------------


On May 28, 2019, 5:35 p.m., Andrei Sekretenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70671/
> -----------------------------------------------------------
> 
> (Updated May 28, 2019, 5:35 p.m.)
> 
> 
> Review request for mesos and Benjamin Mahler.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch introduces a class with mock methods for subscribing to the
> events of master's V1 streaming API and setting expectations for them.
> 
> 
> Diffs
> -----
> 
>   src/Makefile.am 5f97523fbe2d80733fbdcc7706f2761f5a071f9f 
>   src/tests/CMakeLists.txt e6b1d8a097246f0921467d7f778034d6754fcff6 
>   src/tests/master/mock_master_api_subscriber.hpp PRE-CREATION 
>   src/tests/master/mock_master_api_subscriber.cpp PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70671/diff/3/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andrei Sekretenko
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message