diff --git a/core/src/test/scala/org/apache/spark/SparkThrowableSuite.scala b/core/src/test/scala/org/apache/spark/SparkThrowableSuite.scala index 1f3b28968025d..f41ad8fffd3e0 100644 --- a/core/src/test/scala/org/apache/spark/SparkThrowableSuite.scala +++ b/core/src/test/scala/org/apache/spark/SparkThrowableSuite.scala @@ -55,6 +55,9 @@ class SparkThrowableSuite extends SparkFunSuite { "core/testOnly *SparkThrowableSuite -- -t \"Error classes match with document\"" }}} */ + private val regenerateCommand = "SPARK_GENERATE_GOLDEN_FILES=1 build/sbt " + + "\"core/testOnly *SparkThrowableSuite -- -t \\\"Error classes match with document\\\"\"" + private val errorJsonFilePath = getWorkspaceFilePath( "common", "utils", "src", "main", "resources", "error", "error-classes.json") @@ -328,7 +331,8 @@ class SparkThrowableSuite extends SparkFunSuite { } } else { assert(subErrorDoc.trim == errorsInDoc.trim, - "The error class document is not up to date. Please regenerate it.") + "The error class document is not up to date. " + + s"Please regenerate it by running `$regenerateCommand`") } }) @@ -351,7 +355,8 @@ class SparkThrowableSuite extends SparkFunSuite { } } else { assert(sqlErrorParentDoc.trim == commonErrorsInDoc.trim, - "The error class document is not up to date. Please regenerate it.") + "The error class document is not up to date. " + + s"Please regenerate it by running `$regenerateCommand`") } val orphans = orphanedGoldenFiles() @@ -368,7 +373,8 @@ class SparkThrowableSuite extends SparkFunSuite { } } else { assert(orphans.isEmpty, - "Exist orphaned error class documents. Please regenerate it.") + "Exist orphaned error class documents. " + + s"Please regenerate it by running `$regenerateCommand`") } }