Skip to content

Commit b3d2c94

Browse files
committed
disable auto-worker start for WorkerVersioningTest
1 parent a7ea32c commit b3d2c94

File tree

2 files changed

+9
-32
lines changed

2 files changed

+9
-32
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ jobs:
3939
env:
4040
USER: unittest
4141
USE_DOCKER_SERVICE: false
42-
run: |
43-
echo "USER: $USER"
44-
echo "USE_DOCKER_SERVICE: $USE_DOCKER_SERVICE"
45-
./gradlew --no-daemon temporal-sdk:testResourceIndependent -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest
42+
run: ./gradlew --no-daemon temporal-sdk:testResourceIndependent -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest
4643

4744
- name: Publish Test Report
4845
uses: mikepenz/action-junit-report@v5

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

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@
1111
import io.temporal.common.WorkflowExecutionHistory;
1212
import io.temporal.spring.boot.autoconfigure.workerversioning.TestWorkflow;
1313
import io.temporal.spring.boot.autoconfigure.workerversioning.TestWorkflow2;
14-
import org.junit.jupiter.api.Assumptions;
15-
import org.junit.jupiter.api.BeforeAll;
16-
import org.junit.jupiter.api.Test;
17-
import org.junit.jupiter.api.TestInstance;
18-
import org.junit.jupiter.api.Timeout;
19-
import org.slf4j.Logger;
20-
import org.slf4j.LoggerFactory;
14+
import org.junit.jupiter.api.*;
2115
import org.springframework.beans.factory.annotation.Autowired;
2216
import org.springframework.boot.test.context.SpringBootTest;
2317
import org.springframework.context.ConfigurableApplicationContext;
@@ -26,40 +20,29 @@
2620
import org.springframework.test.context.ActiveProfiles;
2721

2822
@SpringBootTest(classes = WorkerVersioningTest.Configuration.class)
29-
@ActiveProfiles(profiles = "worker-versioning")
23+
@ActiveProfiles(profiles = {"worker-versioning", "disable-start-workers"})
3024
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
3125
public class WorkerVersioningTest {
3226
@Autowired ConfigurableApplicationContext applicationContext;
3327
@Autowired WorkflowClient workflowClient;
3428

35-
private static final Logger log = LoggerFactory.getLogger("worker-versioning");
36-
3729
@BeforeAll
38-
void checkDockerServiceAndNamespace() {
30+
static void checkDockerService() {
3931
String useDocker = System.getenv("USE_DOCKER_SERVICE");
40-
log.info("USE_DOCKER_SERVICE123: " + useDocker);
41-
if (useDocker != null) {
42-
log.info("useDocker.equalsIgnoreCase(true): " + useDocker.equalsIgnoreCase("true"));
43-
}
44-
log.info(
45-
"(useDocker != null && useDocker.equalsIgnoreCase())"
46-
+ (useDocker != null && useDocker.equalsIgnoreCase("true")));
4732
Assumptions.assumeTrue(
48-
(useDocker != null && useDocker.equalsIgnoreCase("true")),
33+
useDocker != null && useDocker.equalsIgnoreCase("true"),
4934
"Skipping tests because USE_DOCKER_SERVICE is not set");
5035
}
5136

52-
// @BeforeEach
53-
// void setUp() {
54-
// applicationContext.start();
55-
// }
37+
@BeforeEach
38+
void setUp() {
39+
applicationContext.start();
40+
}
5641

5742
@SuppressWarnings("deprecation")
5843
@Test
5944
@Timeout(value = 10)
6045
public void testAutoDiscovery() {
61-
applicationContext.start();
62-
log.info("testAutoDiscovery started");
6346
workflowClient
6447
.getWorkflowServiceStubs()
6548
.blockingStub()
@@ -69,12 +52,10 @@ public void testAutoDiscovery() {
6952
.setDeploymentName("dname")
7053
.setVersion("dname.bid")
7154
.build());
72-
// log.info("testAutoDiscovery 1");
7355

7456
TestWorkflow testWorkflow =
7557
workflowClient.newWorkflowStub(
7658
TestWorkflow.class, WorkflowOptions.newBuilder().setTaskQueue("UnitTest").build());
77-
// log.info("testAutoDiscovery 2");
7859
WorkflowExecution we1 = WorkflowClient.start(testWorkflow::execute, "hi");
7960
workflowClient.newUntypedWorkflowStub(we1.getWorkflowId()).getResult(String.class);
8061
// Should've used pinned (via default)
@@ -101,7 +82,6 @@ public void testAutoDiscovery() {
10182
e.getEventType() == EventType.EVENT_TYPE_WORKFLOW_TASK_COMPLETED
10283
&& e.getWorkflowTaskCompletedEventAttributes().getVersioningBehavior()
10384
== VersioningBehavior.VERSIONING_BEHAVIOR_AUTO_UPGRADE));
104-
log.info("testAutoDiscovery done");
10585
}
10686

10787
@ComponentScan(

0 commit comments

Comments
 (0)