@@ -1057,4 +1057,70 @@ abstract class PackageTestDefinitions(val scalaVersionOpt: Option[String])
1057
1057
expect(outputAssembly == root.toString)
1058
1058
}
1059
1059
}
1060
+
1061
+ if (actualScalaVersion.startsWith(" 2" )) {
1062
+ test(" resolution is kept for assemblies with provided spark deps (packaging.provided)" ) {
1063
+ val msg = " Hello"
1064
+ val inputPath = os.rel / " Hello.scala"
1065
+ TestInputs (
1066
+ inputPath ->
1067
+ s """ //> using lib org.apache.spark::spark-sql:3.3.2
1068
+ |//> using lib org.apache.spark::spark-hive:3.3.2
1069
+ |//> using lib org.apache.spark::spark-sql-kafka-0-10:3.3.2
1070
+ |//> using packaging.packageType assembly
1071
+ |//> using packaging.provided org.apache.spark::spark-sql
1072
+ |//> using packaging.provided org.apache.spark::spark-hive
1073
+ |
1074
+ |object Main extends App {
1075
+ | println(" $msg")
1076
+ |}
1077
+ | """ .stripMargin
1078
+ ).fromRoot { root =>
1079
+ val outputJarPath = root / " Hello.jar"
1080
+ val res = os.proc(
1081
+ TestUtil .cli,
1082
+ " --power" ,
1083
+ " package" ,
1084
+ inputPath,
1085
+ " -o" ,
1086
+ outputJarPath,
1087
+ extraOptions
1088
+ ).call(cwd = root, stderr = os.Pipe )
1089
+ expect(os.isFile(outputJarPath))
1090
+ expect(res.err.trim().contains(s " Wrote $outputJarPath" ))
1091
+ }
1092
+ }
1093
+
1094
+ test(
1095
+ " resolution is kept for assemblies with provided spark deps (packaging.packageType spark)"
1096
+ ) {
1097
+ val msg = " Hello"
1098
+ val inputPath = os.rel / " Hello.scala"
1099
+ TestInputs (
1100
+ inputPath ->
1101
+ s """ //> using lib org.apache.spark::spark-sql:3.3.2
1102
+ |//> using lib org.apache.spark::spark-hive:3.3.2
1103
+ |//> using lib org.apache.spark::spark-sql-kafka-0-10:3.3.2
1104
+ |//> using packaging.packageType spark
1105
+ |
1106
+ |object Main extends App {
1107
+ | println(" $msg")
1108
+ |}
1109
+ | """ .stripMargin
1110
+ ).fromRoot { root =>
1111
+ val outputJarPath = root / " Hello.jar"
1112
+ val res = os.proc(
1113
+ TestUtil .cli,
1114
+ " --power" ,
1115
+ " package" ,
1116
+ inputPath,
1117
+ " -o" ,
1118
+ outputJarPath,
1119
+ extraOptions
1120
+ ).call(cwd = root, stderr = os.Pipe )
1121
+ expect(os.isFile(outputJarPath))
1122
+ expect(res.err.trim().contains(s " Wrote $outputJarPath" ))
1123
+ }
1124
+ }
1125
+ }
1060
1126
}
0 commit comments