Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed Sep 9, 2024
1 parent 7648445 commit b08e6a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ trait ScalaSql extends Common{ common =>
def testFramework = "scalasql.UtestFramework"

def forkArgs = Seq("-Duser.timezone=Asia/Singapore")
def forkEnv = Map("MILL_WORKSPACE_ROOT" -> T.workspace)
}

private def indent(code: Iterable[String]): String =
Expand Down
2 changes: 1 addition & 1 deletion docs/generateDocs.sc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def generateTutorial(sourcePath: os.Path, destPath: os.Path) = {
}
def generateReference(dest: os.Path, scalafmtCallback: (Seq[os.Path], os.Path) => Unit) = {
def dropExprPrefix(s: String) = s.split('.').drop(2).mkString(".")
val records = upickle.default.read[Seq[Record]](os.read.stream(os.pwd / "out" / "recordedTests.json"))
val records = upickle.default.read[Seq[Record]](os.read.stream(mill.api.WorkspaceRoot.workspaceRoot / "out" / "recordedTests.json"))
val suiteDescriptions = upickle.default.read[Map[String, String]](os.read.stream(os.pwd / "out" / "recordedSuiteDescriptions.json"))
.map{case (k, v) => (dropExprPrefix(k), v)}

Expand Down
5 changes: 3 additions & 2 deletions scalasql/test/src/UtestFramework.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ class UtestFramework extends utest.runner.Framework {
}
override def teardown() = {
println("Tearing down CustomFramework " + recordedTests.size)
val workspaceRoot = os.Path(sys.env("MILL_WORKSPACE_ROOT"))
os.write.over(
os.pwd / "out" / "recordedTests.json",
workspaceRoot / "out" / "recordedTests.json",
upickle.default.write(UtestFramework.recordedTests, indent = 4)
)
os.write.over(
os.pwd / "out" / "recordedSuiteDescriptions.json",
workspaceRoot / "out" / "recordedSuiteDescriptions.json",
upickle.default.write(UtestFramework.recordedSuiteDescriptions, indent = 4)
)
recordedTests.clear()
Expand Down

0 comments on commit b08e6a8

Please sign in to comment.