From 247e85291fe8ed5faccfff54a64c989b55b94661 Mon Sep 17 00:00:00 2001 From: Xin Ren Date: Fri, 26 Aug 2016 23:09:31 -0700 Subject: [PATCH 1/3] [SPARK-17276] stop env params output on Jenkins job page --- .../test/scala/org/apache/spark/rdd/PipedRDDSuite.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala b/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala index 387f3e2502c51..1f9e6a8fc6585 100644 --- a/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala +++ b/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala @@ -214,7 +214,13 @@ class PipedRDDSuite extends SparkFunSuite with SharedSparkContext { } def testCommandAvailable(command: String): Boolean = { - val attempt = Try(Process(command).run().exitValue()) + val attempt = Try(Process(command).run( + new ProcessLogger { + override def out(s: => String): Unit = () + override def buffer[T](f: => T): T = f + override def err(s: => String): Unit = () + } + ).exitValue()) attempt.isSuccess && attempt.get == 0 } From b631901ea2d4d996d9491a2445ea11066bcd814b Mon Sep 17 00:00:00 2001 From: Xin Ren Date: Sat, 27 Aug 2016 09:55:03 -0700 Subject: [PATCH 2/3] [SPARK-17276] fix for sql.hive.execution.SQLQuerySuite --- .../spark/sql/hive/execution/SQLQuerySuite.scala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala index 4ca882f840a58..c63c26ae863a1 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala @@ -19,7 +19,7 @@ package org.apache.spark.sql.hive.execution import java.sql.{Date, Timestamp} -import scala.sys.process.Process +import scala.sys.process.{Process, ProcessLogger} import scala.util.Try import org.apache.hadoop.fs.Path @@ -1788,7 +1788,13 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils with TestHiveSingleton { } def testCommandAvailable(command: String): Boolean = { - val attempt = Try(Process(command).run().exitValue()) + val attempt = Try(Process(command).run( + new ProcessLogger { + override def out(s: => String): Unit = () + override def buffer[T](f: => T): T = f + override def err(s: => String): Unit = () + } + ).exitValue()) attempt.isSuccess && attempt.get == 0 } } From adf3d5bada9ef1e921ed4a07442797f0e7540fc5 Mon Sep 17 00:00:00 2001 From: Xin Ren Date: Sat, 27 Aug 2016 17:51:41 -0700 Subject: [PATCH 3/3] [SPARK-17276] even simpler way --- .../test/scala/org/apache/spark/rdd/PipedRDDSuite.scala | 8 +------- .../apache/spark/sql/hive/execution/SQLQuerySuite.scala | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala b/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala index 1f9e6a8fc6585..7293aa9a2584f 100644 --- a/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala +++ b/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala @@ -214,13 +214,7 @@ class PipedRDDSuite extends SparkFunSuite with SharedSparkContext { } def testCommandAvailable(command: String): Boolean = { - val attempt = Try(Process(command).run( - new ProcessLogger { - override def out(s: => String): Unit = () - override def buffer[T](f: => T): T = f - override def err(s: => String): Unit = () - } - ).exitValue()) + val attempt = Try(Process(command).run(ProcessLogger(_ => ())).exitValue()) attempt.isSuccess && attempt.get == 0 } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala index c63c26ae863a1..05d0687fb7e48 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala @@ -1788,13 +1788,7 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils with TestHiveSingleton { } def testCommandAvailable(command: String): Boolean = { - val attempt = Try(Process(command).run( - new ProcessLogger { - override def out(s: => String): Unit = () - override def buffer[T](f: => T): T = f - override def err(s: => String): Unit = () - } - ).exitValue()) + val attempt = Try(Process(command).run(ProcessLogger(_ => ())).exitValue()) attempt.isSuccess && attempt.get == 0 } }