lightbend / kalix-jvm-sdk

Java and Scala SDKs for Kalix
https://docs.kalix.io/java/index.html
Other
58 stars 39 forks source link

Docs on running locally/integration tests with cross-service calls #742

Open johanandren opened 2 years ago

johanandren commented 2 years ago

Some parts are tricky, like what you should back an external service dependency with in an integration test, but we could at least provide some hints in the docs

Some preliminary content in my answer here: https://discuss.lightbend.com/t/unsure-how-calling-another-service-works/9103/4?u=johanandren

johanandren commented 2 years ago

A part of this would potentially also be an explanation of how to run multiple separate services in the same machine. That will require a separate proxy instance per service and unique port config for each service (docker compose?) as well as instructions on how to configure the service calling other services with overrides in application.conf pointing to the other services and their ports.

For integration testing this is likely not a good idea, so the recommendation there would perhaps be to deploy to a separate test project and run tests against that?

johanandren commented 2 years ago

I guess there is also some bigger picture product/architectural questions here:

If you are building an application in the form of multiple Akka Serverless micro services, with interdependencies then what is a reasonable way to run those while developing, is it really running them all locally (probably not)? Is there some other tooling/best practice for this missing?

Also, to integration test such projects, again, is running all needed services locally really the solution?

Ping @jroper in case you have some ideas around this for Akka Serverless already.

johanandren commented 2 years ago

Probably not the end goal of what we want to provide around this, but I made a sample with two services and config/details on how to run both locally or only the "leaf" one and the one it depends on deployed: https://github.com/johanandren/akkaserverless-multiple-services-sample/tree/main/service-two