testcontainers / testcontainers/testcontainers-java

[FEATURE] Support easily running java unit tests inside a container

Aperta
#1,184 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

resolution/acknowledged
Lingua principale
Java
Stelle
8.7k
Fork
1.9k
Merge medio
2g 17h
PR unite (30g)
9

Descrizione

It would be great if there was a way to easily run Java code inside a Docker container. A use case for this is to run a unit test that relies on a particular environment that is provided by a container e.g. running a unit test of some Java code that uses Tesseract installed inside a container. The java unit test can run outside the container, but since it requires a particular version and installation setup of Tesseract running natively, it would be best if the unit test was actually run inside the container, and any assertions and such are reported back to the initiating test.

I think one way to accomplish this goal is probably via remote code execution i.e. a java program is started inside a user-specified container [1] by the test. The test then sends the executable code to the java program running inside the container [2], which executes it, and then sends the result (exception or test completion) back to the test. The test then rethrows the assertion, or passes.

[1] This container would obviously need to have java so that it can run the remoting program.

[2] How? Open question, but the user would probably have to define which dependencies they want to copy into the container (via a DSL) and perhaps implement an interface that triggers the actual in-container test, the compiled version of which is also copied into the container.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia definendo l’ambito del flusso proposto di esecuzione remota del codice tra un test unitario Java e un container Docker specificato dall’utente, incluso il trasferimento delle dipendenze e dei test compilati. Il completamento consiste nell’avere un modo manutenibile per eseguire le asserzioni nel container e riportare i fallimenti al test che ha avviato l’esecuzione; l’issue non nomina file o test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker, java
Ambito
devops, testing
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.