Skip to content
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

Initial Testcontainers integration for Dapr #1085

Merged
merged 21 commits into from
Aug 5, 2024

Conversation

salaboy
Copy link
Contributor

@salaboy salaboy commented Jul 22, 2024

Description

This PR adds the testcontainers-dapr module to the Java SDK. The main reason to have this code here is to improve the Spring Boot integration, while providing a common way to start the Dapr Runtime for Java applications by using Testcontainers

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #1040

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@salaboy salaboy requested review from a team as code owners July 22, 2024 08:53
@salaboy salaboy force-pushed the 1040-testcontainers branch 4 times, most recently from 5a5b119 to 8b81027 Compare July 22, 2024 11:57
testcontainers-dapr/pom.xml Outdated Show resolved Hide resolved
@salaboy salaboy force-pushed the 1040-testcontainers branch from edc310d to d27016b Compare July 22, 2024 14:17
@salaboy
Copy link
Contributor Author

salaboy commented Jul 22, 2024

@artursouza @cicoyle I couldn't check why it is complaining about License Compliance.. can you help me out to check that?

@salaboy salaboy force-pushed the 1040-testcontainers branch from 9a93e12 to 8e0f523 Compare July 22, 2024 16:02
Copy link
Contributor

@artur-ciocanu artur-ciocanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@salaboy the PR looks really good, I have left a few comments, mostly stylistic. Please take a look.

Thank you!

@artur-ciocanu
Copy link
Contributor

@salaboy it is not a deal breaker, but it would be good to have the testcontainers-dapr pom.xml code formatted, right now it doesn't seem to be aligned with other POM files.

pom.xml Show resolved Hide resolved
testcontainers-dapr/pom.xml Show resolved Hide resolved
testcontainers-dapr/pom.xml Outdated Show resolved Hide resolved
@salaboy salaboy force-pushed the 1040-testcontainers branch from d55cf8d to 4238719 Compare July 25, 2024 09:27
@salaboy salaboy force-pushed the 1040-testcontainers branch from 792561d to 3984e4a Compare July 26, 2024 12:14
@salaboy
Copy link
Contributor Author

salaboy commented Jul 26, 2024

I removed Rest Assured, so one less dependency. But WireMock is mocking a webserver, so I think we cannot use Mockito for that.

artursouza
artursouza previously approved these changes Aug 3, 2024
@artursouza
Copy link
Member

Refactored the script to update the version of artifacts. Also fixed to use "docker compose" instead of "docker-compose".

Approved. Will merge once tests pass.

salaboy and others added 20 commits August 3, 2024 07:10
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Usage:  docker compose [OPTIONS] COMMAND

Define and run multi-container applications with Docker

Options:
      --all-resources              Include all resources, even those not used by services
      --ansi string                Control when to print ANSI control characters ("never"|"always"|"auto") (default "auto")
      --compatibility              Run compose in backward compatibility mode
      --dry-run                    Execute command in dry run mode
      --env-file stringArray       Specify an alternate environment file
  -f, --file stringArray           Compose configuration files
      --parallel int               Control max parallelism, -1 for unlimited (default -1)
      --profile stringArray        Specify a profile to enable
      --progress string            Set type of progress output (auto, tty, plain, quiet) (default "auto")
      --project-directory string   Specify an alternate working directory
                                   (default: the path of the, first specified, Compose file)
  -p, --project-name string        Project name

Commands:
  attach      Attach local standard input, output, and error streams to a service's running container
  build       Build or rebuild services
  config      Parse, resolve and render compose file in canonical format
  cp          Copy files/folders between a service container and the local filesystem
  create      Creates containers for a service
  down        Stop and remove containers, networks
  events      Receive real time events from containers
  exec        Execute a command in a running container
  images      List images used by the created containers
  kill        Force stop service containers
  logs        View output from containers
  ls          List running compose projects
  pause       Pause services
  port        Print the public port for a port binding
  ps          List containers
  pull        Pull service images
  push        Push service images
  restart     Restart service containers
  rm          Removes stopped service containers
  run         Run a one-off command on a service
  scale       Scale services
  start       Start services
  stats       Display a live stream of container(s) resource usage statistics
  stop        Stop services
  top         Display the running processes
  unpause     Unpause services
  up          Create and start containers
  version     Show the Docker Compose version information
  wait        Block until the first service container stops
  watch       Watch build context for service and rebuild/refresh containers when files are updated

Run 'docker compose COMMAND --help' for more information on a command. instead of docker-compose

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
@salaboy salaboy force-pushed the 1040-testcontainers branch from b30aa8a to e383fa3 Compare August 3, 2024 06:10
@salaboy
Copy link
Contributor Author

salaboy commented Aug 3, 2024

@artursouza the docker compose upgrade is breaking all the tests.. because the outputs are completely different :(

@artursouza
Copy link
Member

@artursouza the docker compose upgrade is breaking all the tests.. because the outputs are completely different :(

@salaboy can you fix this? Using docker compose is required as docker-compose is being removed from GHA as it is deprecated already.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
@dapr-bot dapr-bot merged commit e30dc2d into dapr:master Aug 5, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bring Testcontainers integration to Dapr for local spring boot development experience
5 participants