Skip to content

Commit

Permalink
Merge pull request #1212 from alexarchambault/fix-it-check-windows-ci
Browse files Browse the repository at this point in the history
Fix IT result check on Windows
  • Loading branch information
alexarchambault authored Jul 17, 2023
2 parents 9bcc08f + fd289e3 commit 80f7750
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/scripts/run/run-its.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@ trap "jps -mlv" EXIT

if [ "$(expr substr $(uname -s) 1 5 2>/dev/null)" == "MINGW" ]; then
./mill -i show "scala.integration.test.testCommand" "almond.integration.KernelTestsTwoStepStartup212.*" > test-args-212.json
./mill -i show "scala.integration.test.testCommand" "almond.integration.KernelTestsTwoStepStartup213.*" > test-args-213.json
./mill -i show "scala.integration.test.testCommand" "almond.integration.KernelTestsTwoStepStartup3.*" > test-args-3.json

cat test-args-212.json
"$RUN_APP" test-args-212.json
checkResults

./mill -i show "scala.integration.test.testCommand" "almond.integration.KernelTestsTwoStepStartup213.*" > test-args-213.json
cat test-args-213.json
"$RUN_APP" test-args-213.json
checkResults

./mill -i show "scala.integration.test.testCommand" "almond.integration.KernelTestsTwoStepStartup3.*" > test-args-3.json
cat test-args-3.json
"$RUN_APP" test-args-3.json
checkResults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package almond.integration

import almond.testkit.Dsl._

import scala.util.Properties

class KernelTestsTwoStepStartup213 extends KernelTestsDefinitions {

lazy val kernelLauncher =
Expand Down Expand Up @@ -233,7 +235,10 @@ class KernelTestsTwoStepStartup213 extends KernelTestsDefinitions {
|}
|""".stripMargin

val directivesHandler = tmpDir / "handle-spark-directives"
val directivesHandler = {
val ext = if (Properties.isWin) ".bat" else ""
tmpDir / s"handle-spark-directives$ext"
}

os.write(tmpDir / "Handler.scala", handlerCode)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ object Dsl {
.map(s => if (trimReplyLines) s.trimLines else s)
if (Properties.isWin) {
expect(replies.length == Option(reply).toVector.length)
val obtainedReplyLines = replies.headOption.iterator.flatMap(_.linesIterator).toVector
val expectedReplyLines = Option(reply).iterator.flatMap(_.linesIterator).toVector
val obtainedReplyLines =
replies.headOption.iterator.flatMap(_.linesIterator).filter(_.nonEmpty).toVector
val expectedReplyLines =
Option(reply).iterator.flatMap(_.linesIterator).filter(_.nonEmpty).toVector
if (obtainedReplyLines != expectedReplyLines) {
pprint.err.log(obtainedReplyLines)
pprint.err.log(expectedReplyLines)
Expand Down
2 changes: 2 additions & 0 deletions project/settings.sc
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,8 @@ trait TestCommand extends TestModule {
else
forkArgs() -> Map()

os.remove(outputPath)

val testArgs = TestRunner.TestArgs(
framework = testFramework(),
classpath = runClasspath().map(_.path.toString()),
Expand Down

0 comments on commit 80f7750

Please sign in to comment.