From bf25c9b4dfc75a7c5b11ce3f730e1bdb3642a046 Mon Sep 17 00:00:00 2001 From: Jingsi Lu Date: Wed, 6 Mar 2024 16:40:28 -0500 Subject: [PATCH] feat: 1651 web validator retries with bad zip file 2 (#1686) * setup spring cloud gcp logging * ignore annoying tests * updated logback * modified dependencies * rename the stack driver log package name * revert: deploy to master * Detect when the Spring context is deployed in the cloud vs local. In the cloud, use the CONSOLE_JSON appended, and in local STDOUT * removed useless code * formatted code --------- Co-authored-by: David Gamez Diaz <1192523+davidgamez@users.noreply.github.com> --- web/service/build.gradle | 3 +- web/service/src/main/resources/logback.xml | 38 ++++++++++++++----- .../web/service/util/StorageHelperTest.java | 1 + 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/web/service/build.gradle b/web/service/build.gradle index 2484182fb2..b81b4e88cb 100644 --- a/web/service/build.gradle +++ b/web/service/build.gradle @@ -64,13 +64,14 @@ dependencies { implementation 'org.projectlombok:lombok:1.18.22' implementation 'io.sentry:sentry-spring-boot-starter:6.18.1' implementation 'io.sentry:sentry-logback:6.18.1' + implementation 'com.google.cloud:spring-cloud-gcp-starter-logging:3.7.9' + testImplementation 'org.springframework.boot:spring-boot-starter-test' } dependencyManagement { imports { mavenBom "com.google.cloud:spring-cloud-gcp-dependencies:${springCloudGcpVersion}" - mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" } } diff --git a/web/service/src/main/resources/logback.xml b/web/service/src/main/resources/logback.xml index 7d900d8ea8..209422a0a4 100644 --- a/web/service/src/main/resources/logback.xml +++ b/web/service/src/main/resources/logback.xml @@ -1,13 +1,33 @@ - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - + - - - + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + + true + true + true + true + true + true + + + + + + + \ No newline at end of file diff --git a/web/service/src/test/java/org/mobilitydata/gtfsvalidator/web/service/util/StorageHelperTest.java b/web/service/src/test/java/org/mobilitydata/gtfsvalidator/web/service/util/StorageHelperTest.java index d3dd5727fb..b4058d198d 100644 --- a/web/service/src/test/java/org/mobilitydata/gtfsvalidator/web/service/util/StorageHelperTest.java +++ b/web/service/src/test/java/org/mobilitydata/gtfsvalidator/web/service/util/StorageHelperTest.java @@ -2,6 +2,7 @@ import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; import com.fasterxml.jackson.databind.ObjectMapper;