mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam B <a...@mesosphere.io>
Subject Re: Review Request 41790: Add tests for /weights endpoint.
Date Mon, 14 Mar 2016 07:30:10 GMT

-----------------------------------------------------------
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)
<https://reviews.apache.org/r/41790/#comment185576>

    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)
<https://reviews.apache.org/r/41790/#comment185589>

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



src/tests/dynamic_weights_tests.cpp (line 323)
<https://reviews.apache.org/r/41790/#comment185590>

    Nit: s/they're/they are/



src/tests/dynamic_weights_tests.cpp (line 367)
<https://reviews.apache.org/r/41790/#comment185591>

    "Specify --roles whitelist when starting master."



src/tests/dynamic_weights_tests.cpp (line 397)
<https://reviews.apache.org/r/41790/#comment185592>

    "Specify --roles whitelist when starting master."



src/tests/dynamic_weights_tests.cpp (line 401)
<https://reviews.apache.org/r/41790/#comment185593>

    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)
<https://reviews.apache.org/r/41790/#comment185594>

    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)
<https://reviews.apache.org/r/41790/#comment185595>

    Wrap at `<<` instead



src/tests/dynamic_weights_tests.cpp (lines 563 - 564)
<https://reviews.apache.org/r/41790/#comment185596>

    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 environment tear-down
> [==========] 11 tests from 1 test case ran. (490 ms total)
> [  PASSED  ] 11 tests.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>


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