Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-3848

Refactor Environment::mkdtemp into TemporaryDirectoryTest.

    XMLWordPrintableJSON

Details

    • Task
    • Status: Accepted
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • test
    • 3

    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. 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. 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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kaysoky Joseph Wu
              Joseph Wu Joseph Wu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: