Joseph Wu created MESOS-3848:
--------------------------------
Summary: 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
Assignee: Joseph Wu
Priority: Minor
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}}. |
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)