yangxk1 commented on code in PR #824:
URL: https://github.com/apache/incubator-graphar/pull/824#discussion_r2680702167
##########
maven-projects/spark/graphar/src/test/scala/org/apache/graphar/BaseTestSuite.scala:
##########
@@ -29,10 +29,25 @@ abstract class BaseTestSuite extends AnyFunSuite with
BeforeAndAfterAll {
var spark: SparkSession = _
override def beforeAll(): Unit = {
- if (System.getenv("GAR_TEST_DATA") == null) {
- throw new IllegalArgumentException("GAR_TEST_DATA is not set")
+ def resolveTestData(): String = {
+ Option(System.getenv("GAR_TEST_DATA"))
+ .orElse(Option(System.getProperty("gar.test.data")))
+ .getOrElse {
+ val candidates = Seq("../../testing", "../testing", "testing")
+ candidates
+ .map(p => new java.io.File(p).getAbsoluteFile)
+ .find(d =>
+ new java.io.File(d, "ldbc_sample/csv/ldbc_sample.graph.yml")
+ .exists()
+ )
+ .map(_.getAbsolutePath)
+ .getOrElse(
+ throw new IllegalArgumentException("GAR_TEST_DATA not found")
Review Comment:
@shivendra-dev54, You can consider adopting this suggestion, it makes the
error message clearer
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]