microsoft / vscode-java-test

Run and debug Java test cases in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test
Other
292 stars 125 forks source link

"vmArgs": ["-Dfile.encoding=iso885915"] seems to be overided by something else in the java.test.config config #1641

Open guillaumeagsp opened 8 months ago

guillaumeagsp commented 8 months ago

Hello

when I put some specific args in the java.test.config, they are passed to code under test, except file.encoding, which is always stuck to UTF-8

"java.test.config": {
        "name": "MonConfig",

        "vmArgs": [
            "-Dfile.encoding=iso8859-15",
            "-DTITI=iso8859-15",
        ],
}

==>

mainid 2023-12-15 16:27:38,655 - INFO  ApplicationProperties - file.encoding = UTF-8
mainid 2023-12-15 16:27:38,657 - INFO  ApplicationProperties - TITI = iso8859-15

It seems that something is overiding this setting

The project is build by gradle. My build.gradle contains something like this :

   tasks.withType(Test) {
        // Configuration spécifique pour toutes les tâches de test des sous-projets
        systemProperty 'file.encoding', 'iso8859-15'
   }

and it work well when i use directly gradle in my vs console

    Test workerid 2023-12-15 16:52:15,934 - INFO  ApplicationProperties - file.encoding = iso8859-15
jdneo commented 8 months ago

Found the related code is here: https://github.com/microsoft/vscode-java-debug/blob/792249434fa8265a2b40d08956cc1b9dbe46e474/src/configurationProvider.ts#L362-L363.

Will check if it's on purpose

starball5 commented 8 months ago

Related on Stack Overflow: Vscode / Java Extension / Test Panel : How to specify runtime file.encoding

Potentially related: #896 and https://github.com/microsoft/vscode-java-test/pull/885, https://github.com/Microsoft/vscode-java-test/pull/662

guillaumeagsp commented 8 months ago

OK, thank you for your answer. I dump here versions of vscode + extension. It could help

alexcvzz.vscode-sqlite@0.14.1
batisteo.vscode-django@1.14.0
donjayamanne.python-environment-manager@1.2.4
donjayamanne.python-extension-pack@1.7.0
GitHub.copilot@1.143.0
GitHub.copilot-chat@0.11.1
GitHub.vscode-pull-request-github@0.78.1
hediet.vscode-drawio@1.6.6
johnstoncode.svn-scm@2.17.0
mrorz.language-gettext@0.2.2
MS-CEINTL.vscode-language-pack-fr@1.85.2023121309        
ms-python.autopep8@2023.8.0
ms-python.black-formatter@2023.6.0
ms-python.python@2023.22.1
ms-python.vscode-pylance@2023.12.1
ms-toolsai.jupyter@2023.11.1003402403
ms-toolsai.jupyter-keymap@1.1.2
ms-toolsai.jupyter-renderers@1.0.17
ms-toolsai.vscode-jupyter-cell-tags@0.1.8
ms-toolsai.vscode-jupyter-slideshow@0.1.5
redhat.java@1.25.1
redhat.vscode-xml@0.26.1
tomoki1207.pdf@1.2.2
VisualStudioExptTeam.intellicode-api-usage-examples@0.2.8
VisualStudioExptTeam.vscodeintellicode@1.2.30
vscjava.vscode-gradle@3.13.5
vscjava.vscode-java-debug@0.55.0
vscjava.vscode-java-dependency@0.23.3
vscjava.vscode-java-pack@0.25.15
vscjava.vscode-java-test@0.40.1
vscjava.vscode-maven@0.43.0
wholroyd.jinja@0.0.8
ZainChen.json@2.0.2