This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new 862dff4e4416 [SPARK-55497][BUILD][TESTS] Use `jupyterTestFramework`
instead of `TestFrameworks.JUnit`
862dff4e4416 is described below
commit 862dff4e4416a9abdbed669b2f2f9e42d757bfd1
Author: Kousuke Saruta <[email protected]>
AuthorDate: Fri Feb 13 10:14:21 2026 +0800
[SPARK-55497][BUILD][TESTS] Use `jupyterTestFramework` instead of
`TestFrameworks.JUnit`
This PR fixes an issue that `TestFrameworks.JUnit` is still used even
though newer jupiter plugin (`com.github.sbt.junit.sbt-jupiter-interface`) is
used.
As a result, `-Dtests.include.tags` and `-Dtests.exclude.tags` don't work.
```
$ build/sbt -Dtest.include.tags=org.apache.spark.tags.SlowHiveTest
unsafe/test
...
[info] Run completed in 2 seconds, 877 milliseconds.
[info] Total number of tests run: 0
[info] Suites: completed 2, aborted 0
[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
[info] No tests were executed.
[info] Passed: Total 97, Failed 0, Errors 0, Passed 97
```
Bug fix.
No.
Confirmed `-Dtests.exclude.tags` works.
```
$ build/sbt -Dtest.include.tags=org.apache.spark.tags.SlowHiveTest
unsafe/test
...
[info] Run completed in 738 milliseconds.
[info] Total number of tests run: 0
[info] Suites: completed 2, aborted 0
[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
[info] No tests were executed.
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0
[success] Total time: 2 s, completed 2026/02/12 19:33:53
```
There are no tagged `.java` tests so I didn't confirm if
`-Dtest.exclude.tags` works.
No.
Closes #54281 from sarutak/fix-jupiter-junit5.
Authored-by: Kousuke Saruta <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
(cherry picked from commit 448681f88fecf7ebf0c0127b40cc654ff946cd46)
Signed-off-by: Cheng Pan <[email protected]>
---
project/SparkBuild.scala | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala
index c484fef85161..9c2312ed2566 100644
--- a/project/SparkBuild.scala
+++ b/project/SparkBuild.scala
@@ -30,6 +30,7 @@ import sbt.Classpaths.publishOrSkip
import sbt.Keys._
import sbt.librarymanagement.{ VersionNumber, SemanticSelector }
import com.etsy.sbt.checkstyle.CheckstylePlugin.autoImport._
+import com.github.sbt.junit.jupiter.sbt.JupiterPlugin.autoImport._
import com.simplytyped.Antlr4Plugin._
import sbtpomreader.{PomBuild, SbtPomKeys}
import com.typesafe.tools.mima.plugin.MimaKeys
@@ -1701,25 +1702,25 @@ object TestSettings {
sys.props.get("test.default.exclude.tags").map(tags =>
tags.split(",").toSeq)
.map(tags =>
tags.filter(!_.trim.isEmpty)).getOrElse(defaultExcludedTags)
.flatMap(tag => Seq("-l", tag)): _*),
- (Test / testOptions) += Tests.Argument(TestFrameworks.JUnit,
+ (Test / testOptions) += Tests.Argument(jupiterTestFramework,
sys.props.get("test.exclude.tags").map { tags =>
- Seq("--exclude-categories=" + tags)
+ Seq("--exclude-tag=" + tags)
}.getOrElse(Nil): _*),
// Include tags defined in a system property
(Test / testOptions) += Tests.Argument(TestFrameworks.ScalaTest,
sys.props.get("test.include.tags").map { tags =>
tags.split(",").flatMap { tag => Seq("-n", tag) }.toSeq
}.getOrElse(Nil): _*),
- (Test / testOptions) += Tests.Argument(TestFrameworks.JUnit,
+ (Test / testOptions) += Tests.Argument(jupiterTestFramework,
sys.props.get("test.include.tags").map { tags =>
- Seq("--include-categories=" + tags)
+ Seq("--include-tags=" + tags)
}.getOrElse(Nil): _*),
// Show full stack trace and duration in test cases.
(Test / testOptions) += Tests.Argument("-oDF"),
// Slowpoke notifications: receive notifications every 5 minute of tests
that have been running
// longer than two minutes.
(Test / testOptions) += Tests.Argument(TestFrameworks.ScalaTest, "-W",
"120", "300"),
- (Test / testOptions) += Tests.Argument(TestFrameworks.JUnit, "-v", "-a"),
+ (Test / testOptions) += Tests.Argument(jupiterTestFramework, "-v", "-a"),
// Enable Junit testing.
libraryDependencies += "com.github.sbt.junit" % "jupiter-interface" %
"0.13.3" % "test",
// `parallelExecutionInTest` controls whether test suites belonging to the
same SBT project
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]