Skip to content
Snippets Groups Projects
Commit cd7594ca authored by Marcelo Vanzin's avatar Marcelo Vanzin Committed by Sean Owen
Browse files

[core] [minor] Don't pollute source directory when running UtilsSuite.

Author: Marcelo Vanzin <vanzin@cloudera.com>

Closes #4921 from vanzin/utils-suite and squashes the following commits:

7795dd4 [Marcelo Vanzin] [core] [minor] Don't pollute source directory when running UtilsSuite.
parent d8b3da9d
No related branches found
No related tags found
No related merge requests found
......@@ -386,10 +386,11 @@ class UtilsSuite extends FunSuite with ResetSystemProperties {
}
test("fetch hcfs dir") {
val sourceDir = Utils.createTempDir()
val tempDir = Utils.createTempDir()
val sourceDir = new File(tempDir, "source-dir")
val innerSourceDir = Utils.createTempDir(root=sourceDir.getPath)
val sourceFile = File.createTempFile("someprefix", "somesuffix", innerSourceDir)
val targetDir = new File(Utils.createTempDir(), "target-dir")
val targetDir = new File(tempDir, "target-dir")
Files.write("some text", sourceFile, UTF_8)
val path = new Path("file://" + sourceDir.getAbsolutePath)
......@@ -413,7 +414,7 @@ class UtilsSuite extends FunSuite with ResetSystemProperties {
assert(destInnerFile.isFile())
val filePath = new Path("file://" + sourceFile.getAbsolutePath)
val testFileDir = new File("test-filename")
val testFileDir = new File(tempDir, "test-filename")
val testFileName = "testFName"
val testFilefs = Utils.getHadoopFileSystem(filePath.toString, conf)
Utils.fetchHcfsFile(filePath, testFileDir, testFilefs, new SparkConf(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment