Skip to content

Commit

Permalink
Merge branch 'master' into actor_ttl
Browse files Browse the repository at this point in the history
  • Loading branch information
artur-ciocanu authored Mar 4, 2025
2 parents 4b5afc2 + 36a0140 commit 586a232
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 40 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
fail-fast: false
matrix:
java: [ 17 ]
spring-boot-version: [ 3.2.6 ]
spring-boot-display-version: [ 3.2.x ]
spring-boot-version: [ 3.4.3 ]
spring-boot-display-version: [ 3.4.x ]
experimental: [ false ]
include:
- java: 17
spring-boot-version: 3.3.0
spring-boot-version: 3.3.9
spring-boot-display-version: 3.3.x
experimental: false
env:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<junit-bom.version>5.8.2</junit-bom.version>
<snakeyaml.version>2.0</snakeyaml.version>
<testcontainers.version>1.20.0</testcontainers.version>
<springboot.version>3.2.6</springboot.version>
<springboot.version>3.4.3</springboot.version>
</properties>

<distributionManagement>
Expand Down
44 changes: 14 additions & 30 deletions sdk-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
<protobuf.input.directory>${project.basedir}/proto</protobuf.input.directory>
<grpc.version>1.69.0</grpc.version>
<protobuf.version>3.25.5</protobuf.version>
<opentelemetry.version>1.39.0</opentelemetry.version>
<springboot.version>3.3.1</springboot.version>
<logback-classic.version>1.4.12</logback-classic.version>
<opentelemetry.version>1.41.0</opentelemetry.version>
<springboot.version>3.4.3</springboot.version>
<logback-core.version>1.5.16</logback-core.version>
<wiremock.version>3.9.1</wiremock.version>
<testcontainers-test.version>1.20.0</testcontainers-test.version>
</properties>
Expand All @@ -49,11 +49,6 @@
</dependencyManagement>

<dependencies>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
Expand All @@ -70,14 +65,9 @@
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
<version>${protobuf.version}</version>
</dependency>
<dependency>
<groupId>com.github.os72</groupId>
<artifactId>protoc-jar-maven-plugin</artifactId>
<version>3.11.4</version>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.14.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
Expand Down Expand Up @@ -178,32 +168,20 @@
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-keyvalue</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-standalone</artifactId>
<version>${wiremock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback-classic.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<version>3.6.7</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -212,6 +190,12 @@
<version>3.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@
*/
@SpringBootApplication
public class TestApplication {

/**
* Starts Dapr's callback in a given port.
* @param port Port to listen to.
*/
public static void start(long port) {
SpringApplication app = new SpringApplication(TestApplication.class);
app.run(String.format("--server.port=%d", port));
SpringApplication.run(TestApplication.class, String.format("--server.port=%d", port));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import static org.testcontainers.shaded.org.awaitility.Awaitility.await;
import org.testcontainers.shaded.org.awaitility.core.ConditionTimeoutException;

import java.io.IOException;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.any;
Expand All @@ -48,6 +52,8 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;


@Testcontainers
@WireMockTest(httpPort = 8081)
Expand All @@ -60,6 +66,7 @@ public class DaprContainerIT {
private static final String KEY = "my-key";
private static final String PUBSUB_NAME = "pubsub";
private static final String PUBSUB_TOPIC_NAME = "topic";
private static final String APP_FOUND_MESSAGE_PATTERN = ".*application discovered on port 8081.*";

@Container
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(IMAGE_TAG)
Expand Down Expand Up @@ -129,9 +136,26 @@ public void testStateStore() throws Exception {

@Test
public void testPlacement() throws Exception {
// Dapr and Placement need some time to connect
Thread.sleep(1000);
Wait.forLogMessage(APP_FOUND_MESSAGE_PATTERN, 1).waitUntilReady(DAPR_CONTAINER);
try {
await().atMost(10, TimeUnit.SECONDS)
.pollDelay(500, TimeUnit.MILLISECONDS)
.pollInterval(500, TimeUnit.MILLISECONDS)
.until(() -> {
String metadata = checkSidecarMetadata();
if (metadata.contains("placement: connected")) {
return true;
} else {
return false;
}
});
} catch (ConditionTimeoutException timeoutException) {
fail("The placement server is not connected");
}

}

private String checkSidecarMetadata() throws IOException {
OkHttpClient okHttpClient = new OkHttpClient.Builder()
.build();
Request request = new Request.Builder()
Expand All @@ -140,7 +164,7 @@ public void testPlacement() throws Exception {

try (Response response = okHttpClient.newCall(request).execute()) {
if (response.isSuccessful() && response.body() != null) {
assertTrue(response.body().string().contains("placement: connected"));
return response.body().string();
} else {
throw new IOException("Unexpected response: " + response.code());
}
Expand Down

0 comments on commit 586a232

Please sign in to comment.