You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2026/05/06 13:03:13 UTC

[PR] [MINOR][TESTS] Unify workspace test helpers via SparkTestPaths trait [spark]

zhengruifeng opened a new pull request, #55710:
URL: https://github.com/apache/spark/pull/55710

   ### What changes were proposed in this pull request?
   
   Introduces `org.apache.spark.util.SparkTestPaths` in `common-utils` test sources, holding the two helpers that are currently duplicated across module boundaries:
   
   - `getWorkspaceFilePath(parts...)` — resolve a path relative to `spark.test.home` / `SPARK_HOME`.
   - `regenerateGoldenFiles` — env-var check for `SPARK_GENERATE_GOLDEN_FILES=1`.
   
   The trait is mixed into:
   - `SparkTestSuite` (core) — drops local copies of both helpers.
   - `ConnectFunSuite` (connect client) — drops the local `getWorkspaceFilePath` (which carried a `// Borrowed from SparkFunSuite` comment).
   - `LogKeysSuite` (common-utils) — drops local copies of both.
   
   Also removes the now-redundant `private val regenerateGoldenFiles` in `PlanGenerationTestSuite` (it would have shadowed/clashed with the inherited `protected def`).
   
   Living in `common-utils` is required because some consumers (`LogKeysSuite` in `common-utils`, `ConnectFunSuite` in the shaded Spark Connect client) cannot reach `SparkFunSuite` / `SparkTestSuite` in `spark-core` due to module dependency direction.
   
   ### Why are the changes needed?
   
   Cleanup. The two helpers are byte-for-byte identical at three call sites (four counting the `regenerateGoldenFiles` clone), and the connect copy explicitly comments that it was borrowed from `SparkFunSuite`. Consolidating prevents drift.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Test-only refactor.
   
   ### How was this patch tested?
   
   `build/sbt common-utils/Test/compile core/Test/compile connect-client-jvm/Test/compile sql/Test/compile` succeeds. No behavior change.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.7)


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [MINOR][TESTS] Extract TestEnvHelper trait from SparkTestSuite [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #55710: [MINOR][TESTS] Extract TestEnvHelper trait from SparkTestSuite
URL: https://github.com/apache/spark/pull/55710


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org