This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-4.1 by this push:
     new 68cdbfec3048 [SPARK-55497][BUILD][TESTS] Use `jupyterTestFramework` 
instead of `TestFrameworks.JUnit`
68cdbfec3048 is described below

commit 68cdbfec3048bf935af2de66f64fdbc947f490ad
Author: Kousuke Saruta <[email protected]>
AuthorDate: Fri Feb 13 10:14:21 2026 +0800

    [SPARK-55497][BUILD][TESTS] Use `jupyterTestFramework` instead of 
`TestFrameworks.JUnit`
    
    ### What changes were proposed in this pull request?
    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
    ```
    
    ### Why are the changes needed?
    Bug fix.
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    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.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    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 6c37944fb48a..bb505d390e5e 100644
--- a/project/SparkBuild.scala
+++ b/project/SparkBuild.scala
@@ -31,6 +31,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.here.bom.Bom
 import com.simplytyped.Antlr4Plugin._
 import sbtpomreader.{PomBuild, SbtPomKeys}
@@ -1902,25 +1903,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.17.0" % "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]

Reply via email to