@@ -1890,7 +1890,7 @@ abstract class RunTestDefinitions(val scalaVersionOpt: Option[String])
1890
1890
val depScalaVersion = actualScalaVersion match {
1891
1891
case sv if sv.startsWith(" 2.12" ) => " 2.12"
1892
1892
case sv if sv.startsWith(" 2.13" ) => " 2.13"
1893
- case _ => " 3"
1893
+ case _ => " 3"
1894
1894
}
1895
1895
1896
1896
val dep = s " com.lihaoyi:os-lib_ $depScalaVersion:0.9.1 "
@@ -1919,14 +1919,14 @@ abstract class RunTestDefinitions(val scalaVersionOpt: Option[String])
1919
1919
val emptyCacheWalkSize = os.walk(cachePath).size
1920
1920
1921
1921
val noArtifactsRes = os.proc(
1922
- TestUtil .cli,
1923
- " --power" ,
1924
- " NoDeps.scala" ,
1925
- extraOptions,
1926
- " --offline" ,
1927
- " --cache" ,
1928
- cachePath.toString
1929
- )
1922
+ TestUtil .cli,
1923
+ " --power" ,
1924
+ " NoDeps.scala" ,
1925
+ extraOptions,
1926
+ " --offline" ,
1927
+ " --cache" ,
1928
+ cachePath.toString
1929
+ )
1930
1930
.call(cwd = root, check = false , mergeErrIntoOut = true )
1931
1931
expect(noArtifactsRes.exitCode == 1 )
1932
1932
@@ -1946,16 +1946,16 @@ abstract class RunTestDefinitions(val scalaVersionOpt: Option[String])
1946
1946
val scalaJvmCacheWalkSize = os.walk(cachePath).size
1947
1947
1948
1948
val scalaAndJvmRes = os.proc(
1949
- TestUtil .cli,
1950
- " --power" ,
1951
- " NoDeps.scala" ,
1952
- extraOptions,
1953
- " --offline" ,
1954
- " --cache" ,
1955
- cachePath.toString,
1956
- " -v" ,
1957
- " -v"
1958
- )
1949
+ TestUtil .cli,
1950
+ " --power" ,
1951
+ " NoDeps.scala" ,
1952
+ extraOptions,
1953
+ " --offline" ,
1954
+ " --cache" ,
1955
+ cachePath.toString,
1956
+ " -v" ,
1957
+ " -v"
1958
+ )
1959
1959
.call(cwd = root, mergeErrIntoOut = true )
1960
1960
expect(scalaAndJvmRes.exitCode == 0 )
1961
1961
expect(scalaAndJvmRes.out.trim().contains(
@@ -1967,21 +1967,29 @@ abstract class RunTestDefinitions(val scalaVersionOpt: Option[String])
1967
1967
expect(scalaJvmCacheWalkSize == os.walk(cachePath).size)
1968
1968
1969
1969
// Missing dependencies
1970
- val missingDepsRes = os.proc(
1970
+ for {
1971
+ (cliOption, extraEnvMode) <- Seq (
1972
+ " --offline" -> Map .empty[String , String ],
1973
+ " -Dcoursier.mode=offline" -> Map .empty[String , String ],
1974
+ " " -> Map (" COURSIER_MODE" -> " offline" )
1975
+ )
1976
+ } {
1977
+ val missingDepsRes = os.proc(
1971
1978
TestUtil .cli,
1972
1979
" --power" ,
1980
+ cliOption,
1973
1981
" WithDeps.scala" ,
1974
1982
extraOptions,
1975
- " --offline" ,
1976
1983
" --cache" ,
1977
1984
cachePath.toString
1978
1985
)
1979
- .call(cwd = root, check = false , mergeErrIntoOut = true )
1980
- expect(missingDepsRes.exitCode == 1 )
1981
- expect(missingDepsRes.out.trim().contains(" Error downloading com.lihaoyi:os-lib" ))
1986
+ .call(cwd = root, check = false , mergeErrIntoOut = true , env = extraEnvMode )
1987
+ expect(missingDepsRes.exitCode == 1 )
1988
+ expect(missingDepsRes.out.trim().contains(" Error downloading com.lihaoyi:os-lib" ))
1982
1989
1983
- // Cache unchanged
1984
- expect(scalaJvmCacheWalkSize == os.walk(cachePath).size)
1990
+ // Cache unchanged
1991
+ expect(scalaJvmCacheWalkSize == os.walk(cachePath).size)
1992
+ }
1985
1993
1986
1994
// Download dependencies
1987
1995
os.proc(TestUtil .cs, " fetch" , dep)
@@ -1990,16 +1998,16 @@ abstract class RunTestDefinitions(val scalaVersionOpt: Option[String])
1990
1998
val withDependencyCacheWalkSize = os.walk(cachePath).size
1991
1999
1992
2000
val depsRes = os.proc(
1993
- TestUtil .cli,
1994
- " --power" ,
1995
- " WithDeps.scala" ,
1996
- extraOptions,
1997
- " --offline" ,
1998
- " --cache" ,
1999
- cachePath.toString,
2000
- " -v" ,
2001
- " -v"
2002
- )
2001
+ TestUtil .cli,
2002
+ " --power" ,
2003
+ " WithDeps.scala" ,
2004
+ extraOptions,
2005
+ " --offline" ,
2006
+ " --cache" ,
2007
+ cachePath.toString,
2008
+ " -v" ,
2009
+ " -v"
2010
+ )
2003
2011
.call(cwd = root, mergeErrIntoOut = true )
2004
2012
expect(depsRes.exitCode == 0 )
2005
2013
expect(
0 commit comments