@@ -55,6 +55,9 @@ dependencies {
5555tasks {
5656 test {
5757 useJUnitPlatform()
58+ // Unset relevant environment variables to provide a clean state for the tests
59+ environment(" GOOGLE_CLOUD_PROJECT" , " " )
60+ environment(" GOOGLE_CLOUD_QUOTA_PROJECT" , " " )
5861 // exclude integration test
5962 exclude(" io/opentelemetry/contrib/gcp/auth/GcpAuthExtensionEndToEndTest.class" )
6063 }
@@ -127,34 +130,7 @@ tasks.register<Test>("IntegrationTestUserCreds") {
127130 " -Dotel.metrics.exporter=none" ,
128131 " -Dotel.logs.exporter=none" ,
129132 " -Dotel.exporter.otlp.protocol=http/protobuf" ,
130- " -Dmockserver.logLevel=off"
131- )
132- }
133-
134- tasks.register<Test >(" IntegrationTestServiceAccountCreds" ) {
135- dependsOn(tasks.shadowJar)
136- dependsOn(tasks.named(" copyAgent" ))
137-
138- useJUnitPlatform()
139- // include only the integration test file
140- include(" io/opentelemetry/contrib/gcp/auth/GcpAuthExtensionEndToEndTest.class" )
141-
142- val fakeCredsFilePath = project.file(" src/test/resources/fake_service_account_creds.json" ).absolutePath
143-
144- environment(" GOOGLE_CLOUD_QUOTA_PROJECT" , " quota-project-id" )
145- environment(" GOOGLE_APPLICATION_CREDENTIALS" , fakeCredsFilePath)
146- jvmArgs = listOf (
147- " -javaagent:$javaAgentJarPath " ,
148- " -Dotel.javaagent.extensions=$authExtensionJarPath " ,
149- " -Dgoogle.cloud.project=my-gcp-project" ,
150- " -Dotel.java.global-autoconfigure.enabled=true" ,
151- " -Dotel.exporter.otlp.endpoint=http://localhost:4318" ,
152- " -Dotel.resource.providers.gcp.enabled=true" ,
153- " -Dotel.traces.exporter=otlp" ,
154- " -Dotel.bsp.schedule.delay=2000" ,
155- " -Dotel.metrics.exporter=none" ,
156- " -Dotel.logs.exporter=none" ,
157- " -Dotel.exporter.otlp.protocol=http/protobuf" ,
158- " -Dmockserver.logLevel=off"
133+ " -Dotel.javaagent.debug=false" ,
134+ " -Dmockserver.logLevel=trace"
159135 )
160136}
0 commit comments