> On 四月 19, 2016, 3:03 p.m., haosdent huang wrote:
> > 3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp, line 975
> > <https://reviews.apache.org/r/45326/diff/6/?file=1350574#file1350574line975>
> >
> > Do we need test the priority here? When a binary exists in different folders
at the same time.
>
> Guangya Liu wrote:
> I think that as long as the binary can be found should be good enough, why need care
the priority here?
>
> haosdent huang wrote:
> Let me describe it in another way. Suppose `PATH` is `/usr/bin:/bin`, and `bar` exists
in both `/usr/bin/bar` and `/bin/bar`. Are we we always guarantee that take the first one
in `os::which()`? Or add comment about the priority?
Yes, I was following linux system, always using the first. Does adding some comments here
make sense?
root@mesos002:~/src/mesos/m2/mesos# which ls
/usr/local/bin/ls
root@mesos002:~/src/mesos/m2/mesos# env | grep PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/go/bin:/root/go-tools/bin
GOPATH=/root/go-tools
root@mesos002:~/src/mesos/m2/mesos# ls /usr/local/bin/ls
/usr/local/bin/ls
root@mesos002:~/src/mesos/m2/mesos# ls /bin/ls
/bin/ls
> On 四月 19, 2016, 3:03 p.m., haosdent huang wrote:
> > 3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp, line 976
> > <https://reviews.apache.org/r/45326/diff/6/?file=1350574#file1350574line976>
> >
> > Should `EXPECT_SOME` here?
>
> Guangya Liu wrote:
> Can you please show more detail for why use `EXPECT_SOME` here?
>
> haosdent huang wrote:
> `ASSERT` would abort the test while `EXPECT` would continue to run following code.
I think we usually use `ASSERT` when something block the test. e.g. `ASSERT_SOME(master);`.
And usually use `EXPECT` at those thing we want to test in the test cases. e.g. `EXPECT_CALL(...`.
Yes, but I was following this in test case, https://github.com/apache/mesos/blob/master/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp#L964
- Guangya
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45326/#review129540
-----------------------------------------------------------
On 四月 19, 2016, 2:56 p.m., Guangya Liu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45326/
> -----------------------------------------------------------
>
> (Updated 四月 19, 2016, 2:56 p.m.)
>
>
> Review request for mesos, David vonThenen, Gilbert Song, haosdent huang, and Jie Yu.
>
>
> Bugs: MESOS-4576
> https://issues.apache.org/jira/browse/MESOS-4576
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Implemented os::which().
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp dfe4eab2d812ef807c7416ac205573d55383c4ee
> 3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9bd34c7508cd813c5de18028956f6a740997c266
>
> Diff: https://reviews.apache.org/r/45326/diff/
>
>
> Testing
> -------
>
> make
> make check
>
> [ RUN ] OsTest.Which
> [ OK ] OsTest.Which (0 ms)
>
>
> Thanks,
>
> Guangya Liu
>
>
|