[
https://issues.apache.org/jira/browse/MESOS-3848?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Joseph Wu updated MESOS-3848:
-----------------------------
Shepherd: Joseph Wu (was: Jie Yu)
Assignee: (was: Joseph Wu)
Description:
As part of [MESOS-3762], many tests were changed from one
{{TemporaryDirectoryTest}} to another {{TemporaryDirectoryTest}}. One subtle
difference is that the name of the temporary directory no longer contains the
name of the test. In [MESOS-3847], the duplicate {{TemporaryDirectoryTest}}
was removed.
The original {{TemporaryDirectoryTest}} called
[{{environment->mkdtemp}}|https://github.com/apache/mesos/blob/master/src/tests/environment.cpp#L494].
We would like the naming, which is valuable for debugging, to be available
for a majority of tests. (A majority of tests inherit from
{{TemporaryDirectoryTest}} in some way.)
Note:
* Any additional directories created via {{environment->mkdtemp}} are cleaned
up after the test.
* We don't want mesos-specific logic in Stout, like the {{umount}} shell
command in {{Environment::TearDown}}.
* Temp directories created via {{environment->mkdtemp}} can be placed in
another folder via the [{{TMPDIR}} environment
variable|https://github.com/apache/mesos/blob/4a703b91151568e21b8772af51c22e23b105313c/src/tests/environment.cpp#L892-L905].
We want to look at this variable in {{TemporaryDirectoryTest}} too.
*Proposed change:*
Move the temporary directory logic from {{Environment::mkdtemp}} to
{{TemporaryDirectoryTest}}.
*Tests that need to change*
| {{log_tests.cpp}} | {{LogZooKeeperTest}} | We can change {{ZooKeeperTest}} to
inherit from {{TemporaryDirectoryTest}} to get rid of code duplication |
| {{tests/mesos.cpp}} | {{MesosTest::CreateSlaveFlags}} | {{MesosTest}} already
inherits from {{TemporaryDirectoryTest}}. |
| {{tests/script.hpp}} | {{TEST_SCRIPT}} | This is used for the
{{ExampleTests}}. We can define a test class that inherits appropriately. |
| {{docker_tests.cpp}} | {{*}} | Already inherits from {{MesosTest}}. |
was:
As part of [MESOS-3762], many tests were changed from one
{{TemporaryDirectoryTest}} to another {{TemporaryDirectoryTest}}. One subtle
difference is that the name of the temporary directory no longer contains the
name of the test. In [MESOS-3847], the duplicate {{TemporaryDirectoryTest}}
was removed.
The original {{TemporaryDirectoryTest}} called
[{{environment->mkdtemp}}|https://github.com/apache/mesos/blob/master/src/tests/environment.cpp#L494].
We would like the naming, which is valuable for debugging, to be available
for a majority of tests. (A majority of tests inherit from
{{TemporaryDirectoryTest}} in some way.)
Note:
* Any additional directories created via {{environment->mkdtemp}} are cleaned
up after the test.
* We don't want mesos-specific logic in Stout, like the {{umount}} shell
command in {{Environment::TearDown}}.
*Proposed change:*
Move the temporary directory logic from {{Environment::mkdtemp}} to
{{TemporaryDirectoryTest}}.
*Tests that need to change*
| {{log_tests.cpp}} | {{LogZooKeeperTest}} | We can change {{ZooKeeperTest}} to
inherit from {{TemporaryDirectoryTest}} to get rid of code duplication |
| {{tests/mesos.cpp}} | {{MesosTest::CreateSlaveFlags}} | {{MesosTest}} already
inherits from {{TemporaryDirectoryTest}}. |
| {{tests/script.hpp}} | {{TEST_SCRIPT}} | This is used for the
{{ExampleTests}}. We can define a test class that inherits appropriately. |
| {{docker_tests.cpp}} | {{*}} | Already inherits from {{MesosTest}}. |
> Refactor Environment::mkdtemp into TemporaryDirectoryTest.
> ----------------------------------------------------------
>
> Key: MESOS-3848
> URL: https://issues.apache.org/jira/browse/MESOS-3848
> Project: Mesos
> Issue Type: Task
> Components: test
> Reporter: Joseph Wu
> Priority: Minor
> Labels: mesosphere
>
> As part of [MESOS-3762], many tests were changed from one
> {{TemporaryDirectoryTest}} to another {{TemporaryDirectoryTest}}. One subtle
> difference is that the name of the temporary directory no longer contains the
> name of the test. In [MESOS-3847], the duplicate {{TemporaryDirectoryTest}}
> was removed.
> The original {{TemporaryDirectoryTest}} called
> [{{environment->mkdtemp}}|https://github.com/apache/mesos/blob/master/src/tests/environment.cpp#L494].
> We would like the naming, which is valuable for debugging, to be available
> for a majority of tests. (A majority of tests inherit from
> {{TemporaryDirectoryTest}} in some way.)
> Note:
> * Any additional directories created via {{environment->mkdtemp}} are cleaned
> up after the test.
> * We don't want mesos-specific logic in Stout, like the {{umount}} shell
> command in {{Environment::TearDown}}.
> * Temp directories created via {{environment->mkdtemp}} can be placed in
> another folder via the [{{TMPDIR}} environment
> variable|https://github.com/apache/mesos/blob/4a703b91151568e21b8772af51c22e23b105313c/src/tests/environment.cpp#L892-L905].
> We want to look at this variable in {{TemporaryDirectoryTest}} too.
> *Proposed change:*
> Move the temporary directory logic from {{Environment::mkdtemp}} to
> {{TemporaryDirectoryTest}}.
> *Tests that need to change*
> | {{log_tests.cpp}} | {{LogZooKeeperTest}} | We can change {{ZooKeeperTest}}
> to inherit from {{TemporaryDirectoryTest}} to get rid of code duplication |
> | {{tests/mesos.cpp}} | {{MesosTest::CreateSlaveFlags}} | {{MesosTest}}
> already inherits from {{TemporaryDirectoryTest}}. |
> | {{tests/script.hpp}} | {{TEST_SCRIPT}} | This is used for the
> {{ExampleTests}}. We can define a test class that inherits appropriately. |
> | {{docker_tests.cpp}} | {{*}} | Already inherits from {{MesosTest}}. |
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)