Skip to content

Commit b583f81

Browse files
committed
try out working dir fix
1 parent 2f24a84 commit b583f81

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

project/SparkBuild.scala

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ object TestSettings {
397397
}
398398

399399
def groupBySuite(tests: Seq[TestDefinition], javaOptions: Seq[String]) = {
400+
// println(javaOptions.mkString("\n"))
400401
tests groupBy (_.name.split('.').slice(0,4).mkString(".")) map {
401402
case (suite, tests) =>
402403
new Group(
@@ -409,7 +410,7 @@ object TestSettings {
409410

410411
lazy val settings = Seq (
411412
// Fork new JVMs for tests and set Java options for those
412-
fork := true,
413+
fork in Test := true,
413414

414415
javaOptions in Test += "-Dspark.test.home=" + sparkHome,
415416
javaOptions in Test += "-Dspark.testing=1",
@@ -437,7 +438,27 @@ object TestSettings {
437438
parallelExecution in Test := true,
438439
testForkedParallel in Test := false,
439440
concurrentRestrictions in Test += Tags.limit(Tags.ForkedTestGroup, 8),
441+
440442
testGrouping in Test <<= (definedTests in Test, javaOptions in Test) map groupBySuite,
443+
testGrouping in Test := {
444+
val original: Seq[Tests.Group] = (testGrouping in Test).value
445+
446+
original.map { group =>
447+
val forkOptions = ForkOptions(
448+
bootJars = Nil,
449+
javaHome = javaHome.value,
450+
connectInput = connectInput.value,
451+
outputStrategy = outputStrategy.value,
452+
runJVMOptions = javaOptions.value,
453+
// workingDirectory = Some(new File(System.getProperty("user.dir"))),
454+
workingDirectory = Some(baseDirectory.value),
455+
envVars = envVars.value
456+
)
457+
458+
group.copy(runPolicy = Tests.SubProcess(forkOptions))
459+
}
460+
},
461+
// testGrouping in Test <<= (definedTests in Test, javaOptions in Test) map groupBySuite,
441462
// testGrouping in Test <<= definedTests in Test map singleTests,
442463
// testGrouping in Test <<= (definedTests in Test, javaOptions in Test) map singleForkedTests,
443464
logBuffered in Test := true,

0 commit comments

Comments
 (0)