Migrate integration tests from process based approach to Testcontainers
- Lingua principale
- Java
- Stelle
- 300
- Fork
- 230
- Merge medio
- 5g 1h
- PR unite (30g)
- 5
Descrizione
## Describe the proposal
Historically `Dapr Java SDK` used a process based approach for running integration tests. This consisted of the following pieces:
- `JUnite Runner` - this would start the IT
- `Maven Exec Plugin `- this would actually start the `Dapr` sidecar
- Application under test - this is usually either a stub based on `WireMock` or a `Spring Boot` application
`Java` and the `JVM` ecosystem was and it still is very bad at process management. The `ProcessBuilder` API is horrendous and to make it properly work it requires a lot of boilerplate and baby sitting. For a quick glimpse you can check `DaprRun` and `Command` classes that deal with `ProcessBuilder`.
More than a half a year ago @salaboy started working on bringing `Testcontainers` support to `Dapr Java SDK`. The `Testcontainers` are currently used quite successfully for testing the newly added `Spring Boot` integration.
The proposal is to slowly migrate IT tests from the process based mechanism that relies on `DaprRun` and `Maven Exec` to `Testcontainers` based approach.
`Tescontainers` has all the necessary tools and hooks to make sure that the resources are properly cleaned up, also since Dapr is itself a sidecar `Testcontainers` and its container focus is natural fit for these types of integration tests.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia leggendo le classi DaprRun e Command, quindi esamina la configurazione di Maven Exec Plugin e gli integration test Spring Boot esistenti che usano già Testcontainers. Individua quali integration test usano ancora l’approccio basato sui processi e migrali in modo incrementale; il lavoro è completato quando i test migrati vengono eseguiti con Testcontainers e ripuliscono le proprie risorse in modo affidabile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- devops, testing
- Tipo di issue
- Refactoring
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100