Re: Review Request 41790: Add tests for /weights endpoint.

2016-03-14 Thread Yongqiao Wang

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

(Updated March 14, 2016, 10:04 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am f2a592dba3e963c99c48c4b9045b4a04d173cb22 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing
---

Make and Make check successfully!

$ ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 11 tests from 1 test case.
[--] Global test environment set-up.
[--] 11 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (87 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (44 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
[ RUN  ] DynamicWeightsTest.NonNumericWeight
[   OK ] DynamicWeightsTest.NonNumericWeight (37 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (42 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (38 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (45 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(38 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
[--] 11 tests from DynamicWeightsTest (482 ms total)

[--] Global test environment tear-down
[==] 11 tests from 1 test case ran. (490 ms total)
[  PASSED  ] 11 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-03-14 Thread Adam B

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




src/tests/dynamic_weights_tests.cpp (line 171)


Fix the indent here


- Adam B


On March 9, 2016, 1:47 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated March 9, 2016, 1:47 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am b24f0f58fa188c16770fe6a3c23ec06262cb0955 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> $ ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (87 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (44 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
> [ RUN  ] DynamicWeightsTest.NonNumericWeight
> [   OK ] DynamicWeightsTest.NonNumericWeight (37 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (42 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (38 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (45 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (38 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
> [--] 11 tests from DynamicWeightsTest (482 ms total)
> 
> [--] Global test environment tear-down
> [==] 11 tests from 1 test case ran. (490 ms total)
> [  PASSED  ] 11 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-03-14 Thread Adam B

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


Fix it, then Ship it!




Thanks for updating this back to a GET on /roles. Fix these minor points and 
I'll get this committed asap.


src/tests/dynamic_weights_tests.cpp (line 117)


I recently committed Joerg's change to add authentication to more master 
endpoints, including /roles. You probably need to update this to:
```
  response = process::http::get(
  master.get(),
  "roles",
  None(),
  createBasicAuthHeaders(DEFAULT_CREDENTIAL));
```



src/tests/dynamic_weights_tests.cpp (line 114)


We prefer to use Option in our method parameters, rather than null pointers 
or empty strings.
So, this should be `const Option& weights = None()`, and the 
`weights == ""` check below should be a `weights.isNone()` check.



src/tests/dynamic_weights_tests.cpp (line 323)


Nit: s/they're/they are/



src/tests/dynamic_weights_tests.cpp (line 367)


"Specify --roles whitelist when starting master."



src/tests/dynamic_weights_tests.cpp (line 397)


"Specify --roles whitelist when starting master."



src/tests/dynamic_weights_tests.cpp (line 401)


Can you `checkWithRolesEndpoint(master);` here, so we know that role1 and 
role2 start with default weights before the update request?
Or will the explicit roles flag cause the /roles endpoint to list them 
differently from your default? More like a weights flag of "role1=1.0,role2=1.0"



src/tests/dynamic_weights_tests.cpp (lines 443 - 444)


Please wrap at the `<<` instead of the `(`:
```
AWAIT_EXPECT_RESPONSE_STATUS_EQ(Unauthorized({}).status, response1)
  << response1.get().body;
```



src/tests/dynamic_weights_tests.cpp (lines 457 - 458)


Wrap at `<<` instead



src/tests/dynamic_weights_tests.cpp (lines 563 - 564)


Wrap at `<<` instead


- Adam B


On March 9, 2016, 1:47 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated March 9, 2016, 1:47 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am b24f0f58fa188c16770fe6a3c23ec06262cb0955 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> $ ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (87 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (44 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
> [ RUN  ] DynamicWeightsTest.NonNumericWeight
> [   OK ] DynamicWeightsTest.NonNumericWeight (37 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (42 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (38 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (45 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (38 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
> [--] 11 tests from DynamicWeightsTest (482 ms total)
> 
> [--] Global test 

Re: Review Request 41790: Add tests for /weights endpoint.

2016-03-09 Thread Yongqiao Wang

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

(Updated March 9, 2016, 9:47 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am b24f0f58fa188c16770fe6a3c23ec06262cb0955 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing
---

Make and Make check successfully!

$ ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 11 tests from 1 test case.
[--] Global test environment set-up.
[--] 11 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (87 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (44 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
[ RUN  ] DynamicWeightsTest.NonNumericWeight
[   OK ] DynamicWeightsTest.NonNumericWeight (37 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (42 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (38 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (45 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(38 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
[--] 11 tests from DynamicWeightsTest (482 ms total)

[--] Global test environment tear-down
[==] 11 tests from 1 test case ran. (490 ms total)
[  PASSED  ] 11 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-03-09 Thread Yongqiao Wang


> On March 9, 2016, 8:26 a.m., Adam B wrote:
> > src/tests/dynamic_weights_tests.cpp, line 89
> > 
> >
> > We don't (yet) use `CHECK_GE/LE/GT/LT` anywhere, I think because we 
> > want tests themselves to try to be exact. This might be more appropriate as 
> > `ASSERT_GE(tokens.size(), 1u)`.
> > Is it really even all that bad if `weightsFlag` was an empty string 
> > with no tokens? You'd just return an empty `infos`.

OK, it just only needs to remove `CHECK_GE(tokens.size(), 1u);`, if 
`weightsFlag` was an empty string, then return an empty infos.


- Yongqiao


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


On March 9, 2016, 5:52 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated March 9, 2016, 5:52 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am a41e95ddeb838fdebf4ced953c4a29181916e261 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> $ ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (87 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (44 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
> [ RUN  ] DynamicWeightsTest.NonNumericWeight
> [   OK ] DynamicWeightsTest.NonNumericWeight (37 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (42 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (38 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (45 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (38 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
> [--] 11 tests from DynamicWeightsTest (482 ms total)
> 
> [--] Global test environment tear-down
> [==] 11 tests from 1 test case ran. (490 ms total)
> [  PASSED  ] 11 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-03-09 Thread Adam B

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



Looks like you bumped this down in the review chain to come last, after r/44512 
(Support to get weights info by /weights). If you revert to the previous 
revision, depending on /roles instead of GET /weights, then I can commit these 
tests much sooner, and you can add a patch later to update the tests to use GET 
/weights.

- Adam B


On March 8, 2016, 9:52 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated March 8, 2016, 9:52 p.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am a41e95ddeb838fdebf4ced953c4a29181916e261 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> $ ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (87 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (44 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
> [ RUN  ] DynamicWeightsTest.NonNumericWeight
> [   OK ] DynamicWeightsTest.NonNumericWeight (37 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (42 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (38 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (45 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (38 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
> [--] 11 tests from DynamicWeightsTest (482 ms total)
> 
> [--] Global test environment tear-down
> [==] 11 tests from 1 test case ran. (490 ms total)
> [  PASSED  ] 11 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-03-09 Thread Adam B

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




src/tests/dynamic_weights_tests.cpp (line 345)


s/Only/only/



src/tests/dynamic_weights_tests.cpp (line 544)


s/Setup ACLs so that/Set ACLs to be non-permissive by default so that/



src/tests/dynamic_weights_tests.cpp (lines 72 - 73)


"The dynamic weights tests in this file are split into logical groups:"



src/tests/dynamic_weights_tests.cpp (line 84)


s/with/from/



src/tests/dynamic_weights_tests.cpp (line 89)


We don't (yet) use `CHECK_GE/LE/GT/LT` anywhere, I think because we want 
tests themselves to try to be exact. This might be more appropriate as 
`ASSERT_GE(tokens.size(), 1u)`.
Is it really even all that bad if `weightsFlag` was an empty string with no 
tokens? You'd just return an empty `infos`.


- Adam B


On March 8, 2016, 9:52 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated March 8, 2016, 9:52 p.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am a41e95ddeb838fdebf4ced953c4a29181916e261 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> $ ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (87 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (44 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
> [ RUN  ] DynamicWeightsTest.NonNumericWeight
> [   OK ] DynamicWeightsTest.NonNumericWeight (37 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (42 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (38 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (45 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (38 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
> [--] 11 tests from DynamicWeightsTest (482 ms total)
> 
> [--] Global test environment tear-down
> [==] 11 tests from 1 test case ran. (490 ms total)
> [  PASSED  ] 11 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-03-08 Thread Yongqiao Wang

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

(Updated March 9, 2016, 5:52 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Check the updated results wiht /weights endpoint.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am a41e95ddeb838fdebf4ced953c4a29181916e261 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing (updated)
---

Make and Make check successfully!

$ ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 11 tests from 1 test case.
[--] Global test environment set-up.
[--] 11 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (87 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (44 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
[ RUN  ] DynamicWeightsTest.NonNumericWeight
[   OK ] DynamicWeightsTest.NonNumericWeight (37 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (42 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (38 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (45 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(38 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
[--] 11 tests from DynamicWeightsTest (482 ms total)

[--] Global test environment tear-down
[==] 11 tests from 1 test case ran. (490 ms total)
[  PASSED  ] 11 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-02-28 Thread Yongqiao Wang


> On Feb. 27, 2016, 12:21 p.m., Adam B wrote:
> > Sorry this took me forever to get to. Looks pretty good except for some 
> > indentation and some unnecessary lines.
> > I'd also like to see a couple of registrar tests, like AlexR suggested.
> 
> Yongqiao Wang wrote:
> Thanks Adam. I will add a couple of registrar tests later in another 
> patches, is it OK?
> 
> Adam B wrote:
> Sure, it can go in a later patch, but let's make sure not to forget it.

I have logged a separated JIRA ticket #MESOS-4797 to trace this task.


- Yongqiao


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


On Feb. 27, 2016, 1:55 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Feb. 27, 2016, 1:55 p.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 2a26261b513bb7c03437ed8e850c3b36b93d82f5 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (85 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (46 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (49 ms)
> [ RUN  ] DynamicWeightsTest.NonNumericWeight
> [   OK ] DynamicWeightsTest.NonNumericWeight (49 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (50 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (49 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (45 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (45 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (37 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (36 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
> [--] 11 tests from DynamicWeightsTest (527 ms total)
> 
> [--] Global test environment tear-down
> [==] 11 tests from 1 test case ran. (536 ms total)
> [  PASSED  ] 11 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-02-28 Thread Adam B


> On Feb. 27, 2016, 4:21 a.m., Adam B wrote:
> > Sorry this took me forever to get to. Looks pretty good except for some 
> > indentation and some unnecessary lines.
> > I'd also like to see a couple of registrar tests, like AlexR suggested.
> 
> Yongqiao Wang wrote:
> Thanks Adam. I will add a couple of registrar tests later in another 
> patches, is it OK?

Sure, it can go in a later patch, but let's make sure not to forget it.


- Adam


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


On Feb. 27, 2016, 5:55 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Feb. 27, 2016, 5:55 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 2a26261b513bb7c03437ed8e850c3b36b93d82f5 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (85 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (46 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (49 ms)
> [ RUN  ] DynamicWeightsTest.NonNumericWeight
> [   OK ] DynamicWeightsTest.NonNumericWeight (49 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (50 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (49 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (45 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (45 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (37 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (36 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
> [--] 11 tests from DynamicWeightsTest (527 ms total)
> 
> [--] Global test environment tear-down
> [==] 11 tests from 1 test case ran. (536 ms total)
> [  PASSED  ] 11 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-02-27 Thread Mesos ReviewBot

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



Patch looks great!

Reviews applied: [41597, 41681, 43863, 41790]

Passed command: export OS='ubuntu:14.04' CONFIGURATION='--verbose' 
COMPILER='gcc' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker_build.sh

- Mesos ReviewBot


On Feb. 27, 2016, 1:55 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Feb. 27, 2016, 1:55 p.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 2a26261b513bb7c03437ed8e850c3b36b93d82f5 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (85 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (46 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (49 ms)
> [ RUN  ] DynamicWeightsTest.NonNumericWeight
> [   OK ] DynamicWeightsTest.NonNumericWeight (49 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (50 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (49 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (45 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (45 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (37 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (36 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
> [--] 11 tests from DynamicWeightsTest (527 ms total)
> 
> [--] Global test environment tear-down
> [==] 11 tests from 1 test case ran. (536 ms total)
> [  PASSED  ] 11 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-02-27 Thread Yongqiao Wang

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

(Updated Feb. 27, 2016, 1:55 p.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Addressed comments of Adam.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am 2a26261b513bb7c03437ed8e850c3b36b93d82f5 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing (updated)
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 11 tests from 1 test case.
[--] Global test environment set-up.
[--] 11 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (85 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (46 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (49 ms)
[ RUN  ] DynamicWeightsTest.NonNumericWeight
[   OK ] DynamicWeightsTest.NonNumericWeight (49 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (50 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (49 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (45 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (45 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (37 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(36 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (35 ms)
[--] 11 tests from DynamicWeightsTest (527 ms total)

[--] Global test environment tear-down
[==] 11 tests from 1 test case ran. (536 ms total)
[  PASSED  ] 11 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-02-27 Thread Yongqiao Wang


> On Feb. 27, 2016, 12:21 p.m., Adam B wrote:
> > Sorry this took me forever to get to. Looks pretty good except for some 
> > indentation and some unnecessary lines.
> > I'd also like to see a couple of registrar tests, like AlexR suggested.

Thanks Adam. I will add a couple of registrar tests later in another patches, 
is it OK?


- Yongqiao


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


On Jan. 25, 2016, 3:47 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Jan. 25, 2016, 3:47 p.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 8657a869f931aa7482fbb09f2c6df95b6a8c50c6 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (38 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (38 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (43 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (36 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (44 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (52 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (40 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (32 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (37 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
> [--] 11 tests from DynamicWeightsTest (492 ms total)
> 
> [--] Global test environment tear-down
> [==] 11 tests from 1 test case ran. (503 ms total)
> [  PASSED  ] 11 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-02-27 Thread Adam B

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



Sorry this took me forever to get to. Looks pretty good except for some 
indentation and some unnecessary lines.
I'd also like to see a couple of registrar tests, like AlexR suggested.


src/tests/dynamic_weights_tests.cpp (lines 71 - 74)


You can just use `process::http::Headers` instead.



src/tests/dynamic_weights_tests.cpp (line 108)


s/Req/Request/ (we don't like abbrev's)



src/tests/dynamic_weights_tests.cpp (line 113)


s/json/"%s"/ - no reaon to create a local variable for a string constant 
that isn't reused.



src/tests/dynamic_weights_tests.cpp (lines 134 - 150)


Seems like this should be an if/else, rather than always evaluating 
JSON::parse("[...]") even if the value's getting thrown away. Maybe something 
more like:
```Try expected;
if (weights == "") {
  expected = "[..short..]";
} else if (weights == WEIGHTS) {
  expected = "[...longer...]";
} else {
  expected = Error("Unexpected weights string.");
}```



src/tests/dynamic_weights_tests.cpp (lines 215 - 219)


This seems like an arbitrary indentation. Either align with the parentheses 
(too far over in this case), or indent 4 spaces in from the previous line.



src/tests/dynamic_weights_tests.cpp (lines 215 - 219)


This seems like an arbitrary indentation. Either align with the parentheses 
(too far over in this case), or indent 4 spaces in from the previous line.



src/tests/dynamic_weights_tests.cpp (line 227)


s/filed/field/



src/tests/dynamic_weights_tests.cpp (lines 236 - 240)


Fix the indent again, everywhere.



src/tests/dynamic_weights_tests.cpp (line 247)


Soon this line won't be necessary, but we'll try to get your patch 
committed before Joseph's so he's the one who has to rebase, not you. :)



src/tests/dynamic_weights_tests.cpp (line 290)


Please add another Bad Request test for a non-numeric weight value, like 
"role1=two"



src/tests/dynamic_weights_tests.cpp (line 322)


s/empty (Only a space) role/empty role (only a space)/



src/tests/dynamic_weights_tests.cpp (line 400)


s/does not/not/



src/tests/dynamic_weights_tests.cpp (line 472)


You can remove the `UpdateWeightsWithImplicitRoles` test, since this test 
already tests implicit roles.



src/tests/dynamic_weights_tests.cpp (line 523)


This line should be unnecessary. If there are no credentials in the 
request, and authenticate_http=false (meaning authn is not required), then your 
request should be allowed through without authn.
In this setup, the master would still use its --credentials to authenticate 
any client that tries to use credentials.



src/tests/dynamic_weights_tests.cpp (lines 553 - 556)


These lines should be unnecessary if the ACLs are restrictive by default.


- Adam B


On Jan. 25, 2016, 7:47 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Jan. 25, 2016, 7:47 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 8657a869f931aa7482fbb09f2c6df95b6a8c50c6 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] 

Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-25 Thread Yongqiao Wang

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

(Updated Jan. 25, 2016, 3:47 p.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Update the tests and trigger the ReviewBot again.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am 8657a869f931aa7482fbb09f2c6df95b6a8c50c6 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 11 tests from 1 test case.
[--] Global test environment set-up.
[--] 11 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (38 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (38 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (43 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (36 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (44 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (52 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (40 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (32 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(37 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
[--] 11 tests from DynamicWeightsTest (492 ms total)

[--] Global test environment tear-down
[==] 11 tests from 1 test case ran. (503 ms total)
[  PASSED  ] 11 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-25 Thread Mesos ReviewBot

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



Patch looks great!

Reviews applied: [41597, 41681, 41789, 41790]

Passed command: export OS=ubuntu:14.04;export CONFIGURATION="--verbose";export 
COMPILER=gcc; ./support/docker_build.sh

- Mesos ReviewBot


On Jan. 25, 2016, 3:47 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Jan. 25, 2016, 3:47 p.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 8657a869f931aa7482fbb09f2c6df95b6a8c50c6 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (38 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (38 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (43 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (36 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (44 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (52 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (40 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (32 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (37 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
> [--] 11 tests from DynamicWeightsTest (492 ms total)
> 
> [--] Global test environment tear-down
> [==] 11 tests from 1 test case ran. (503 ms total)
> [  PASSED  ] 11 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-24 Thread Yongqiao Wang

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

(Updated Jan. 25, 2016, 1:51 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Update the Unauthorized error HTTP response.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am 19bf3a7c2e43ca04ed6e6d506e052de5537f7c2f 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 11 tests from 1 test case.
[--] Global test environment set-up.
[--] 11 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (38 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (38 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (43 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (36 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (44 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (52 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (40 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (32 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(37 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
[--] 11 tests from DynamicWeightsTest (492 ms total)

[--] Global test environment tear-down
[==] 11 tests from 1 test case ran. (503 ms total)
[  PASSED  ] 11 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-24 Thread Mesos ReviewBot

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



Bad patch!

Reviews applied: [41597]

Failed command: ./support/apply-review.sh -n -r 41597

Error:
 ..
2016-01-25 02:34:11 URL:https://reviews.apache.org/r/41597/diff/raw/ 
[7672/7672] -> "41597.patch" [1]
error: patch failed: src/master/allocator/mesos/hierarchical.cpp:1043
error: src/master/allocator/mesos/hierarchical.cpp: patch does not apply

Full log: https://builds.apache.org/job/mesos-reviewbot/11017/console

- Mesos ReviewBot


On Jan. 25, 2016, 1:51 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Jan. 25, 2016, 1:51 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 19bf3a7c2e43ca04ed6e6d506e052de5537f7c2f 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (38 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (38 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (43 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (36 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (44 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (52 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (40 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (32 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (37 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
> [--] 11 tests from DynamicWeightsTest (492 ms total)
> 
> [--] Global test environment tear-down
> [==] 11 tests from 1 test case ran. (503 ms total)
> [  PASSED  ] 11 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-21 Thread Yongqiao Wang

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

(Updated Jan. 21, 2016, 9:57 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Update the dependency to address the build error.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs
-

  src/Makefile.am 4fabe600d4ba38c95a777d622b0b675dd5811a53 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 11 tests from 1 test case.
[--] Global test environment set-up.
[--] 11 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (38 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (38 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (43 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (36 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (44 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (52 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (40 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (32 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(37 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
[--] 11 tests from DynamicWeightsTest (492 ms total)

[--] Global test environment tear-down
[==] 11 tests from 1 test case ran. (503 ms total)
[  PASSED  ] 11 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-20 Thread Yongqiao Wang

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

(Updated Jan. 21, 2016, 3:08 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Add the denpendy to fix the build error.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs
-

  src/Makefile.am 4fabe600d4ba38c95a777d622b0b675dd5811a53 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 11 tests from 1 test case.
[--] Global test environment set-up.
[--] 11 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (38 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (38 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (43 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (36 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (44 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (52 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (40 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (32 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(37 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
[--] 11 tests from DynamicWeightsTest (492 ms total)

[--] Global test environment tear-down
[==] 11 tests from 1 test case ran. (503 ms total)
[  PASSED  ] 11 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-20 Thread Yongqiao Wang

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

(Updated Jan. 20, 2016, 11:13 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Addressed the comments of Adam.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am 4fabe600d4ba38c95a777d622b0b675dd5811a53 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 11 tests from 1 test case.
[--] Global test environment set-up.
[--] 11 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (38 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (38 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (43 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (36 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (44 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (52 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (40 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (32 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(37 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
[--] 11 tests from DynamicWeightsTest (492 ms total)

[--] Global test environment tear-down
[==] 11 tests from 1 test case ran. (503 ms total)
[  PASSED  ] 11 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-12 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [41597, 41681, 41789, 41790]

Passed command: export OS=ubuntu:14.04;export CONFIGURATION="--verbose";export 
COMPILER=gcc; ./support/docker_build.sh

- Mesos ReviewBot


On Jan. 12, 2016, 7:30 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Jan. 12, 2016, 7:30 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 8cbfb1ba5fa49f2d3cc26ea325838a1c68a79660 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 11 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 11 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
> [ RUN  ] DynamicWeightsTest.ZeroWeight
> [   OK ] DynamicWeightsTest.ZeroWeight (38 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (38 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (43 ms)
> [ RUN  ] DynamicWeightsTest.UnknownRole
> [   OK ] DynamicWeightsTest.UnknownRole (36 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (44 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (52 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (40 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (32 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (37 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
> [--] 11 tests from DynamicWeightsTest (492 ms total)
> 
> [--] Global test environment tear-down
> [==] 11 tests from 1 test case ran. (503 ms total)
> [  PASSED  ] 11 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-11 Thread Yongqiao Wang

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

(Updated Jan. 12, 2016, 7:30 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Rebase.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am 8cbfb1ba5fa49f2d3cc26ea325838a1c68a79660 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 11 tests from 1 test case.
[--] Global test environment set-up.
[--] 11 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (38 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (38 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (43 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (36 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (44 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (52 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (40 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (32 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(37 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
[--] 11 tests from DynamicWeightsTest (492 ms total)

[--] Global test environment tear-down
[==] 11 tests from 1 test case ran. (503 ms total)
[  PASSED  ] 11 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-11 Thread Yongqiao Wang


> On Jan. 11, 2016, 7:55 a.m., Adam B wrote:
> > src/tests/dynamic_weights_tests.cpp, line 329
> > 
> >
> > "specified role"? Which one? You mean WEIGHTS?

Yes, I have improved the comments to more clear.


> On Jan. 11, 2016, 7:55 a.m., Adam B wrote:
> > src/tests/dynamic_weights_tests.cpp, line 148
> > 
> >
> > Why don't we have a `process::http::put()`?

I have explained it in https://reviews.apache.org/r/41789/, only want to use a 
general function rather than some specific funcs.


> On Jan. 11, 2016, 7:55 a.m., Adam B wrote:
> > src/tests/dynamic_weights_tests.cpp, line 155
> > 
> >
> > What does the false do? Please comment

I will comment that in the place of httpRequest function declaration in 
http.hpp.


- Yongqiao


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


On Jan. 9, 2016, 11:38 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Jan. 9, 2016, 11:38 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am bbd0c119321fa9d11fea61b140428dd92d1258c8 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 10 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 10 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (43 ms)
> [ RUN  ] DynamicWeightsTest.NonExistentRole
> [   OK ] DynamicWeightsTest.NonExistentRole (30 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (42 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (37 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (44 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
> [--] 10 tests from DynamicWeightsTest (443 ms total)
> 
> [--] Global test environment tear-down
> [==] 10 tests from 1 test case ran. (452 ms total)
> [  PASSED  ] 10 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-11 Thread Yongqiao Wang

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

(Updated Jan. 11, 2016, 2:47 p.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Addressed the comments of Adam.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am 8cbfb1ba5fa49f2d3cc26ea325838a1c68a79660 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing (updated)
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 11 tests from 1 test case.
[--] Global test environment set-up.
[--] 11 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
[ RUN  ] DynamicWeightsTest.ZeroWeight
[   OK ] DynamicWeightsTest.ZeroWeight (38 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (38 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (43 ms)
[ RUN  ] DynamicWeightsTest.UnknownRole
[   OK ] DynamicWeightsTest.UnknownRole (36 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (44 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (52 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (40 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (32 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(37 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
[--] 11 tests from DynamicWeightsTest (492 ms total)

[--] Global test environment tear-down
[==] 11 tests from 1 test case ran. (503 ms total)
[  PASSED  ] 11 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-11 Thread Mesos ReviewBot

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


Bad patch!

Reviews applied: [41597, 41681, 41789, 41790]

Failed command: export OS=ubuntu:14.04;export CONFIGURATION="--verbose";export 
COMPILER=gcc; ./support/docker_build.sh

Error:
 + : ubuntu:14.04
+ : gcc
+ : --verbose
+++ dirname ./support/docker_build.sh
++ cd ./support/..
++ pwd
+ MESOS_DIRECTORY=/home/jenkins/jenkins-slave/workspace/mesos-reviewbot
+ cd /home/jenkins/jenkins-slave/workspace/mesos-reviewbot
+ DOCKERFILE=Dockerfile
+ rm -f Dockerfile
+ case $OS in
+ append_dockerfile 'FROM ubuntu:14.04'
+ echo FROM ubuntu:14.04
+ append_dockerfile 'RUN rm -rf /var/lib/apt/lists/*'
+ echo RUN rm -rf 
/var/lib/apt/lists/get.docker.io_ubuntu_dists_docker_main_binary-amd64_Packages 
/var/lib/apt/lists/get.docker.io_ubuntu_dists_docker_main_binary-i386_Packages 
/var/lib/apt/lists/get.docker.io_ubuntu_dists_docker_Release 
/var/lib/apt/lists/get.docker.io_ubuntu_dists_docker_Release.gpg 
/var/lib/apt/lists/lock 
/var/lib/apt/lists/packages.apache.org_asf%5finternal_dists_trusty_main_binary-amd64_Packages
 
/var/lib/apt/lists/packages.apache.org_asf%5finternal_dists_trusty_main_binary-i386_Packages
 /var/lib/apt/lists/packages.apache.org_asf%5finternal_dists_trusty_Release 
/var/lib/apt/lists/packages.apache.org_asf%5finternal_dists_trusty_Release.gpg 
/var/lib/apt/lists/partial 
/var/lib/apt/lists/ppa.launchpad.net_webupd8team_java_ubuntu_dists_trusty_main_binary-amd64_Packages
 
/var/lib/apt/lists/ppa.launchpad.net_webupd8team_java_ubuntu_dists_trusty_main_binary-i386_Packages
 
/var/lib/apt/lists/ppa.launchpad.net_webupd8team_java_ubuntu_dists_trusty_main_i18n_Translation-en
 /va
 
r/lib/apt/lists/ppa.launchpad.net_webupd8team_java_ubuntu_dists_trusty_main_source_Sources
 
/var/lib/apt/lists/ppa.launchpad.net_webupd8team_java_ubuntu_dists_trusty_Release
 /var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_InRelease 
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_main_binary-amd64_Packages
 
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_main_binary-i386_Packages
 
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_main_i18n_Translation-en
 
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_main_source_Sources
 
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_multiverse_binary-amd64_Packages
 
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_multiverse_binary-i386_Packages
 
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_multiverse_i18n_Translation-en
 /var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_multiver
 se_source_Sources 
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_restricted_binary-amd64_Packages
 
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_restricted_binary-i386_Packages
 
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_restricted_i18n_Translation-en
 
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_restricted_source_Sources
 
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_universe_binary-amd64_Packages
 
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_universe_binary-i386_Packages
 
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_universe_i18n_Translation-en
 
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_trusty-security_universe_source_Sources
 
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty-backports_InRelease
 
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty-backports_main_binary-amd64_Packages
 /var/lib/apt/lists/u
 s.archive.ubuntu.com_ubuntu_dists_trusty-backports_main_binary-i386_Packages 
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty-backports_main_i18n_Translation-en
 
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty-backports_main_source_Sources
 
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty-backports_multiverse_binary-amd64_Packages
 
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty-backports_multiverse_binary-i386_Packages
 
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty-backports_multiverse_i18n_Translation-en
 
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty-backports_multiverse_source_Sources
 
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty-backports_restricted_binary-amd64_Packages
 
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty-backports_restricted_binary-i386_Packages
 
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty-backports_restricted_i18n_Translation-en
 /var/lib/apt/lists
 /us.archive.ubuntu.com_ubuntu_dists_trusty-backports_restricted_source_Sources 

Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-10 Thread Adam B

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


A good set of tests for the functionality, but I've got some suggestions for 
you, most importantly:
- We should consider an official `http::put()` method like `http::post()`, etc.
- Don't forget to clear the permissive bit if you want restrictive ACLs.
- I found a few unused methods/variables. Use it or lose it.


src/tests/dynamic_weights_tests.cpp (line 70)


s/std:://g



src/tests/dynamic_weights_tests.cpp (line 79)


s/weithgs/weights/



src/tests/dynamic_weights_tests.cpp (line 88)


This is never called?



src/tests/dynamic_weights_tests.cpp (line 99)


`s/;/./`



src/tests/dynamic_weights_tests.cpp (line 103)


Error check, for empty vector, etc.



src/tests/dynamic_weights_tests.cpp (line 105)


s/std:://g



src/tests/dynamic_weights_tests.cpp (line 106)


Assert that pair.size() == 2



src/tests/dynamic_weights_tests.cpp (line 130)


s/std:://g



src/tests/dynamic_weights_tests.cpp (lines 130 - 133)


We usually use `FOO = "bar";` rather than `FOO{"bar"}`.



src/tests/dynamic_weights_tests.cpp (line 133)


Unused?



src/tests/dynamic_weights_tests.cpp (line 135)


Unused?



src/tests/dynamic_weights_tests.cpp (line 146)


I'm not convinced the lambda makes this much more readable. And you aren't 
actually calling `http::put`, since that doesn't exist.



src/tests/dynamic_weights_tests.cpp (line 148)


Why don't we have a `process::http::put()`?



src/tests/dynamic_weights_tests.cpp (line 155)


What does the false do? Please comment



src/tests/dynamic_weights_tests.cpp (line 158)


s/a update/an update/g



src/tests/dynamic_weights_tests.cpp (lines 170 - 173)


Why the scoping here? If you want to reuse the names 'badRequest' and 
'response', you could do so without creating a new variable each time.



src/tests/dynamic_weights_tests.cpp (line 186)


s/update weights/update weights request/
s/invalid fields/an invalid field/



src/tests/dynamic_weights_tests.cpp (line 191)


What makes this an invalid field? Isn't it a perfectly reasonable role name?

Or is it supposed to be `weights=[{ "role":"role1", "weight":1.5}]`, in 
which case "role1" is also an invalid field name?



src/tests/dynamic_weights_tests.cpp (line 204)


Can you test weight=0 too?



src/tests/dynamic_weights_tests.cpp (lines 221 - 222)


Could you verify after the failed update that the weights are still at 
their original value?



src/tests/dynamic_weights_tests.cpp (lines 264 - 265)


s/does not contains/not specified/



src/tests/dynamic_weights_tests.cpp (line 267)


s/NonExistent/Nonexistent/



src/tests/dynamic_weights_tests.cpp (line 292)


s/the existent roles/a whitelisted role/



src/tests/dynamic_weights_tests.cpp (line 293)


s/contains in/contained in/
s/is succeeded/succeeds/



src/tests/dynamic_weights_tests.cpp (lines 313 - 314)


Verify the new weights in `/roles`?



src/tests/dynamic_weights_tests.cpp (lines 320 - 321)


s/is succeeded/succeeds/



src/tests/dynamic_weights_tests.cpp (line 329)


"specified role"? Which one? You mean WEIGHTS?



src/tests/dynamic_weights_tests.cpp (line 372)


s/absense/absence/



src/tests/dynamic_weights_tests.cpp (lines 394 - 395)


You 

Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-10 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [41597, 41681, 41789, 41790]

Passed command: export OS=ubuntu:14.04;export CONFIGURATION="--verbose";export 
COMPILER=gcc; ./support/docker_build.sh

- Mesos ReviewBot


On Jan. 9, 2016, 11:38 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Jan. 9, 2016, 11:38 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am bbd0c119321fa9d11fea61b140428dd92d1258c8 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 10 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 10 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (43 ms)
> [ RUN  ] DynamicWeightsTest.NonExistentRole
> [   OK ] DynamicWeightsTest.NonExistentRole (30 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (42 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (37 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (44 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
> [--] 10 tests from DynamicWeightsTest (443 ms total)
> 
> [--] Global test environment tear-down
> [==] 10 tests from 1 test case ran. (452 ms total)
> [  PASSED  ] 10 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-09 Thread Yongqiao Wang

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

(Updated Jan. 9, 2016, 11:38 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Update the tests to apply the http authentication.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am bbd0c119321fa9d11fea61b140428dd92d1258c8 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 10 tests from 1 test case.
[--] Global test environment set-up.
[--] 10 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (43 ms)
[ RUN  ] DynamicWeightsTest.NonExistentRole
[   OK ] DynamicWeightsTest.NonExistentRole (30 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (42 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (37 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(44 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
[--] 10 tests from DynamicWeightsTest (443 ms total)

[--] Global test environment tear-down
[==] 10 tests from 1 test case ran. (452 ms total)
[  PASSED  ] 10 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-06 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [41597, 41681, 41789, 41790]

Passed command: export OS=ubuntu:14.04;export CONFIGURATION="--verbose";export 
COMPILER=gcc; ./support/docker_build.sh

- Mesos ReviewBot


On Jan. 6, 2016, 2:07 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Jan. 6, 2016, 2:07 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am e08e86724abaa3023f0483aa222354c95d4d3817 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 10 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 10 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (43 ms)
> [ RUN  ] DynamicWeightsTest.NonExistentRole
> [   OK ] DynamicWeightsTest.NonExistentRole (30 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (42 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (37 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (44 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
> [--] 10 tests from DynamicWeightsTest (443 ms total)
> 
> [--] Global test environment tear-down
> [==] 10 tests from 1 test case ran. (452 ms total)
> [  PASSED  ] 10 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-05 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [41597, 41681, 41789, 41790]

Passed command: export OS=ubuntu:14.04;export CONFIGURATION="--verbose";export 
COMPILER=gcc; ./support/docker_build.sh

- Mesos ReviewBot


On Jan. 5, 2016, 1:42 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Jan. 5, 2016, 1:42 p.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am e08e86724abaa3023f0483aa222354c95d4d3817 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 10 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 10 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
> [ RUN  ] DynamicWeightsTest.MissingRole
> [   OK ] DynamicWeightsTest.MissingRole (43 ms)
> [ RUN  ] DynamicWeightsTest.NonExistentRole
> [   OK ] DynamicWeightsTest.NonExistentRole (30 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (42 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (37 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (44 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
> [--] 10 tests from DynamicWeightsTest (443 ms total)
> 
> [--] Global test environment tear-down
> [==] 10 tests from 1 test case ran. (452 ms total)
> [  PASSED  ] 10 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-05 Thread Yongqiao Wang

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

(Updated Jan. 5, 2016, 1:42 p.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Update the test due to the updateWeight() interface changed.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am e08e86724abaa3023f0483aa222354c95d4d3817 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing (updated)
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 10 tests from 1 test case.
[--] Global test environment set-up.
[--] 10 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (43 ms)
[ RUN  ] DynamicWeightsTest.NonExistentRole
[   OK ] DynamicWeightsTest.NonExistentRole (30 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (42 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (37 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(44 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
[--] 10 tests from DynamicWeightsTest (443 ms total)

[--] Global test environment tear-down
[==] 10 tests from 1 test case ran. (452 ms total)
[  PASSED  ] 10 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-05 Thread Yongqiao Wang

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

(Updated Jan. 6, 2016, 2:07 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Using the common functions.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am e08e86724abaa3023f0483aa222354c95d4d3817 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 10 tests from 1 test case.
[--] Global test environment set-up.
[--] 10 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (102 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (42 ms)
[ RUN  ] DynamicWeightsTest.MissingRole
[   OK ] DynamicWeightsTest.MissingRole (43 ms)
[ RUN  ] DynamicWeightsTest.NonExistentRole
[   OK ] DynamicWeightsTest.NonExistentRole (30 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (38 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (42 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (35 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (37 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(44 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (30 ms)
[--] 10 tests from DynamicWeightsTest (443 ms total)

[--] Global test environment tear-down
[==] 10 tests from 1 test case ran. (452 ms total)
[  PASSED  ] 10 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-04 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [41597, 41681, 41789, 41790]

Passed command: export OS=ubuntu:14.04;export CONFIGURATION="--verbose";export 
COMPILER=gcc; ./support/docker_build.sh

- Mesos ReviewBot


On Jan. 4, 2016, 1:53 p.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Jan. 4, 2016, 1:53 p.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am b58d6b560858d318058be766456dd5c5ef98c23e 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 9 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 9 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (106 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (43 ms)
> [ RUN  ] DynamicWeightsTest.NonExistentRole
> [   OK ] DynamicWeightsTest.NonExistentRole (40 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (46 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (35 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (33 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (41 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (34 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (36 ms)
> [--] 9 tests from DynamicWeightsTest (415 ms total)
> 
> [--] Global test environment tear-down
> [==] 9 tests from 1 test case ran. (424 ms total)
> [  PASSED  ] 9 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-04 Thread Yongqiao Wang

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

(Updated Jan. 4, 2016, 11:23 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs
-

  src/Makefile.am b58d6b560858d318058be766456dd5c5ef98c23e 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing (updated)
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 9 tests from 1 test case.
[--] Global test environment set-up.
[--] 9 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (106 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (43 ms)
[ RUN  ] DynamicWeightsTest.NonExistentRole
[   OK ] DynamicWeightsTest.NonExistentRole (40 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (46 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (35 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (33 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (41 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(34 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (36 ms)
[--] 9 tests from DynamicWeightsTest (415 ms total)

[--] Global test environment tear-down
[==] 9 tests from 1 test case ran. (424 ms total)
[  PASSED  ] 9 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-04 Thread Yongqiao Wang

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

(Updated Jan. 4, 2016, 11:23 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Add the authrization and authentication test.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am b58d6b560858d318058be766456dd5c5ef98c23e 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 5 tests from 1 test case.
[--] Global test environment set-up.
[--] 5 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (77 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (35 ms)
[ RUN  ] DynamicWeightsTest.NonExistentRole
[   OK ] DynamicWeightsTest.NonExistentRole (40 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (46 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (37 ms)
[--] 5 tests from DynamicWeightsTest (235 ms total)

[--] Global test environment tear-down
[==] 5 tests from 1 test case ran. (244 ms total)
[  PASSED  ] 5 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-04 Thread Mesos ReviewBot

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


Bad patch!

Reviews applied: [41597]

Failed command: ./support/apply-review.sh -n -r 41597

Error:
 2016-01-04 13:01:47 URL:https://reviews.apache.org/r/41597/diff/raw/ 
[8106/8106] -> "41597.patch" [1]
Total errors found: 0
Checking 8 files
Error: Commit message summary (the first line) must end in a period.

- Mesos ReviewBot


On Jan. 4, 2016, 11:23 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Jan. 4, 2016, 11:23 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am b58d6b560858d318058be766456dd5c5ef98c23e 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 9 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 9 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (106 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (43 ms)
> [ RUN  ] DynamicWeightsTest.NonExistentRole
> [   OK ] DynamicWeightsTest.NonExistentRole (40 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (46 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (35 ms)
> [ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
> [   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (33 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (41 ms)
> [ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
> [   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
> (34 ms)
> [ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
> [   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (36 ms)
> [--] 9 tests from DynamicWeightsTest (415 ms total)
> 
> [--] Global test environment tear-down
> [==] 9 tests from 1 test case ran. (424 ms total)
> [  PASSED  ] 9 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2016-01-04 Thread Yongqiao Wang

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

(Updated Jan. 4, 2016, 1:53 p.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Rebase.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am b58d6b560858d318058be766456dd5c5ef98c23e 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 9 tests from 1 test case.
[--] Global test environment set-up.
[--] 9 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (106 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (43 ms)
[ RUN  ] DynamicWeightsTest.NonExistentRole
[   OK ] DynamicWeightsTest.NonExistentRole (40 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (46 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (35 ms)
[ RUN  ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest
[   OK ] DynamicWeightsTest.UnauthenticatedUpdateWeightRequest (33 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.AuthorizedWeightUpdateRequest (41 ms)
[ RUN  ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal
[   OK ] DynamicWeightsTest.AuthorizedUpdateWeightRequestWithoutPrincipal 
(34 ms)
[ RUN  ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest
[   OK ] DynamicWeightsTest.UnauthorizedWeightUpdateRequest (36 ms)
[--] 9 tests from DynamicWeightsTest (415 ms total)

[--] Global test environment tear-down
[==] 9 tests from 1 test case ran. (424 ms total)
[  PASSED  ] 9 tests.


Thanks,

Yongqiao Wang



Review Request 41790: Add tests for /weights endpoint.

2015-12-30 Thread Yongqiao Wang

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

Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs
-

  src/Makefile.am bf71fe6ee65233bbc47a41f610d68ff9760e19f6 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing
---

Make and Make check successfully!


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2015-12-30 Thread Yongqiao Wang

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

(Updated Dec. 30, 2015, 11:56 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs (updated)
-

  src/Makefile.am bf71fe6ee65233bbc47a41f610d68ff9760e19f6 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing (updated)
---

Make and Make check successfully!

./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
[==] Running 5 tests from 1 test case.
[--] Global test environment set-up.
[--] 5 tests from DynamicWeightsTest
[ RUN  ] DynamicWeightsTest.PutInvalidRequest
[   OK ] DynamicWeightsTest.PutInvalidRequest (77 ms)
[ RUN  ] DynamicWeightsTest.NegativeWeight
[   OK ] DynamicWeightsTest.NegativeWeight (35 ms)
[ RUN  ] DynamicWeightsTest.NonExistentRole
[   OK ] DynamicWeightsTest.NonExistentRole (40 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (46 ms)
[ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
[   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (37 ms)
[--] 5 tests from DynamicWeightsTest (235 ms total)

[--] Global test environment tear-down
[==] 5 tests from 1 test case ran. (244 ms total)
[  PASSED  ] 5 tests.


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2015-12-30 Thread Yongqiao Wang

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

(Updated Dec. 30, 2015, 10:59 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Changes
---

Change the depend bug.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs
-

  src/Makefile.am bf71fe6ee65233bbc47a41f610d68ff9760e19f6 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing
---

Make and Make check successfully!


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2015-12-30 Thread Yongqiao Wang

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

(Updated Dec. 30, 2015, 11:24 a.m.)


Review request for mesos, Adam B, Neil Conway, and Qian Zhang.


Bugs: MESOS-4200
https://issues.apache.org/jira/browse/MESOS-4200


Repository: mesos


Description
---

Add tests for /weights endpoint.


Diffs
-

  src/Makefile.am bf71fe6ee65233bbc47a41f610d68ff9760e19f6 
  src/tests/dynamic_weights_tests.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41790/diff/


Testing
---

Make and Make check successfully!


Thanks,

Yongqiao Wang



Re: Review Request 41790: Add tests for /weights endpoint.

2015-12-30 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [41597, 41681, 41789, 41790]

Passed command: export OS=ubuntu:14.04;export CONFIGURATION="--verbose";export 
COMPILER=gcc; ./support/docker_build.sh

- Mesos ReviewBot


On Dec. 30, 2015, 8:35 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Dec. 30, 2015, 8:35 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am bf71fe6ee65233bbc47a41f610d68ff9760e19f6 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>



Re: Review Request 41790: Add tests for /weights endpoint.

2015-12-30 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [41597, 41681, 41789, 41790]

Passed command: export OS=ubuntu:14.04;export CONFIGURATION="--verbose";export 
COMPILER=gcc; ./support/docker_build.sh

- Mesos ReviewBot


On Dec. 30, 2015, 11:56 a.m., Yongqiao Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41790/
> ---
> 
> (Updated Dec. 30, 2015, 11:56 a.m.)
> 
> 
> Review request for mesos, Adam B, Neil Conway, and Qian Zhang.
> 
> 
> Bugs: MESOS-4200
> https://issues.apache.org/jira/browse/MESOS-4200
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add tests for /weights endpoint.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am bf71fe6ee65233bbc47a41f610d68ff9760e19f6 
>   src/tests/dynamic_weights_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41790/diff/
> 
> 
> Testing
> ---
> 
> Make and Make check successfully!
> 
> ./src/mesos-tests --gtest_filter=DynamicWeightsTest.*
> [==] Running 5 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 5 tests from DynamicWeightsTest
> [ RUN  ] DynamicWeightsTest.PutInvalidRequest
> [   OK ] DynamicWeightsTest.PutInvalidRequest (77 ms)
> [ RUN  ] DynamicWeightsTest.NegativeWeight
> [   OK ] DynamicWeightsTest.NegativeWeight (35 ms)
> [ RUN  ] DynamicWeightsTest.NonExistentRole
> [   OK ] DynamicWeightsTest.NonExistentRole (40 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithExplictRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithExplictRoles (46 ms)
> [ RUN  ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles
> [   OK ] DynamicWeightsTest.UpdateWeightsWithImplicitRoles (37 ms)
> [--] 5 tests from DynamicWeightsTest (235 ms total)
> 
> [--] Global test environment tear-down
> [==] 5 tests from 1 test case ran. (244 ms total)
> [  PASSED  ] 5 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>