Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4065] improvement(test): Fix the path of integration log is wrong. #4029

Merged
merged 4 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ allprojects {
param.environment("jdbcBackend", jdbcDatabase)

val testMode = project.properties["testMode"] as? String ?: "embedded"
param.systemProperty("gravitino.log.path", project.buildDir.path + "/${project.name}-integration-test.log")
project.delete(project.buildDir.path + "/${project.name}-integration-test.log")
param.systemProperty("gravitino.log.path", "build/${project.name}-integration-test.log")
project.delete("build/${project.name}-integration-test.log")
if (testMode == "deploy") {
param.environment("GRAVITINO_HOME", project.rootDir.path + "/distribution/package")
param.systemProperty("testMode", "deploy")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L - %m%n

# Log files location
property.logPath = ${sys:gravitino.log.path:-catalog-hadoop/build/integration-test.log}
property.logPath = ${sys:gravitino.log.path:-build/catalog-hadoop-integration-test.log}

# File appender configuration
appender.file.type = File
Expand Down
2 changes: 1 addition & 1 deletion catalogs/catalog-hive/src/test/resources/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L - %m%n

# Log files location
property.logPath = ${sys:gravitino.log.path:-catalog-hive/build/hive-integration-test.log}
property.logPath = ${sys:gravitino.log.path:-build/catalog-hive-integration-test.log}

# File appender configuration
appender.file.type = File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L - %m%n

# Log files location
property.logPath = ${sys:gravitino.log.path:-catalog-jdbc-doris/build/doris-integration-test.log}
property.logPath = ${sys:gravitino.log.path:-build/catalog-jdbc-doris-integration-test.log}

# File appender configuration
appender.file.type = File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L - %m%n

# Log files location
property.logPath = ${sys:gravitino.log.path:-catalog-jdbc-mysql/build/mysql-integration-test.log}
property.logPath = ${sys:gravitino.log.path:-build/catalog-jdbc-mysql-integration-test.log}

# File appender configuration
appender.file.type = File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L - %m%n

# Log files location
property.logPath = ${sys:gravitino.log.path:-catalog-jdbc-postgresql/build/postgresql-integration-test.log}
property.logPath = ${sys:gravitino.log.path:-build/catalog-jdbc-postgresql-integration-test.log}

# File appender configuration
appender.file.type = File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L - %m%n

# Log files location
property.logPath = ${sys:gravitino.log.path:-catalog-messaging-kafka/build/kafka-integration-test.log}
property.logPath = ${sys:gravitino.log.path:-build/catalog-kafka-integration-test.log}

# File appender configuration
appender.file.type = File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L - %m%n

# Log files location
property.logPath = ${sys:gravitino.log.path:-catalog-lakehouse-iceberg/build/iceberg-integration-test.log}
property.logPath = ${sys:gravitino.log.path:-build/catalog-lakehouse-iceberg-integration-test.log}

# File appender configuration
appender.file.type = File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

# Log files location
property.logPath = ${sys:gravitino.log.path:-catalog-lakehouse-paimon/build/paimon-integration-test.log}
property.logPath = ${sys:gravitino.log.path:-build/catalog-lakehouse-paimon-integration-test.log}

# File appender configuration
appender.file.type = File
Expand Down
2 changes: 1 addition & 1 deletion integration-test/src/test/resources/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L - %m%n

# Log files location
property.logPath = ${sys:gravitino.log.path:-integration-test/build/integration-test.log}
property.logPath = ${sys:gravitino.log.path:-build/integration-test.log}

# File appender configuration
appender.file.type = File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@
package com.datastrato.gravitino.server;

import static com.datastrato.gravitino.Configs.ENTITY_KV_ROCKSDB_BACKEND_PATH;
import static com.datastrato.gravitino.Configs.ENTITY_RELATIONAL_JDBC_BACKEND_PATH;
import static org.junit.jupiter.api.Assertions.assertThrows;

import com.datastrato.gravitino.auxiliary.AuxiliaryServiceManager;
import com.datastrato.gravitino.rest.RESTUtils;
import com.datastrato.gravitino.server.web.JettyServerConfig;
import com.google.common.collect.ImmutableMap;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.UUID;
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
Expand Down Expand Up @@ -75,6 +79,19 @@ public void setUp() {
gravitinoServer = new GravitinoServer(spyServerConfig);
}

@AfterAll
public void clear() {
String path = spyServerConfig.get(ENTITY_RELATIONAL_JDBC_BACKEND_PATH);
if (path != null) {
Path p = Paths.get(path).getParent();
try {
FileUtils.deleteDirectory(p.toFile());
} catch (IOException e) {
// Ignore
}
}
}

@AfterEach
public void tearDown() {
if (gravitinoServer != null) {
Expand Down
Loading