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

   ### What changes were proposed in this pull request?
   
   Add a `Test Base Classes` section to `AGENTS.md` that describes the layered 
Scala test base hierarchy and when to pick each one:
   
       SparkFunSuite                                                           
(core)
         <- PlanTest = SparkFunSuite + PlanTestBase                            
(sql/catalyst)
         <- QueryTest = SparkFunSuite + QueryTestBase + PlanTest               
(sql/core)
           <- SharedSparkSession = QueryTest + SharedSparkSessionBase          
(sql/core)
   
   The new section covers:
   - A decision table mapping test scope (plain JVM, Catalyst plans, DataFrame 
helpers, full SQL with session) to the right base.
   - That helper traits like `ParquetTest`, `OrcTest`, 
`FileBasedDataSourceTest`, `DDLCommandTestUtils` already extend `QueryTest` but 
do not provide a `SparkSession`, so they are typically combined with 
`SharedSparkSession`.
   - Common redundant-mixin patterns observed in the repo (e.g. `extends 
QueryTest with SharedSparkSession`, `extends QueryTest with ParquetTest`) and 
which combinations are NOT redundant.
   - A linearization gotcha: the first item in the `extends` clause must 
transitively extend `SparkFunSuite` (an abstract class). Pure helper traits 
like `*ErrorsBase` do not carry that chain, so putting one first breaks 
compilation.
   
   `CLAUDE.md` is a symlink to `AGENTS.md`, so this change is picked up by both 
AI agent toolchains.
   
   ### Why are the changes needed?
   
   Picking the wrong test base class or stacking redundant mixins is a common 
mistake when adding new Scala test suites. The information is currently spread 
across the source of `SparkFunSuite`, `PlanTest`, `QueryTest`, and 
`SharedSparkSession`, with no single place that summarizes when to use which or 
what combinations are redundant. Documenting it in `AGENTS.md` gives both 
contributors and AI coding agents a quick reference.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Documentation-only change to a developer/agent guide file.
   
   ### How was this patch tested?
   
   N/A. Documentation-only change; no code or tests are affected.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude 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: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to