Skip to content

Commit 15e05be

Browse files
committed
Stabilize logging tests in compute by enabling logging for failsafe and adding explicit slf4j deps
1 parent 79fdd4c commit 15e05be

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

java-compute/google-cloud-compute/pom.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,40 @@
162162
</environmentVariables>
163163
</configuration>
164164
</plugin>
165+
<plugin>
166+
<groupId>org.apache.maven.plugins</groupId>
167+
<artifactId>maven-failsafe-plugin</artifactId>
168+
<configuration>
169+
<environmentVariables>
170+
<GOOGLE_SDK_JAVA_LOGGING>true</GOOGLE_SDK_JAVA_LOGGING>
171+
</environmentVariables>
172+
</configuration>
173+
</plugin>
165174
</plugins>
166175
</build>
176+
<profiles>
177+
<profile>
178+
<id>enable-integration-tests</id>
179+
<dependencies>
180+
<dependency>
181+
<groupId>org.slf4j</groupId>
182+
<artifactId>slf4j-api</artifactId>
183+
<version>2.0.16</version>
184+
<scope>test</scope>
185+
</dependency>
186+
<dependency>
187+
<groupId>ch.qos.logback</groupId>
188+
<artifactId>logback-classic</artifactId>
189+
<version>1.5.25</version>
190+
<scope>test</scope>
191+
</dependency>
192+
<dependency>
193+
<groupId>ch.qos.logback</groupId>
194+
<artifactId>logback-core</artifactId>
195+
<version>1.5.25</version>
196+
<scope>test</scope>
197+
</dependency>
198+
</dependencies>
199+
</profile>
200+
</profiles>
167201
</project>

java-compute/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public class ITComputeGoldenSignals extends BaseTest {
114114

115115
@Before
116116
public void setUp() throws Exception {
117+
logger.info("DEBUG: LoggingUtils.isLoggingEnabled() = " + com.google.api.gax.logging.LoggingUtils.isLoggingEnabled());
117118
rootSpanName = "ComputeRootSpan-" + generateRandomHexString(8);
118119
testRunId = generateRandomHexString(8);
119120

0 commit comments

Comments
 (0)