spring-cloud-aws
spring-cloud-aws copied to clipboard
Introduce Testcontainers & LocalStack to run integration
Is your feature request related to a problem?
- Running the current integration tests requires spawning resources in AWS
- The setup for this requires some manual effort (see README)
- Spring Cloud AWS does not execute the integration tests by default
Describe the solution you'd like
With the help of Testcontainers and LocalStack we can mirror AWS resources locally using Docker containers and save $
Describe alternatives you've considered
Simplify the AWS resource setup or ask AWS for some free budget for running the integration test.
Things to consider
- Not sure if there are some corner cases for AWS resources that LocalStack does not support
I could start working on a first POC and maybe convert a first old integration test to this new setup.
Some questions I would have for this:
- Should we still put them in a own Maven module
spring-cloud-aws-integration-test
package or make them part of each specific module (e.g. SQS integration tests inside the messaging module) - In regards to https://github.com/spring-cloud/spring-cloud-aws/issues/566 I guess new tests should use JUnit 5
Thanks @rieckpil for taking care of it! I believe there will be a still small number of tests that will have to touch real AWS environment - I would keep them in in spring-cloud-aws-integration-test
module. The rest as you suggested - SQS integration tests go to messaging module.
Let's write new tests in JUnit 5 only double check please that both are executed by surefire plugin.
@rieckpil you can use branch 2.3.x
Regarding JUnit5, I could take a swing at moving the project over to the JUnit5 Jupiter APIs. There doesn't appear to be anything stopping it from an initial attempt. Some ExpectedException
rules which could easily be replaced by Assertations#assertThatCode
For me it's okay. I am not touching any existing tests and rather create a new one, so this shouldn't clash
It would be nice if you can write some doc about it share. Great take away from this effort can be applied to elsewhere in other projects in the industry IMO. Just a suggestion given your time constraints.