voonhous commented on code in PR #19932:
URL: https://github.com/apache/hudi/pull/19932#discussion_r4692733259


##########
.github/workflows/bot.yml:
##########
@@ -1092,6 +1092,15 @@ jobs:
           SPARK_MODULES: ${{ matrix.sparkModules }}
         run:
           mvn test -Pfunctional-tests-b -Pjava17 -D"$SCALA_PROFILE" 
-D"$SPARK_PROFILE" -pl "$SPARK_COMMON_MODULES,$SPARK_MODULES" $MVN_ARGS 
-Djacoco.skip=false
+      # The suites of scala-other-2's packages that build their own 
SparkContext (about two
+      # minutes). The shared-session suites of the same packages run in 
scala-other-2.
+      - name: Scala UT - remaining packages, own SparkContext
+        env:
+          SCALA_PROFILE: ${{ matrix.scalaProfile }}
+          SPARK_PROFILE: ${{ matrix.sparkProfile }}
+          SPARK_MODULES: ${{ matrix.sparkModules }}
+        run:
+          mvn test -Punit-tests -Pjava17 -D"$SCALA_PROFILE" -D"$SPARK_PROFILE" 
-Dtest=skipJavaTests $SCALA_TEST_OTHERS2_FILTER 
-Dsurefire.failIfNoSpecifiedTests=false -pl 
"hudi-common,$SPARK_COMMON_MODULES,$SPARK_MODULES" $MVN_ARGS 
-Djacoco.skip=false 
-Dhudi.scalatest.tagsToExclude=org.apache.hudi.functional.SparkSQLCoreFlow,org.apache.spark.sql.hudi.common.SharedSessionSuite

Review Comment:
   Okay done, FWIU, each command starts a fresh Maven JVM, reads the poms of 
the -pl modules (i.e. the reactor), resolves the dependencies... Enforcer also 
checks if everything is up to date.
   
   Even though build step already compiled everything, they still run.
   
   ```
   mvn test -Pfunctional-tests-b ...        (Java FTB)
     setup: JVM, reactor, hudi-spark-common + hudi-spark lifecycle   <- ~36s
     test phase: surefire runs functional-b Java tests
                 scalatest SKIPPED (profile sets skipUTs=true)
   
   mvn test -Punit-tests -Dtest=skipJavaTests ...   (Scala UT)
     setup: same JVM, reactor, same modules, same lifecycle again    <- ~36s 
again
     test phase: surefire runs nothing (-Dtest=skipJavaTests)
                 scalatest runs the own-SparkContext suites
   ```
   
   By merging them:
   ```
   mvn test -Pfunctional-tests-b -DskipUTs=false $SCALA_TEST_OTHERS2_FILTER 
-Dhudi.scalatest.tagsToExclude=...
       setup: once
       test phase per module: surefire runs functional-b Java tests,
                              then scalatest runs the own-SparkContext suites
   ```
   
   So theoretically, we spending time that we really don't have to. 
   
   Since Surefire and ScalaTest are bound to the same test phase of the same 
modules, from the command above:
   
   **command 1: Java FTB** (`-Pfunctional-tests-b`) uses surefire, and turns 
off ScalaTest.
   
   **command 2: Scala UT** (`-Punit-tests -Dtest=skipJavaTests 
-Dsurefire.failIfNoSpecifiedTests=false`) uses ScalaTest, turns off surefire.
   
   With the merged command suggested above (`-Pfunctional-tests-b 
-DskipUTs=false ...`)
   Surefire: unchanged from command 1. It still reads `skipFTs=false` and 
`groups=functional-b`, so the same Java tests run.
   ScalaTest: `-DskipUTs=false` overrides the profile's true, so it runs with 
the same filter and excludes as command 2.
   
   
   So, since -pl reactors are the same, we can merge them and they achieve the 
same thing while only paying for checks once. 
   
   Very good catch!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to