microsoft / microsoft/vscode-java-test
Ignoring arg from maven plugin
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 340
- Forks
- 173
- Merge medio
- 1 d 19 h
- PR fusionados (30 d)
- 18
Descripción
When I run my java spring boot app tests through the UI (the play button), the console shows the warning about java agent being loaded dynamically:
Mockito is currently self-attaching to enable the inline-mock-maker. This will no longer work in future releases of the JDK. Please add Mockito as an agent to your build as described in Mockito's documentation: https://javadoc.io/doc/org.mockito/mockito-core/latest/org.mockito/org/mockito/Mockito.html#0.3
WARNING: A Java agent has been loaded dynamically (/var/home/npessoa/.m2/repository/net/bytebuddy/byte-buddy-agent/1.17.7/byte-buddy-agent-1.17.7.jar)
WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
WARNING: Dynamic loading of agents will be disallowed by default in a future release
As seen in this stackoverflow post for example, or even in the documentation linked in the warning from the console, this can be resolved by setting up the maven surefire or failsafe plugins with the argLine like this:
<argLine>@{argLine} -javaagent:${settings.localRepository}/org/mockito/mockito-core/${mockito.version}/mockito-core-${mockito.version}.jar</argLine>
That's enough to make the warning go away on my CI/CD pipelines or running the tests through the Intellij IDEA UI. But in the case of vscode, I had to edit my settings.json to include this config, having even to replace the placeholders with static values:
"java.test.config": {
"vmArgs": [
"-javaagent:/var/home/npessoa/.m2/repository/org/mockito/mockito-core/5.17.0/mockito-core-5.17.0.jar",
"-Xshare:off"
]
}
I'm not sure I'm bringing this up in the appropriate place, but I guessed the vscode-java-test plugin could be responsible for this, so I though posting this here.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con la ruta de lanzamiento de pruebas de Java que utiliza el botón de reproducción de la UI e inspecciona cómo se gestiona java.test.config vmArgs junto con Maven surefire o failsafe argLine. Compara el comando de prueba generado con la configuración documentada del javaagent de Mockito. Se considera completado cuando el argumento del agente configurado se respeta al lanzar pruebas mediante VS Code y ya no se informa de la advertencia de carga dinámica.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java, vscode
- Área
- testing, tooling
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100