Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#454] fix(IT): Integration test log path not set by default (#485)

Xun Liuc0dee2482043
diff --git a/integration-test/build.gradle.kts b/integration-test/build.gradle.kts
index e3e5691425..0d5ef1fcef 100644
--- a/integration-test/build.gradle.kts
+++ b/integration-test/build.gradle.kts
@@ -200,6 +200,7 @@ tasks.test {
environment("PROJECT_VERSION", version)
val testMode = project.properties["testMode"] as? String ?: "embedded"
+ systemProperty("graviton.log.path", buildDir.path)
if (testMode == "deploy") {
environment("GRAVITON_HOME", rootDir.path + "/distribution/package")
systemProperty("testMode", "deploy")
@@ -207,7 +208,6 @@ tasks.test {
environment("GRAVITON_HOME", rootDir.path)
environment("GRAVITON_TEST", "true")
systemProperty("testMode", "embedded")
- systemProperty("graviton.log.path", buildDir.path)
} else {
throw GradleException("Graviton integration test only support [-PtestMode=embedded] or [-PtestMode=deploy] mode!")
}
diff --git a/integration-test/src/test/java/com/datastrato/graviton/integration/test/util/AbstractIT.java b/integration-test/src/test/java/com/datastrato/graviton/integration/test/util/AbstractIT.java
index c3d922e297..70e059eecf 100644
--- a/integration-test/src/test/java/com/datastrato/graviton/integration/test/util/AbstractIT.java
+++ b/integration-test/src/test/java/com/datastrato/graviton/integration/test/util/AbstractIT.java
@@ -33,11 +33,13 @@ public class AbstractIT {
protected static Config serverConfig;
- static String testMode =
- System.getProperty(TEST_MODE) == null ? EMBEDDED_TEST_MODE : System.getProperty(TEST_MODE);
+ static String testMode = "";
@BeforeAll
public static void startIntegrationTest() throws Exception {
+ testMode =
+ System.getProperty(TEST_MODE) == null ? EMBEDDED_TEST_MODE : System.getProperty(TEST_MODE);
+
LOG.info("Running Graviton Server in {} mode", testMode);
serverConfig = new ServerConfig();
diff --git a/integration-test/src/test/resources/log4j2.properties b/integration-test/src/test/resources/log4j2.properties
index 5c643652fc..cdbfe9310c 100644
--- a/integration-test/src/test/resources/log4j2.properties
+++ b/integration-test/src/test/resources/log4j2.properties
@@ -21,7 +21,7 @@ property.basePath = ${sys:graviton.log.path}
# File appender configuration
appender.file.type = File
appender.file.name = fileLogger
-appender.file.fileName = ${basePath}/graviton-server.log
+appender.file.fileName = ${basePath}/integration-test.log
appender.file.layout.type = PatternLayout
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n