testcontainers / testcontainers/testcontainers-java
[FEATURE] Support easily running java unit tests inside a container
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 8.7k
- Forks
- 1.9k
- Ø Merge
- 2 T. 17 Std.
- Gemergte PRs (30 T.)
- 9
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, den vorgeschlagenen Ablauf für die Remote-Code-Ausführung zwischen einem Java-Unit-Test und einem vom Benutzer angegebenen Docker-Container abzugrenzen, einschließlich der Übertragung von Abhängigkeiten und kompilierten Tests. Als abgeschlossen gilt eine wartbare Möglichkeit, Assertions im Container auszuführen und Fehler an den initiierenden Test zurückzumelden; im Issue werden keine Dateien oder Tests genannt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- docker, java
- Bereich
- devops, testing
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100