Skip to content

Commit

Permalink
[#2839] improvment(CI): add log of testcontainers (#2843)
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

Separate TestContainers logs into a different log file.

### Why are the changes needed?

Fix: #2839 

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

by hand
  • Loading branch information
mchades authored Apr 9, 2024
1 parent e3bd645 commit 21b8adf
Show file tree
Hide file tree
Showing 9 changed files with 187 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backend-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
name: integrate-test-reports-${{ matrix.java-version }}-${{ matrix.test-mode }}-${{ matrix.backend }}
path: |
build/reports
integration-test/build/integration-test-integration-test.log
integration-test/build/*.log
integration-test/build/*.tar
distribution/package/logs/gravitino-server.out
distribution/package/logs/gravitino-server.log
Expand Down
28 changes: 27 additions & 1 deletion catalogs/catalog-hadoop/src/test/resources/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,37 @@ appender.file.type = File
appender.file.name = fileLogger
appender.file.fileName = ${logPath}
appender.file.layout.type = PatternLayout
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c - %m%n

# Root logger level
rootLogger.level = info

# Root logger referring to console and file appenders
rootLogger.appenderRef.stdout.ref = consoleLogger
rootLogger.appenderRef.file.ref = fileLogger

# File appender configuration for testcontainers
appender.testcontainersFile.type = File
appender.testcontainersFile.name = testcontainersLogger
appender.testcontainersFile.fileName = build/testcontainers.log
appender.testcontainersFile.layout.type = PatternLayout
appender.testcontainersFile.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c - %m%n

# Logger for testcontainers
logger.testcontainers.name = org.testcontainers
logger.testcontainers.level = debug
logger.testcontainers.additivity = false
logger.testcontainers.appenderRef.file.ref = testcontainersLogger

logger.tc.name = tc
logger.tc.level = debug
logger.tc.additivity = false
logger.tc.appenderRef.file.ref = testcontainersLogger

logger.docker.name = com.github.dockerjava
logger.docker.level = warn
logger.docker.additivity = false
logger.docker.appenderRef.file.ref = testcontainersLogger

logger.http.name = com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire
logger.http.level = off
28 changes: 27 additions & 1 deletion catalogs/catalog-hive/src/test/resources/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,37 @@ appender.file.type = File
appender.file.name = fileLogger
appender.file.fileName = ${logPath}
appender.file.layout.type = PatternLayout
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c - %m%n

# Root logger level
rootLogger.level = info

# Root logger referring to console and file appenders
rootLogger.appenderRef.stdout.ref = consoleLogger
rootLogger.appenderRef.file.ref = fileLogger

# File appender configuration for testcontainers
appender.testcontainersFile.type = File
appender.testcontainersFile.name = testcontainersLogger
appender.testcontainersFile.fileName = build/testcontainers.log
appender.testcontainersFile.layout.type = PatternLayout
appender.testcontainersFile.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c - %m%n

# Logger for testcontainers
logger.testcontainers.name = org.testcontainers
logger.testcontainers.level = debug
logger.testcontainers.additivity = false
logger.testcontainers.appenderRef.file.ref = testcontainersLogger

logger.tc.name = tc
logger.tc.level = debug
logger.tc.additivity = false
logger.tc.appenderRef.file.ref = testcontainersLogger

logger.docker.name = com.github.dockerjava
logger.docker.level = warn
logger.docker.additivity = false
logger.docker.appenderRef.file.ref = testcontainersLogger

logger.http.name = com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire
logger.http.level = off
28 changes: 27 additions & 1 deletion catalogs/catalog-jdbc-doris/src/test/resources/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,37 @@ appender.file.type = File
appender.file.name = fileLogger
appender.file.fileName = ${logPath}
appender.file.layout.type = PatternLayout
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c - %m%n

# Root logger level
rootLogger.level = info

# Root logger referring to console and file appenders
rootLogger.appenderRef.stdout.ref = consoleLogger
rootLogger.appenderRef.file.ref = fileLogger

# File appender configuration for testcontainers
appender.testcontainersFile.type = File
appender.testcontainersFile.name = testcontainersLogger
appender.testcontainersFile.fileName = build/testcontainers.log
appender.testcontainersFile.layout.type = PatternLayout
appender.testcontainersFile.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c - %m%n

# Logger for testcontainers
logger.testcontainers.name = org.testcontainers
logger.testcontainers.level = debug
logger.testcontainers.additivity = false
logger.testcontainers.appenderRef.file.ref = testcontainersLogger

logger.tc.name = tc
logger.tc.level = debug
logger.tc.additivity = false
logger.tc.appenderRef.file.ref = testcontainersLogger

logger.docker.name = com.github.dockerjava
logger.docker.level = warn
logger.docker.additivity = false
logger.docker.appenderRef.file.ref = testcontainersLogger

logger.http.name = com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire
logger.http.level = off
23 changes: 23 additions & 0 deletions catalogs/catalog-jdbc-mysql/src/test/resources/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,26 @@ rootLogger.level = info
# Root logger referring to console and file appenders
rootLogger.appenderRef.stdout.ref = consoleLogger
rootLogger.appenderRef.file.ref = fileLogger

# File appender configuration for testcontainers
appender.testcontainersFile.type = File
appender.testcontainersFile.name = testcontainersLogger
appender.testcontainersFile.fileName = build/testcontainers.log
appender.testcontainersFile.layout.type = PatternLayout
appender.testcontainersFile.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c - %m%n

# Logger for testcontainers
logger.testcontainers.name = org.testcontainers
logger.testcontainers.level = debug
logger.testcontainers.appenderRef.file.ref = testcontainersLogger

logger.tc.name = tc
logger.tc.level = debug
logger.tc.appenderRef.file.ref = testcontainersLogger

logger.docker.name = com.github.dockerjava
logger.docker.level = warn
logger.docker.appenderRef.file.ref = testcontainersLogger

logger.http.name = com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire
logger.http.level = off
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,37 @@ appender.file.type = File
appender.file.name = fileLogger
appender.file.fileName = ${logPath}
appender.file.layout.type = PatternLayout
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c - %m%n

# Root logger level
rootLogger.level = info

# Root logger referring to console and file appenders
rootLogger.appenderRef.stdout.ref = consoleLogger
rootLogger.appenderRef.file.ref = fileLogger

# File appender configuration for testcontainers
appender.testcontainersFile.type = File
appender.testcontainersFile.name = testcontainersLogger
appender.testcontainersFile.fileName = build/testcontainers.log
appender.testcontainersFile.layout.type = PatternLayout
appender.testcontainersFile.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c - %m%n

# Logger for testcontainers
logger.testcontainers.name = org.testcontainers
logger.testcontainers.level = debug
logger.testcontainers.additivity = false
logger.testcontainers.appenderRef.file.ref = testcontainersLogger

logger.tc.name = tc
logger.tc.level = debug
logger.tc.additivity = false
logger.tc.appenderRef.file.ref = testcontainersLogger

logger.docker.name = com.github.dockerjava
logger.docker.level = warn
logger.docker.additivity = false
logger.docker.appenderRef.file.ref = testcontainersLogger

logger.http.name = com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire
logger.http.level = off
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,37 @@ appender.file.type = File
appender.file.name = fileLogger
appender.file.fileName = ${logPath}
appender.file.layout.type = PatternLayout
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c - %m%n

# Root logger level
rootLogger.level = info

# Root logger referring to console and file appenders
rootLogger.appenderRef.stdout.ref = consoleLogger
rootLogger.appenderRef.file.ref = fileLogger

# File appender configuration for testcontainers
appender.testcontainersFile.type = File
appender.testcontainersFile.name = testcontainersLogger
appender.testcontainersFile.fileName = build/testcontainers.log
appender.testcontainersFile.layout.type = PatternLayout
appender.testcontainersFile.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c - %m%n

# Logger for testcontainers
logger.testcontainers.name = org.testcontainers
logger.testcontainers.level = debug
logger.testcontainers.additivity = false
logger.testcontainers.appenderRef.file.ref = testcontainersLogger

logger.tc.name = tc
logger.tc.level = debug
logger.tc.additivity = false
logger.tc.appenderRef.file.ref = testcontainersLogger

logger.docker.name = com.github.dockerjava
logger.docker.level = warn
logger.docker.additivity = false
logger.docker.appenderRef.file.ref = testcontainersLogger

logger.http.name = com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire
logger.http.level = off
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public static void startIntegrationTest() throws Exception {

@AfterAll
public static void stopIntegrationTest() throws IOException, InterruptedException {
if (testMode != null && testMode.equals(ITUtils.EMBEDDED_TEST_MODE)) {
if (testMode != null && testMode.equals(ITUtils.EMBEDDED_TEST_MODE) && miniGravitino != null) {
miniGravitino.stop();
} else {
GravitinoITUtils.stopGravitinoServer();
Expand Down
28 changes: 27 additions & 1 deletion integration-test/src/test/resources/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,37 @@ appender.file.type = File
appender.file.name = fileLogger
appender.file.fileName = ${logPath}
appender.file.layout.type = PatternLayout
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c - %m%n

# Root logger level
rootLogger.level = info

# Root logger referring to console and file appenders
rootLogger.appenderRef.stdout.ref = consoleLogger
rootLogger.appenderRef.file.ref = fileLogger

# File appender configuration for testcontainers
appender.testcontainersFile.type = File
appender.testcontainersFile.name = testcontainersLogger
appender.testcontainersFile.fileName = build/testcontainers.log
appender.testcontainersFile.layout.type = PatternLayout
appender.testcontainersFile.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c - %m%n

# Logger for testcontainers
logger.testcontainers.name = org.testcontainers
logger.testcontainers.level = debug
logger.testcontainers.additivity = false
logger.testcontainers.appenderRef.file.ref = testcontainersLogger

logger.tc.name = tc
logger.tc.level = debug
logger.tc.additivity = false
logger.tc.appenderRef.file.ref = testcontainersLogger

logger.docker.name = com.github.dockerjava
logger.docker.level = warn
logger.docker.additivity = false
logger.docker.appenderRef.file.ref = testcontainersLogger

logger.http.name = com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire
logger.http.level = off

0 comments on commit 21b8adf

Please sign in to comment.