> On Sept. 18, 2017, 7:06 p.m., Jie Yu wrote: > > src/tests/resources_tests.cpp > > Lines 2251 (patched) > > <https://reviews.apache.org/r/58048/diff/6/?file=1820868#file1820868line2251> > > > > s/ResourcesTest/DiskResourcesTest/ > > > > In fact, this test a bit dense and has a bunch of if/elses, making it > > hard to read. > > > > Either split this into 3 tests (or 6 tests): > > ``` > > DiskResourcesTest.RawSource > > DiskResourcesTest.MountBlockSource > > DiskResourcesTest.PathSource > > > > DiskResourcesTest.RawSourceWithID > > DiskResourcesTest.MountBlockSourceWithID > > DiskResourcesTest.PathSourceWithID > > ``` > > > > Or parameterize this test: > > ``` > > DiskResourcesSourceTest > > ``` > > > > Given that expectation is different for each source type, i am leaning > > towards option 1 (3 tests or 6 tests). And you don't need to print the > > param anymore.
I went for a parameterized test as this allows to reuse most of the setup logic. The code still branches at two points, but I believe it should be better now that we do not manually loop over parameter permutations in the test case. I also got rid of the parameter printing as it is clear from the running instantiation number. - Benjamin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/58048/#review185569 ----------------------------------------------------------- On Sept. 19, 2017, 6:53 p.m., Benjamin Bannier wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/58048/ > ----------------------------------------------------------- > > (Updated Sept. 19, 2017, 6:53 p.m.) > > > Review request for mesos, Jie Yu and Jan Schlicht. > > > Bugs: MESOS-7312 > https://issues.apache.org/jira/browse/MESOS-7312 > > > Repository: mesos > > > Description > ------- > > Ids will allow to create distinguishable resources, e.g., of RAW or > BLOCK type. We also add a metadata field which can be used to expose > additional disk information. > > > Diffs > ----- > > include/mesos/mesos.proto fa475dcc3aa0b15ee4b2b740a24ab3c0b9a3274c > include/mesos/v1/mesos.proto dfba4181203e23f7eedf67c19379d031e0993fd5 > src/common/resources.cpp 14b600ca1577be4910164396c75b866b53439ade > src/tests/resources_tests.cpp 8a86efe60024d9e36294f0acb3f43bdd3f52f5bc > src/v1/resources.cpp a5cc15591b7611274148139c43465adae44c1dbb > > > Diff: https://reviews.apache.org/r/58048/diff/7/ > > > Testing > ------- > > make check (OS X, Fedora25) > > > Thanks, > > Benjamin Bannier > >