> On Aug. 1, 2017, 6:51 a.m., Avinash sridharan wrote:
> > src/tests/slave_tests.cpp
> > Lines 7934 (patched)
> > <https://reviews.apache.org/r/61245/diff/1/?file=1785603#file1785603line7934>
> >
> > This code seems to be duplicated. I think you can use a parameterized
> > test over here similar to this:
> >
> > https://github.com/apache/mesos/blob/master/src/tests/default_executor_tests.cpp#L104
>
> Qian Zhang wrote:
> Can you elaborate a bit about this? Did you mean the strings I assigned
> to `argv[3]` for CNI and CNM are duplicated? They are very similar but still
> have difference, e.g., for CNI, the field name is `mesos`, but for CNM, the
> field name is `docker`, and also the network modes are different (`CNI` v.s.
> `USER`). So we need different strings anyway, I am not sure how we can
> parameterize them.
>
> Qian Zhang wrote:
> Or the duplicated you were talking about is:
> ```
> slave::Flags flags;
> Try<flags::Warnings> load = flags.load(None(), argc, argv);
> EXPECT_ERROR(load);
> ```
> And then move all those strings into `INSTANTIATE_TEST_CASE_P()`?
Qian, I was talking about this JSON:
```
--default_container_dns={"
" \"mesos\": [\n"
" {\n"
" \"network_mode\": \"UNKNOWN\",\n"
" \"dns\": {\n"
" \"nameservers\": [ \"8.8.8.8\" ]\n"
" }\n"
" }\n"
" ]\n"
"}";
```
Since this is just a string and the only thing that seems change is the key
(mesos|docker) thought making parameterized will simplify the code.
- Avinash
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/61245/#review181880
-----------------------------------------------------------
On Aug. 1, 2017, 10:07 a.m., Qian Zhang wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61245/
> -----------------------------------------------------------
>
> (Updated Aug. 1, 2017, 10:07 a.m.)
>
>
> Review request for mesos, Avinash sridharan and Jie Yu.
>
>
> Bugs: MESOS-7709
> https://issues.apache.org/jira/browse/MESOS-7709
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Added a test `SlaveTest.ValidateDefaultContainerDNSFlag`.
>
>
> Diffs
> -----
>
> src/tests/slave_tests.cpp a089cc47eae41cd6baeffd3f4a7ee7c7984aacbd
>
>
> Diff: https://reviews.apache.org/r/61245/diff/2/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Qian Zhang
>
>