You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Akash Gupta <ak...@hotmail.com> on 2018/02/21 14:11:52 UTC

Review Request 65727: Moved `*DOCKER*` tests to `DockerContainerizerHealthCheckTest`.

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

Review request for mesos, Alexander Rukletsov, Andrew Schwartzmeyer, Gaston Kleiman, and Joseph Wu.


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


Repository: mesos


Description
-------

In `health_check_tests.cpp`, the `*DOCKER*` tests were moved to
`DockerContainerizerHealthCheckTest::Setup`, so that pre-pulling only
happens if the test is actually run. This avoids failing the test suite
due to the pull failing when docker isn't installed.


Diffs (updated)
-----

  src/tests/health_check_tests.cpp 1893c85169f5e94e164434b93e6a24268224225d 


Diff: https://reviews.apache.org/r/65727/diff/1/


Testing
-------


Thanks,

Akash Gupta


Re: Review Request 65727: Moved `*DOCKER*` tests to `DockerContainerizerHealthCheckTest`.

Posted by Andrew Schwartzmeyer <an...@schwartzmeyer.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65727/#review198010
-----------------------------------------------------------


Ship it!




To expand on why this change was necessary: each `DOCKER` test requires (a) Docker to be available and (b) the images to be pulled. The `DOCKER` test filter correctly satisfies (a), that is, if `docker` isn't available the test isn't run. However, the previous logic had the image pulling in `SetUpTestCase`, which was run once for the whole test suite, and therefore wasn't affected by the `DOCKER` filter, meaning `docker pull` would run (and fail) if Docker wasn't installed, since the suite had tests other than `DOCKER` tests.

So we need the `docker pull` logic to be executed if and only if Docker is available. We already have logic for checking this on a per-test basis, the `DOCKER` filter. So the code was moved to `SetUp`, which is run for each test. The code is in essence idempotent; once the images are pulled, pulling again is a no-op since they're cached (and the logging is done with `LOG_FIRST_N(..., 1)`. Furthermore, the tests were constrained to a suite consisting of _all_ `DOCKER` tests (the `DockerContainerizerHealthCheckTests`), and it's reasonable to assume that all tests added to this suite will use the `DOCKER` filter.

- Andrew Schwartzmeyer


On Feb. 21, 2018, 6:11 a.m., Akash Gupta wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65727/
> -----------------------------------------------------------
> 
> (Updated Feb. 21, 2018, 6:11 a.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov, Andrew Schwartzmeyer, Gaston Kleiman, and Joseph Wu.
> 
> 
> Bugs: MESOS-8498
>     https://issues.apache.org/jira/browse/MESOS-8498
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> In `health_check_tests.cpp`, the `*DOCKER*` tests were moved to
> `DockerContainerizerHealthCheckTest::Setup`, so that pre-pulling only
> happens if the test is actually run. This avoids failing the test suite
> due to the pull failing when docker isn't installed.
> 
> 
> Diffs
> -----
> 
>   src/tests/health_check_tests.cpp 1893c85169f5e94e164434b93e6a24268224225d 
> 
> 
> Diff: https://reviews.apache.org/r/65727/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Akash Gupta
> 
>


Re: Review Request 65727: Moved `*DOCKER*` tests to `DockerContainerizerHealthCheckTest`.

Posted by Akash Gupta <ak...@hotmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65727/#review197851
-----------------------------------------------------------



Diff makes it look worse than it actually is. Basically I moved the `*DOCKER*` tests under `HealthCheckTest` to go under `DockerContainizerHealthCheckTest`. Then, I moved the "once per test suite" code in `HealthCheckTest::SetupTestCase()` and `DockerContainerizerTest::SetupTestCase()` to the "once per test" `DockerContainerizerTest::Setup()` function so that we only pull the image if we pass the `*DOCKER*` filter. Otherwise, the test suite will fail if Docker isn't installed since it will fail `SetupTestCase()`.

- Akash Gupta


On Feb. 21, 2018, 2:11 p.m., Akash Gupta wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65727/
> -----------------------------------------------------------
> 
> (Updated Feb. 21, 2018, 2:11 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov, Andrew Schwartzmeyer, Gaston Kleiman, and Joseph Wu.
> 
> 
> Bugs: MESOS-8498
>     https://issues.apache.org/jira/browse/MESOS-8498
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> In `health_check_tests.cpp`, the `*DOCKER*` tests were moved to
> `DockerContainerizerHealthCheckTest::Setup`, so that pre-pulling only
> happens if the test is actually run. This avoids failing the test suite
> due to the pull failing when docker isn't installed.
> 
> 
> Diffs
> -----
> 
>   src/tests/health_check_tests.cpp 1893c85169f5e94e164434b93e6a24268224225d 
> 
> 
> Diff: https://reviews.apache.org/r/65727/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Akash Gupta
> 
>