From 3bcfbb144bb10bc579cb96d01b21455f660bca50 Mon Sep 17 00:00:00 2001 From: Gengliang Wang Date: Thu, 16 Jul 2020 22:54:07 +0800 Subject: [PATCH 1/5] show error only --- dev/run-tests.py | 2 ++ project/SparkBuild.scala | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/dev/run-tests.py b/dev/run-tests.py index 065a27c0e853b..3a5a8db4f0971 100755 --- a/dev/run-tests.py +++ b/dev/run-tests.py @@ -653,6 +653,8 @@ def main(): # If we're running the tests in Github Actions, attempt to detect and test # only the affected modules. if test_env == "github_actions": + # Set the log level as ERROR to make the github action more readable. + extra_profiles += "--error" if os.environ["GITHUB_BASE_REF"] != "": # Pull requests changed_files = identify_changed_files_from_git_commits( diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala index d19b514d662fa..628b89ea6d192 100644 --- a/project/SparkBuild.scala +++ b/project/SparkBuild.scala @@ -1027,6 +1027,10 @@ object TestSettings { }.getOrElse(Nil): _*), // Show full stack trace and duration in test cases. testOptions in Test += Tests.Argument("-oDF"), + // Show only the failed test cases in github action to make the log more readable. + testOptions in Test += Tests.Argument(sys.env.get("GITHUB_ACTIONS").map { _ => + Seq("-eNCXEHLOPQMDSF") + }.getOrElse(Seq(Nil)): _*), testOptions in Test += Tests.Argument(TestFrameworks.JUnit, "-v", "-a"), // Required to detect Junit tests for each project, see also https://github.com/sbt/junit-interface/issues/35 crossPaths := false, From 60db1af53ab3d8a6c20012755c3b749d78007baa Mon Sep 17 00:00:00 2001 From: Gengliang Wang Date: Thu, 16 Jul 2020 23:04:44 +0800 Subject: [PATCH 2/5] fix flag --- dev/run-tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/run-tests.py b/dev/run-tests.py index 3a5a8db4f0971..fd7848cefc81d 100755 --- a/dev/run-tests.py +++ b/dev/run-tests.py @@ -654,7 +654,7 @@ def main(): # only the affected modules. if test_env == "github_actions": # Set the log level as ERROR to make the github action more readable. - extra_profiles += "--error" + extra_profiles += ["--error"] if os.environ["GITHUB_BASE_REF"] != "": # Pull requests changed_files = identify_changed_files_from_git_commits( From 663e5a74995445d4b85984faa5e502258b3c1aa3 Mon Sep 17 00:00:00 2001 From: Gengliang Wang Date: Fri, 17 Jul 2020 00:09:00 +0800 Subject: [PATCH 3/5] fix --- dev/run-tests.py | 2 +- project/SparkBuild.scala | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dev/run-tests.py b/dev/run-tests.py index fd7848cefc81d..8da3bdd3d1cdd 100755 --- a/dev/run-tests.py +++ b/dev/run-tests.py @@ -654,7 +654,7 @@ def main(): # only the affected modules. if test_env == "github_actions": # Set the log level as ERROR to make the github action more readable. - extra_profiles += ["--error"] + extra_profiles.append("--error") if os.environ["GITHUB_BASE_REF"] != "": # Pull requests changed_files = identify_changed_files_from_git_commits( diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala index 628b89ea6d192..d1c1dbb23b6f0 100644 --- a/project/SparkBuild.scala +++ b/project/SparkBuild.scala @@ -1028,9 +1028,10 @@ object TestSettings { // Show full stack trace and duration in test cases. testOptions in Test += Tests.Argument("-oDF"), // Show only the failed test cases in github action to make the log more readable. - testOptions in Test += Tests.Argument(sys.env.get("GITHUB_ACTIONS").map { _ => - Seq("-eNCXEHLOPQMDSF") - }.getOrElse(Seq(Nil)): _*), + testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, + sys.env.get("GITHUB_ACTIONS").map { _ => + Seq("-eNCXEHLOPQMDSF") + }.getOrElse(Nil): _*), testOptions in Test += Tests.Argument(TestFrameworks.JUnit, "-v", "-a"), // Required to detect Junit tests for each project, see also https://github.com/sbt/junit-interface/issues/35 crossPaths := false, From 3590262dda8b3217b0283251223f8763cc747c0f Mon Sep 17 00:00:00 2001 From: Gengliang Wang Date: Fri, 17 Jul 2020 00:29:32 +0800 Subject: [PATCH 4/5] update comment --- dev/run-tests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dev/run-tests.py b/dev/run-tests.py index 8da3bdd3d1cdd..8e29f89c3a0d0 100755 --- a/dev/run-tests.py +++ b/dev/run-tests.py @@ -653,8 +653,9 @@ def main(): # If we're running the tests in Github Actions, attempt to detect and test # only the affected modules. if test_env == "github_actions": - # Set the log level as ERROR to make the github action more readable. - extra_profiles.append("--error") + # Set the log level of sbt as ERROR to make the output more readable. + if build_tool == "sbt": + extra_profiles.append("--error") if os.environ["GITHUB_BASE_REF"] != "": # Pull requests changed_files = identify_changed_files_from_git_commits( From 2d39b8e366573f8388aa49d77c9d100ccd94bcb1 Mon Sep 17 00:00:00 2001 From: Gengliang Wang Date: Fri, 17 Jul 2020 16:25:48 +0800 Subject: [PATCH 5/5] add comments and remove option 'S' --- project/SparkBuild.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala index d1c1dbb23b6f0..198405a1d29ca 100644 --- a/project/SparkBuild.scala +++ b/project/SparkBuild.scala @@ -1027,10 +1027,12 @@ object TestSettings { }.getOrElse(Nil): _*), // Show full stack trace and duration in test cases. testOptions in Test += Tests.Argument("-oDF"), - // Show only the failed test cases in github action to make the log more readable. + // Show only the failed test cases with full stack traces in github action to make the log more + // readable. + // Check https://www.scalatest.org/user_guide/using_the_runner for the details of options . testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, sys.env.get("GITHUB_ACTIONS").map { _ => - Seq("-eNCXEHLOPQMDSF") + Seq("-eNCXEHLOPQMDF") }.getOrElse(Nil): _*), testOptions in Test += Tests.Argument(TestFrameworks.JUnit, "-v", "-a"), // Required to detect Junit tests for each project, see also https://github.com/sbt/junit-interface/issues/35