elastic / elastic/apm-agent-java

Independant module for test/jvm tools

Offen
#2,185 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
chore size:small stretch technical-debt
Vorherrschende Sprache
Java
Sterne
593
Forks
337
Ø Merge
1 T. 13 Std.
Gemergte PRs (30 T.)
25

Beschreibung

We have some duplicated implementations of the following (non-exhaustive list, please add other relevant items if needed).
- [ ] (test) get a random available port (see usages of `co.elastic.apm.agent.testutils.TestPort` and `javax.net.ServerSocketFactory#createServerSocket(int, int, java.net.InetAddress)`)
- [ ] (test) locate packaged artifacts from classpath/relative path (see `co.elastic.apm.servlet.AgentFileAccessor#getTargetJar(java.lang.String, java.lang.String)`)
- [ ] find path to the JVM binary (`getJavaBinaryPath`).
- [ ] shutdown thread pools properly with `co.elastic.apm.agent.util.ExecutorUtils`, used both in tests and in production code.

Duplication is the the result of the following:
- not every module has a dependency on `apm-agent-core` hence code reuse is limited
- there is no root module that can host them

The goal would be to create one (or more) modules that provide
- all the test-only features in the `test` scope so it can be reused in any other module testing
- other items in the `compile` scope
- no dependency on other agent modules, only common libraries (slf4j, junit, ...).

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, die Verwendungen von TestPort, AgentFileAccessor#getTargetJar, getJavaBinaryPath und ExecutorUtils in den Modulen zu erfassen, und untersuche anschließend deren aktuellen Modulabhängigkeiten. Definiere die im Issue beschriebenen gemeinsamen Modulgrenzen sowie Test- und Compile-Sopes und überprüfe den Projekt-Build und die betroffenen Tests. Erledigt ist die Aufgabe, wenn die duplizierten Utilities ohne Abhängigkeiten von anderen Agent-Modulen wiederverwendbar sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
tooling
Issue-Typ
Refactoring
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.