You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2024/03/13 16:56:22 UTC
(spark) branch master updated: [SPARK-47378][PROTOBUF][TESTS] Make the related Protobuf UT run well in IDE
This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new b75325ccefa6 [SPARK-47378][PROTOBUF][TESTS] Make the related Protobuf UT run well in IDE
b75325ccefa6 is described below
commit b75325ccefa67b0c2daee317264808c67d76854f
Author: panbingkun <pa...@baidu.com>
AuthorDate: Wed Mar 13 09:56:13 2024 -0700
[SPARK-47378][PROTOBUF][TESTS] Make the related Protobuf UT run well in IDE
### What changes were proposed in this pull request?
The pr aims to make the related Protobuf `UT` run well in IDE (IntelliJ IDEA).
### Why are the changes needed?
Facilitate developers to debug the related Protobuf `UT`.
Before:
<img width="1279" alt="image" src="https://github.com/apache/spark/assets/15246973/c00781b2-3477-4b2c-b871-ead997fda697">
After:
<img width="884" alt="image" src="https://github.com/apache/spark/assets/15246973/665fc67d-c69e-45c7-b37d-bb4ef8e72930">
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
- Manually test.
- Pass GA.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #45498 from panbingkun/SPARK-47378.
Authored-by: panbingkun <pa...@baidu.com>
Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
.../test/scala/org/apache/spark/sql/protobuf/ProtobufTestBase.scala | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/connector/protobuf/src/test/scala/org/apache/spark/sql/protobuf/ProtobufTestBase.scala b/connector/protobuf/src/test/scala/org/apache/spark/sql/protobuf/ProtobufTestBase.scala
index e3add49f2b80..b53ba947216a 100644
--- a/connector/protobuf/src/test/scala/org/apache/spark/sql/protobuf/ProtobufTestBase.scala
+++ b/connector/protobuf/src/test/scala/org/apache/spark/sql/protobuf/ProtobufTestBase.scala
@@ -28,6 +28,9 @@ import org.apache.spark.sql.types.{DataType, StructType}
trait ProtobufTestBase extends SQLTestUtils {
+ private val descriptorDir = getWorkspaceFilePath(
+ "connector", "protobuf", "target", "generated-test-sources")
+
/**
* Returns path for a Protobuf descriptor file used in the tests. These files are generated
* during the build. Maven and SBT create the descriptor files differently. Maven creates one
@@ -35,7 +38,7 @@ trait ProtobufTestBase extends SQLTestUtils {
* all the Protobuf files. As a result actual file path returned in each case is different.
*/
protected def protobufDescriptorFile(fileName: String): String = {
- val dir = "target/generated-test-sources"
+ val dir = descriptorDir.toFile.getCanonicalPath
if (new File(s"$dir/$fileName").exists) {
s"$dir/$fileName"
} else { // sbt test
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org