Skip to content

Make the DAPR version being used consistent across all tests #1299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
GOPROXY: https://proxy.golang.org
JDK_VER: ${{ matrix.java }}
DAPR_CLI_VER: 1.15.0
DAPR_RUNTIME_VER: 1.15.3
DAPR_RUNTIME_VER: 1.15.4
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v1.15.0/install/install.sh
DAPR_CLI_REF:
DAPR_REF:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
GOPROXY: https://proxy.golang.org
JDK_VER: ${{ matrix.java }}
DAPR_CLI_VER: 1.15.0
DAPR_RUNTIME_VER: 1.15.3
DAPR_RUNTIME_VER: 1.15.4
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v1.15.0/install/install.sh
DAPR_CLI_REF:
DAPR_REF:
Expand Down
4 changes: 2 additions & 2 deletions daprdocs/content/en/java-sdk-docs/spring-boot/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public class DaprTestContainersConfig {
@ServiceConnection
public DaprContainer daprContainer(Network daprNetwork, PostgreSQLContainer<?> postgreSQLContainer){

return new DaprContainer("daprio/daprd:1.14.1")
return new DaprContainer("daprio/daprd:1.15.4")
.withAppName("producer-app")
.withNetwork(daprNetwork)
.withComponent(new Component("kvstore", "state.postgresql", "v1", STATE_STORE_PROPERTIES))
Expand Down Expand Up @@ -235,7 +235,7 @@ Finally, because Dapr PubSub requires a bidirectional connection between your ap
@ServiceConnection
public DaprContainer daprContainer(Network daprNetwork, PostgreSQLContainer<?> postgreSQLContainer, RabbitMQContainer rabbitMQContainer){

return new DaprContainer("daprio/daprd:1.14.1")
return new DaprContainer("daprio/daprd:1.15.4")
.withAppName("producer-app")
.withNetwork(daprNetwork)
.withComponent(new Component("kvstore", "state.postgresql", "v1", STATE_STORE_PROPERTIES))
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<grpc.version>1.69.0</grpc.version>
<protobuf.version>3.25.5</protobuf.version>
<protocCommand>protoc</protocCommand>
<dapr.proto.baseurl>https://raw.githubusercontent.com/dapr/dapr/v1.15.3/dapr/proto</dapr.proto.baseurl>
<dapr.proto.baseurl>https://raw.githubusercontent.com/dapr/dapr/v1.15.4/dapr/proto</dapr.proto.baseurl>
<dapr.sdk.version>1.15.0-SNAPSHOT</dapr.sdk.version>
<dapr.sdk.alpha.version>0.15.0-SNAPSHOT</dapr.sdk.alpha.version>
<os-maven-plugin.version>1.7.1</os-maven-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

package io.dapr.springboot;

import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@RequestMapping(value = {"v1", "v2"})
public class MockController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
import static com.github.tomakehurst.wiremock.client.WireMock.verify;
import static io.dapr.it.resiliency.SdkResiliencyIT.WIREMOCK_PORT;
import static io.dapr.it.testcontainers.ContainerConstants.DAPR_IMAGE_TAG;
import static io.dapr.it.testcontainers.ContainerConstants.TOXIPROXY_IMAGE_TAG;
import static io.dapr.it.testcontainers.DaprContainerConstants.DAPR_RUNTIME_IMAGE_TAG;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;

Expand All @@ -74,7 +73,7 @@ public class SdkResiliencyIT {
private static final int INFINITE_RETRY = -1;

@Container
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DAPR_IMAGE_TAG)
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DAPR_RUNTIME_IMAGE_TAG)
.withAppName("dapr-app")
.withAppPort(WIREMOCK_PORT)
.withDaprLogLevel(DaprLogLevel.DEBUG)
Expand All @@ -85,7 +84,7 @@ public class SdkResiliencyIT {
.withNetwork(NETWORK);

@Container
private static final ToxiproxyContainer TOXIPROXY = new ToxiproxyContainer(TOXIPROXY_IMAGE_TAG)
private static final ToxiproxyContainer TOXIPROXY = new ToxiproxyContainer("ghcr.io/shopify/toxiproxy:2.5.0")
.withNetwork(NETWORK);

private static Proxy proxy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@

import static io.dapr.it.spring.data.DaprSpringDataConstants.BINDING_NAME;
import static io.dapr.it.spring.data.DaprSpringDataConstants.STATE_STORE_NAME;
import static io.dapr.it.testcontainers.ContainerConstants.DAPR_IMAGE_TAG;
import static org.junit.jupiter.api.Assertions.*;
import static io.dapr.it.testcontainers.DaprContainerConstants.DAPR_RUNTIME_IMAGE_TAG;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* Integration tests for {@link DaprKeyValueRepositoryIT}.
Expand Down Expand Up @@ -65,7 +67,7 @@ public class DaprKeyValueRepositoryIT {

@Container
@ServiceConnection
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DAPR_IMAGE_TAG)
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DAPR_RUNTIME_IMAGE_TAG)
.withAppName("postgresql-repository-dapr-app")
.withNetwork(DAPR_NETWORK)
.withComponent(new Component(STATE_STORE_NAME, "state.postgresql", "v1", STATE_STORE_PROPERTIES))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

import static io.dapr.it.spring.data.DaprSpringDataConstants.STATE_STORE_NAME;
import static io.dapr.it.spring.data.DaprSpringDataConstants.BINDING_NAME;
import static io.dapr.it.testcontainers.ContainerConstants.DAPR_IMAGE_TAG;
import static io.dapr.it.testcontainers.DaprContainerConstants.DAPR_RUNTIME_IMAGE_TAG;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;

Expand Down Expand Up @@ -80,7 +80,7 @@ public class MySQLDaprKeyValueTemplateIT {

@Container
@ServiceConnection
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DAPR_IMAGE_TAG)
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DAPR_RUNTIME_IMAGE_TAG)
.withAppName("mysql-dapr-app")
.withNetwork(DAPR_NETWORK)
.withComponent(new Component(STATE_STORE_NAME, "state.mysql", "v1", STATE_STORE_PROPERTIES))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import static io.dapr.it.spring.data.DaprSpringDataConstants.BINDING_NAME;
import static io.dapr.it.spring.data.DaprSpringDataConstants.STATE_STORE_NAME;
import static io.dapr.it.testcontainers.ContainerConstants.DAPR_IMAGE_TAG;
import static io.dapr.it.testcontainers.DaprContainerConstants.DAPR_RUNTIME_IMAGE_TAG;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;

Expand Down Expand Up @@ -67,7 +71,7 @@ public class PostgreSQLDaprKeyValueTemplateIT {

@Container
@ServiceConnection
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DAPR_IMAGE_TAG)
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DAPR_RUNTIME_IMAGE_TAG)
.withAppName("postgresql-dapr-app")
.withNetwork(DAPR_NETWORK)
.withComponent(new Component(STATE_STORE_NAME, "state.postgresql", "v1", STATE_STORE_PROPERTIES))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import java.util.Collections;
import java.util.List;

import static io.dapr.it.testcontainers.ContainerConstants.DAPR_IMAGE_TAG;
import static io.dapr.it.testcontainers.DaprContainerConstants.DAPR_RUNTIME_IMAGE_TAG;
import static org.assertj.core.api.Assertions.assertThat;

@SpringBootTest(
Expand All @@ -61,7 +61,7 @@ public class DaprSpringMessagingIT {

@Container
@ServiceConnection
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DAPR_IMAGE_TAG)
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DAPR_RUNTIME_IMAGE_TAG)
.withAppName("messaging-dapr-app")
.withNetwork(DAPR_NETWORK)
.withComponent(new Component("pubsub", "pubsub.in-memory", "v1", Collections.emptyMap()))
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.Random;
import java.util.UUID;

import static io.dapr.it.testcontainers.DaprContainerConstants.DAPR_RUNTIME_IMAGE_TAG;
import static org.junit.jupiter.api.Assertions.assertEquals;

@SpringBootTest(
Expand All @@ -53,10 +54,10 @@ public class DaprActorsIT {
private static final Random RANDOM = new Random();
private static final int PORT = RANDOM.nextInt(1000) + 8000;

private static final String ACTORS_MESSAGE_PATTERN = ".*Actor API level in the cluster has been updated to 10.*";
private static final String ACTORS_MESSAGE_PATTERN = ".*Actor runtime started.*";

@Container
private static final DaprContainer DAPR_CONTAINER = new DaprContainer("daprio/daprd:1.14.4")
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DAPR_RUNTIME_IMAGE_TAG)
.withAppName("actor-dapr-app")
.withNetwork(DAPR_NETWORK)
.withComponent(new Component("kvstore", "state.in-memory", "v1",
Expand Down Expand Up @@ -88,7 +89,8 @@ static void daprProperties(DynamicPropertyRegistry registry) {
public void setUp(){
org.testcontainers.Testcontainers.exposeHostPorts(PORT);
daprActorRuntime.registerActor(TestActorImpl.class);
// Ensure the subscriptions are registered

// Wait for actor runtime to start.
Wait.forLogMessage(ACTORS_MESSAGE_PATTERN, 1).waitUntilReady(DAPR_CONTAINER);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package io.dapr.it.testcontainers;

public interface DaprContainerConstants {
String DAPR_RUNTIME_VERSION = "1.15.4";
String DAPR_RUNTIME_IMAGE_TAG = "daprio/daprd:" + DAPR_RUNTIME_VERSION;
String DAPR_PLACEMENT_IMAGE_TAG = "daprio/placement:" + DAPR_RUNTIME_VERSION;
String DAPR_SCHEDULER_IMAGE_TAG = "daprio/scheduler:" + DAPR_RUNTIME_VERSION;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import io.dapr.client.DaprClientBuilder;
import io.dapr.client.domain.Metadata;
import io.dapr.client.domain.State;

import io.dapr.config.Properties;
import io.dapr.testcontainers.DaprContainer;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -27,7 +26,6 @@
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;
Expand All @@ -49,10 +47,11 @@
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
import static com.github.tomakehurst.wiremock.client.WireMock.verify;
import static io.dapr.it.testcontainers.ContainerConstants.DAPR_IMAGE_TAG;
import static io.dapr.it.testcontainers.DaprContainerConstants.DAPR_RUNTIME_IMAGE_TAG;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.fail;
import static org.testcontainers.shaded.org.awaitility.Awaitility.await;


@Testcontainers
Expand All @@ -69,7 +68,7 @@ public class DaprContainerIT {
private static final String APP_FOUND_MESSAGE_PATTERN = ".*application discovered on port 8081.*";

@Container
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DAPR_IMAGE_TAG)
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DAPR_RUNTIME_IMAGE_TAG)
.withAppName("dapr-app")
.withAppPort(8081)
.withAppHealthCheckPath("/actuator/health")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.testcontainers.junit.jupiter.Testcontainers;

import java.time.Instant;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
Expand All @@ -58,7 +57,7 @@ public class DaprJobsIT {
private static final int PORT = RANDOM.nextInt(1000) + 8000;

@Container
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(ContainerConstants.DAPR_IMAGE_TAG)
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DaprContainerConstants.DAPR_RUNTIME_IMAGE_TAG)
.withAppName("jobs-dapr-app")
.withNetwork(DAPR_NETWORK)
.withDaprLogLevel(DaprLogLevel.DEBUG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class DaprPlacementContainerIT {

@Container
private static final DaprPlacementContainer PLACEMENT_CONTAINER =
new DaprPlacementContainer(ContainerConstants.DAPR_PLACEMENT_IMAGE_TAG);
new DaprPlacementContainer(DaprContainerConstants.DAPR_PLACEMENT_IMAGE_TAG);

@Test
public void testDaprPlacementContainerDefaults() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/

package io.dapr.it.testcontainers;

import io.dapr.testcontainers.DaprSchedulerContainer;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

import static org.junit.jupiter.api.Assertions.assertEquals;

@Testcontainers
@Tag("testcontainers")
public class DaprSchedulerContainerIT {

@Container
private static final DaprSchedulerContainer SCHEDULER_CONTAINER =
new DaprSchedulerContainer(DaprContainerConstants.DAPR_SCHEDULER_IMAGE_TAG);

@Test
public void testDaprSchedulerContainerDefaults() {
assertEquals(51005, SCHEDULER_CONTAINER.getPort(), "The default port is not set");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import java.util.Collections;
import java.util.Map;

import static io.dapr.it.testcontainers.ContainerConstants.DAPR_IMAGE_TAG;
import static io.dapr.it.testcontainers.DaprContainerConstants.DAPR_RUNTIME_IMAGE_TAG;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

Expand All @@ -57,7 +57,7 @@ public class DaprWorkflowsIT {
private static final Network DAPR_NETWORK = Network.newNetwork();

@Container
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DAPR_IMAGE_TAG)
private static final DaprContainer DAPR_CONTAINER = new DaprContainer(DAPR_RUNTIME_IMAGE_TAG)
.withAppName("workflow-dapr-app")
.withNetwork(DAPR_NETWORK)
.withComponent(new Component("kvstore", "state.in-memory", "v1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import java.util.List;
import java.util.Map;

import static io.dapr.testcontainers.DaprContainerConstants.DAPR_RUNTIME_IMAGE_TAG;

@TestConfiguration(proxyBeanMethods = false)
public class DaprTestContainersConfig {

Expand Down Expand Up @@ -87,7 +89,7 @@ public DaprContainer daprContainer(Network daprNetwork, RabbitMQContainer rabbit
rabbitMqProperties.put("user", "guest");
rabbitMqProperties.put("password", "guest");

return new DaprContainer("daprio/daprd:1.14.4")
return new DaprContainer(DAPR_RUNTIME_IMAGE_TAG)
.withAppName("consumer-app")
.withNetwork(daprNetwork).withComponent(new Component("pubsub",
"pubsub.rabbitmq", "v1", rabbitMqProperties))
Expand Down
2 changes: 1 addition & 1 deletion spring-boot-examples/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Once you have the cluster up and running you can install Dapr:
helm repo add dapr https://dapr.github.io/helm-charts/
helm repo update
helm upgrade --install dapr dapr/dapr \
--version=1.14.4 \
--version=1.15.4 \
--namespace dapr-system \
--create-namespace \
--wait
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import java.util.List;
import java.util.Map;

import static io.dapr.testcontainers.DaprContainerConstants.DAPR_RUNTIME_IMAGE_TAG;

@TestConfiguration(proxyBeanMethods = false)
public class DaprTestContainersConfig {

Expand Down Expand Up @@ -110,7 +112,7 @@ public DaprContainer daprContainer(Network daprNetwork, PostgreSQLContainer<?> p
rabbitMqProperties.put("user", "guest");
rabbitMqProperties.put("password", "guest");

return new DaprContainer("daprio/daprd:1.14.4")
return new DaprContainer(DAPR_RUNTIME_IMAGE_TAG)
.withAppName("producer-app")
.withNetwork(daprNetwork)
.withComponent(new Component("kvstore", "state.postgresql", "v1", STATE_STORE_PROPERTIES))
Expand Down
Loading
Loading