Skip to content

Commit db3b822

Browse files
committed
Fix spring test still running under test server when it shouldn't
1 parent 5af7560 commit db3b822

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Diff for: temporal-spring-boot-autoconfigure/src/test/java/io/temporal/spring/boot/autoconfigure/WorkerVersioningTest.java

+9-5
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@
3131
import io.temporal.common.WorkflowExecutionHistory;
3232
import io.temporal.spring.boot.autoconfigure.workerversioning.TestWorkflow;
3333
import io.temporal.spring.boot.autoconfigure.workerversioning.TestWorkflow2;
34-
import org.junit.jupiter.api.BeforeEach;
35-
import org.junit.jupiter.api.Test;
36-
import org.junit.jupiter.api.TestInstance;
37-
import org.junit.jupiter.api.Timeout;
34+
import org.junit.jupiter.api.*;
3835
import org.springframework.beans.factory.annotation.Autowired;
3936
import org.springframework.boot.test.context.SpringBootTest;
4037
import org.springframework.context.ConfigurableApplicationContext;
@@ -47,9 +44,16 @@
4744
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
4845
public class WorkerVersioningTest {
4946
@Autowired ConfigurableApplicationContext applicationContext;
50-
5147
@Autowired WorkflowClient workflowClient;
5248

49+
@BeforeAll
50+
static void checkDockerService() {
51+
String useDocker = System.getenv("USE_DOCKER_SERVICE");
52+
Assumptions.assumeTrue(
53+
useDocker != null && !useDocker.isEmpty(),
54+
"Skipping tests because USE_DOCKER_SERVICE is not set");
55+
}
56+
5357
@BeforeEach
5458
void setUp() {
5559
applicationContext.start();

0 commit comments

Comments
 (0)