zhengruifeng commented on code in PR #55707: URL: https://github.com/apache/spark/pull/55707#discussion_r3199341378
########## AGENTS.md: ########## @@ -20,6 +20,41 @@ Spark Connect protocol is defined in proto files under `sql/connect/common/src/m Avoid introducing non-ASCII characters in code or comments. String literals may contain non-ASCII when the content requires it (error messages, test data, etc.). Identifiers are ASCII by convention. The common failure mode is typographic characters (em-dash, smart quotes, ellipsis, non-breaking space) sneaking into comments; scalastyle flags some of these. Spot-check before committing: `grep -rn -P "[^\x00-\x7F]" <files>`. +## Scala Test Base Classes + +When writing a new Scala test suite, pick the lowest base class that provides what the test actually needs. + +The actual test helpers live in style-agnostic traits that do not commit to a ScalaTest style: + + SparkTestSuite (core; thread audit, fixed timezone/locale, withTempDir, withLogAppender, checkError) + PlanTestBase (sql/catalyst; plan-comparison helpers — comparePlans, normalizePlan) + <- QueryTestBase (sql/core; adds SQL/DataFrame helpers + abstract `spark` via `SparkSessionProvider`) + <- SharedSparkSessionBase (sql/core; provides the actual `TestSparkSession`) Review Comment: Good point — agreed. Dropped the style-agnostic `*Base` chain (and the related `SparkTestSuite` row + linearization-gotcha example) in 65bb5e65e6f. The section now only documents the `SparkFunSuite` -> `PlanTest` -> `QueryTest` -> `SharedSparkSession` chain. -- 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]
