Skip to content

Commit

Permalink
Merge branch 'develop' into ps/test-cleanups
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle
  • Loading branch information
pshapiro4broad committed Jan 3, 2025
2 parents d178645 + 08bff1b commit 5ea7504
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 32 deletions.
50 changes: 23 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ plugins {
id 'com.github.ben-manes.versions' version '0.51.0'
id 'com.jfrog.artifactory' version '5.2.5'
id 'org.sonarqube' version '5.1.0.4882'
id 'io.spring.dependency-management' version '1.1.6'
id 'org.springframework.boot' version '3.3.3'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.springframework.boot' version '3.4.1'
id 'com.srcclr.gradle' version '3.1.12'
}

Expand All @@ -19,10 +19,6 @@ project.ext {
isCiServer = System.getenv().containsKey("CI")
}

// Spring Boot 3.2.3 pulls in opentelemetry-bom 1.31.0.
// We need >= 1.32.0 so that our HttpServerMetrics can use Meter.setExplicitBucketBoundariesAdvice:
ext['opentelemetry.version'] = '1.41.0'

// If true, search local repository (~/.m2/repository/) first for dependencies.
def useMavenLocal = false
repositories {
Expand Down Expand Up @@ -50,14 +46,15 @@ dependencies {

// Spring
implementation group: 'org.springframework.retry', name: 'spring-retry'
implementation group: 'org.springframework.boot', name: 'spring-boot-autoconfigure'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jdbc'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web'
annotationProcessor group: 'org.springframework.boot', name: 'spring-boot-configuration-processor'

// Misc. Services
implementation group: 'io.kubernetes', name: 'client-java', version: '20.0.1'
implementation group: 'io.kubernetes', name: 'client-java', version: '21.0.2'
constraints {
implementation('org.bouncycastle:bcprov-jdk18on:1.78.1') {
implementation('org.bouncycastle:bcprov-jdk18on:1.79') {
because 'https://broadworkbench.atlassian.net/browse/DCJ-275'
}
}
Expand All @@ -66,7 +63,7 @@ dependencies {

// Google dependencies
// use common bom
implementation platform('com.google.cloud:libraries-bom:26.45.0')
implementation platform('com.google.cloud:libraries-bom:26.52.0')
implementation group: 'com.google.cloud', name: 'google-cloud-core'
implementation group: 'com.google.cloud', name: 'google-cloud-pubsub'
api group: 'com.google.guava', name: 'guava'
Expand All @@ -76,38 +73,37 @@ dependencies {
runtimeOnly group: 'org.postgresql', name: 'postgresql'

// Terra libraries
implementation group: 'org.broadinstitute.dsde.workbench', name: 'sam-client_2.13', version: '0.1-0c4b377'
var stairwayVersion= '1.1.12-SNAPSHOT'
implementation group: 'org.broadinstitute.dsde.workbench', name: 'sam-client_2.13', version: 'v0.0.329'
var stairwayVersion= '1.1.17-SNAPSHOT'
api "bio.terra:stairway-gcp:${stairwayVersion}"
implementation "bio.terra:stairway-azure:${stairwayVersion}"

// Logging
implementation group: 'com.google.apis', name: 'google-api-services-logging', version: 'v2-rev20240503-2.0.0'
implementation group: 'com.google.apis', name: 'google-api-services-logging', version: 'v2-rev20241018-2.0.0'
implementation group: 'ch.qos.logback.contrib', name: 'logback-json-classic', version: '0.1.5'
implementation group: 'ch.qos.logback.contrib', name: 'logback-jackson', version: '0.1.5'

// OpenTelemetry BOMs (opentelemetry-bom versioned by Spring dependency manager)
implementation platform('io.opentelemetry:opentelemetry-bom-alpha:1.41.0-alpha')
implementation platform('io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:2.7.0')
implementation platform('io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:2.7.0-alpha')
// OpenTelemetry dependencies versioned by BOMs
// OpenTelemetry dependencies:
// Spring Boot 3.4.0 pulls in opentelemetry-bom 1.43.0.
// We choose opentelemetry-instrumentation-bom-alpha:2.9.0-alpha because otel-instrumentation 2.9.0 targets otel 1.43.0.
// When upgrading Spring Boot, re-check these versions.
implementation platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:2.9.0-alpha")
// ... versioned by Spring Boot
api 'io.opentelemetry:opentelemetry-api'
implementation 'io.opentelemetry:opentelemetry-sdk'
implementation 'io.opentelemetry:opentelemetry-sdk-metrics'
implementation 'io.opentelemetry:opentelemetry-exporter-logging'
implementation 'io.opentelemetry.instrumentation:opentelemetry-spring-webmvc-6.0'
implementation 'io.opentelemetry.instrumentation:opentelemetry-instrumentation-api'
implementation 'io.opentelemetry:opentelemetry-exporter-otlp'
implementation 'io.opentelemetry:opentelemetry-sdk-extension-autoconfigure'
// ... versioned by opentelemetry-instrumentation-bom-alpha
implementation 'io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations'
implementation 'io.opentelemetry.instrumentation:opentelemetry-instrumentation-api'
implementation 'io.opentelemetry.instrumentation:opentelemetry-spring-boot-autoconfigure'
implementation 'io.opentelemetry:opentelemetry-exporter-prometheus'
implementation 'io.opentelemetry.semconv:opentelemetry-semconv'
implementation 'io.opentelemetry:opentelemetry-api-incubator'
implementation 'io.opentelemetry:opentelemetry-sdk-extension-autoconfigure'
implementation 'io.opentelemetry:opentelemetry-exporter-otlp'
implementation 'org.springframework.boot:spring-boot-autoconfigure'
implementation 'io.opentelemetry:opentelemetry-exporter-prometheus'

// Google cloud open telemetry exporters
implementation 'com.google.cloud.opentelemetry:exporter-trace:0.31.0'
implementation 'com.google.cloud.opentelemetry:exporter-metrics:0.31.0'
implementation 'com.google.cloud.opentelemetry:exporter-trace:0.33.0'
implementation 'com.google.cloud.opentelemetry:exporter-metrics:0.33.0'

// Testing
testImplementation 'org.springframework:spring-aspects' // for tracing in tests
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = 'terra-common-lib'

gradle.ext.projectGroup = 'bio.terra'
gradle.ext.tclVersion = '1.1.19-SNAPSHOT'
gradle.ext.tclVersion = '1.1.27-SNAPSHOT'
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.boot.test.system.CapturedOutput;
import org.springframework.boot.test.system.OutputCaptureExtension;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.bean.override.mockito.MockitoSpyBean;

/**
* A test to verify that the human-readable-logging Spring Profile will disable the configuration of
Expand All @@ -32,7 +32,7 @@ class HumanReadableLoggingTest {

@Autowired private TestRestTemplate testRestTemplate;
// Spy bean to allow us to mock out the RequestIdFilter ID generator.
@SpyBean private RequestIdFilter requestIdFilter;
@MockitoSpyBean private RequestIdFilter requestIdFilter;

@BeforeEach
void setUp() {
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/bio/terra/common/logging/LoggingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.boot.test.system.CapturedOutput;
import org.springframework.boot.test.system.OutputCaptureExtension;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.bean.override.mockito.MockitoSpyBean;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;

/**
Expand Down Expand Up @@ -52,7 +52,7 @@ class LoggingTest {

@Autowired private TestRestTemplate testRestTemplate;
// Spy bean to allow us to mock out the RequestIdFilter ID generator.
@SpyBean private RequestIdFilter requestIdFilter;
@MockitoSpyBean private RequestIdFilter requestIdFilter;

@BeforeEach
public void setUp() {
Expand Down

0 comments on commit 5ea7504

Please sign in to comment.