Skip to content
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession {

// When we are regenerating the golden files, we don't need to set any config as they
// all need to return the same result
if (regenerateGoldenFiles || !isTestWithConfigSets) {
if ((regenerateGoldenFiles && importedTestCaseName.isEmpty) || !isTestWithConfigSets) {
Copy link
Contributor

@cloud-fan cloud-fan Nov 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah seems we have 2 different kinds of settings now:

  1. settings that shouldn't change result. We want to generate the golden files without the settings and run tests with settings.
  2. setting that can change result.

The second one is pretty useful with --import. We want to run the same queries with different settings and save the answers.

Shall we have different directives for them? @maropu

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a second thought, we only expect the --SET to change behavior if we import queries. So the change here LGTM.

@yaooqinn can you update the comment to explain it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW now --SET is upper case and --import is lower case. Seems better to always use upper case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also cc @wangyum , why do we need isTestWithConfigSets for thriftserver tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will update the comments and change case for --import

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cloud-fan To reduce the test time. The mvn test often timed out at that time: https://amplab.cs.berkeley.edu/jenkins/job/spark-master-test-maven-hadoop-2.7/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mean setting config is expensive?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will run configSets times:

configSets.foreach { configSet =>
try {
runQueries(queries, testCase, Some(configSet))
} catch {
case e: Throwable =>
val configs = configSet.map {
case (k, v) => s"$k=$v"
}
logError(s"Error using configs: ${configs.mkString(",")}")
throw e
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah that's a problem. We should think about how to reduce test time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I'm late. The change looks reasonable...

runQueries(queries, testCase, None)
} else {
val configSets = {
Expand Down