Unit Testing w/ VSCode: HAL Extensions: No extensions found

This year I am trying to help our team get up and running with unit testing. After sifting through CD unit testing posts and mentor video tutorials, I have gotten to the point where “./gradlew build” is successfully running tests. However the VSCode integrated java test runner is not working.

After encountering the same problem described in last year’s post Unit Testing: java.io.IOException: wpiHaljni , and following ThadHouse’s solution

Now clicking “Run Test” in VSCode results in:

A new Java Test Report frame opening indicating a Failed test status and the following in the Debug Console:

HAL Extensions: No extensions found

Note: dev env is linux.

./.vscode/settings.json contains:

  "java.test.config": [
    {
      "name": "WPIlibUnitTests",
      "workingDirectory": "${workspaceFolder}/build/tmp/jniExtractDir",
      "vmargs": [ "-Djava.library.path=${workspaceFolder}/build/tmp/jniExtractDir" ],
      "env": {
        "LD_LIBRARY_PATH": "${workspaceFolder}/build/tmp/jniExtractDir",
        "DYLD_LIBRARY_PATH": "${workspaceFolder}/build/tmp/jniExtractDir",
        "PATH": "${env:PATH};build/tmp/jniExtractDir"
      }
    }
  ]

Any thoughts on what to try next would be greatly appreciated?

That message is actually a good thing. Extensions are things like the GUI, but those are not loaded or needed for unit tests, and that message showing up means the native libraries are actually loading correctly. Is there any other errors that are printed? If not, potentially something is wrong with the tests you’re writing. Is your code posted anywhere? Or if you don’t want it public, you can zip it to me in a PM and I’ll look.

Thank you for the quick response.

After performing the magic rain dance of completely closing out of vscode and restarting… running unit tests from within vscode is now working :slight_smile:

Thank you so much for your work on this. -Having spent several hours backlogging through the CD forums, gitter, and github issues from wpilibsuite/allwpilib and microsoft/vscode-java-test… Your long term efforts and follow through on this and similar issues is greatly appreciated.