rage / tmc-vscode

TestMyCode extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=moocfi.test-my-code
MIT License
25 stars 6 forks source link

Empy Langs Response Error when trying to run test on an assignment #585

Closed luimu64 closed 3 years ago

luimu64 commented 3 years ago

Describe the bug I get "Empy Langs Response Error" when trying to run tests on an assignment

To Reproduce Steps to reproduce the behavior:

  1. Press ctrl+shift+t to run selected assignment

Expected behavior Extension tests the assignment and returns any errors in it

Screenshots image

Desktop (please complete the following information):

image

TMC Extension logs [2021-02-24 10:47:51:598] [INFO] Active text document language: java [2021-02-24 10:47:51:598] [INFO] "/home/luimu/.config/VSCodium/User/globalStorage/moocfi.test-my-code/tmcdata/cli/tmc-langs-cli-x86_64-unknown-linux-gnu-0.6.5" "run-tests" "--exercise-path" "/home/luimu/.config/VSCodium/User/globalStorage/moocfi.test-my-code/tmcdata/TMC workspace/Exercises/tredu/tredu-mooc-finnish-2020/osa02-Osa02_34.TulosteluaLikeABoss" [2021-02-24 10:47:51:611] [INFO] Running local tests for osa02-Osa02_34.TulosteluaLikeABoss [2021-02-24 10:47:51:614] [INFO] Rust Langs [2021-02-24T10:47:51Z DEBUG tmc_langs_framework::domain] reading .tmcproject.yml from /home/luimu/.config/VSCodium/User/globalStorage/moocfi.test-my-code/tmcdata/TMC workspace/Exercises/tredu/tredu-mooc-finnish-2020/osa02-Osa02_34.TulosteluaLikeABoss/.tmcproject.yml [2021-02-24T10:47:51Z INFO tmc_langs_util::task_executor] Detected project as apache-maven [2021-02-24T10:47:51Z DEBUG tmc_langs_java] updating tmc junit runner jar [2021-02-24T10:47:51Z DEBUG tmc_langs_java] junit runner at /home/luimu/.cache/tmc/tmc-junit-runner.jar

[2021-02-24 10:47:51:619] [INFO] Rust Langs [2021-02-24T10:47:51Z DEBUG tmc_langs_java] checkstyle runner at /home/luimu/.cache/tmc/tmc-checkstyle-runner.jar

[2021-02-24 10:47:51:620] [INFO] Rust Langs [2021-02-24T10:47:51Z DEBUG tmc_langs_java] initialized jassets at /home/luimu/.cache/tmc/jassets/j4rs.jar

[2021-02-24 10:47:51:621] [INFO] Rust Langs [2021-02-24T10:47:51Z INFO j4rs::logger] Setting classpath to -Djava.class.path=/home/luimu/.cache/tmc/jassets/j4rs.jar:/home/luimu/.cache/tmc/tmc-junit-runner.jar:/home/luimu/.cache/tmc/tmc-checkstyle-runner.jar [2021-02-24T10:47:51Z INFO j4rs::logger] Setting library path to -Djava.library.path=/home/luimu/.cache/tmc/deps:/usr/lib:/lib [2021-02-24T10:47:51Z DEBUG j4rs::logger] Creating a Jvm

[2021-02-24 10:47:51:622] [INFO] Rust Langs thread 'main' panicked at 'Could find the jvm dynamic library: JavaLocatorError { description: "Could not find the libjvm.* library in any subdirectory of /usr/libexec" }', /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/j4rs-0.13.0/src/api_tweaks/generic.rs:41:38 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

[2021-02-24 10:47:51:625] [ERROR] Exercise test run failed. Empy Langs Response Error — Langs process ended without result data. — Empy Langs Response Error: Langs process ended without result data. at t.default. (/home/luimu/.vscode-oss/extensions/moocfi.test-my-code-1.3.4/dist/extension.js:2:483233) at Generator.next () at o (/home/luimu/.vscode-oss/extensions/moocfi.test-my-code-1.3.4/dist/extension.js:2:381915) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5)

Additional context I installed the java extension pack and "Language Support for Java(TM) by Red Hat" complains about jdk 8 being too old. Trying to install openjdk11 causes circular dependency so I can't do that. This issue happens to two of my friends too who both use windows and tried using newer jdk than 8 (or so they said).

jolampi commented 3 years ago

Hi @luimu64,

Sorry to hear that you are having issues with the extension! The error message is rather vague but according to logs the issue seems to be with Java after all. JDK 11 is the recommended version with TMC exercises according to these installation instructions: https://www.mooc.fi/en/installation/vscode#java-environment

Please check out the above link and see if it helps with installing opendjk-11. Otherwise, could you please elaborate on what you meant by causing a circular dependency? Is it somehow related to the extension by RedHat?

luimu64 commented 3 years ago

Those instructions are only valid for debian/ubuntu based distributions. The circular dependency is caused by either bad ebuild or system misconfiguration on my end. The version 11 of the openjdk ebuild has "testing" status in https://packages.gentoo.org/packages/dev-java/openjdk and is masked to not be used by portage. I'll have to try some external repositories when I get the chance.

jolampi commented 3 years ago

Your point about installation instructions is valid. They are written first and foremost for University of Helsinki's Ubuntu-based Cubbli Linux. That being said, there isn't a lot that we can do extension-wise. That empty response error seems to be caused by an unhandled exception, which we'll look into.

If you believe that there is something we can do to improve Java handling on Gentoo environment specifically, we are open to requests. At the moment, this bit is the crux of the issue:

thread 'main' panicked at 'Could find the jvm dynamic library: JavaLocatorError { description: "Could not find the libjvm.* library in any subdirectory of /usr/libexec" }', /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/j4rs-0.13.0/src/api_tweaks/generic.rs:41:38
jolampi commented 3 years ago

Release 2.0.0 uses a TMC-langs version that includes a fix for the unhandled exception. This should lead to better error messages in the future. However, the topic of Java requirement will remain the same.