Skip to content

Commit f2aede6

Browse files
committed
-Yscala-release support: Improve caching artifacts downloaded for tests
1 parent e1f00c8 commit f2aede6

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

compiler/test/dotty/Properties.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ object Properties {
1515
val isRunByCI: Boolean = sys.env.isDefinedAt("DOTTY_CI_RUN")
1616
|| sys.env.isDefinedAt("DRONE") // TODO remove this when we drop Drone
1717

18+
val testCache: Path =
19+
sys.env.get("DOTTY_TEST_CACHE").map(Paths.get(_)).getOrElse {
20+
Paths.get(sys.props("user.home"), ".cache", "dotty", "test")
21+
}
22+
1823
/** Tests should run interactive? */
1924
val testsInteractive: Boolean = propIsNullOrTrue("dotty.tests.interactive")
2025

compiler/test/dotty/tools/vulpix/ParallelTesting.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,14 +1426,15 @@ object ParallelTesting {
14261426
dir
14271427
else
14281428
import scala.sys.process._
1429-
val zipPath = cache.resolve(s"scala3-$version.tar.gz")
1429+
val archivePath = cache.resolve(s"scala3-$version.tar.gz")
14301430
val compilerDownloadUrl = s"https://github.com/lampepfl/dotty/releases/download/$version/scala3-$version.tar.gz"
1431-
(URL(compilerDownloadUrl) #>> zipPath.toFile #&& s"tar -xf $zipPath -C $cache").!!
1431+
(URL(compilerDownloadUrl) #>> archivePath.toFile #&& s"tar -xf $archivePath -C $cache").!!
1432+
archivePath.toFile.delete()
14321433
dir
14331434
}
14341435

14351436
private lazy val cache =
1436-
val dir = Files.createTempDirectory("dotty.tests")
1437-
dir.toFile.deleteOnExit()
1437+
val dir = Properties.testCache.resolve("compilers")
1438+
dir.toFile.mkdirs()
14381439
dir
14391440
}

0 commit comments

Comments
 (0)