Skip to content

Conversation

bissquit
Copy link
Member

@bissquit bissquit commented May 12, 2023

Description

Upgrade Java from 11 to 17 for CLI Docker images

Fixes #2201

How to test

Automated tests

Not applicable

Manual tests

Try to run tests generation using new images

Self-check list

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.

@bissquit bissquit added ctg-enhancement New feature, improvement or change request comp-infrastructure Infrastructure issues comp-github-action GitHub action, gradle plugin or maven plugin labels May 12, 2023
@bissquit bissquit requested a review from viktoriia-fomina May 12, 2023 06:42
@bissquit bissquit self-assigned this May 12, 2023
@bissquit
Copy link
Member Author

New JS image produce the following error:

Status Code: TEST_GENERATION_FAILED

TEST GENERATION: FAILED
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
09:44:06.660 | INFO  | JsGenerateTestsCommand | Generating tests for [/var/utbot/processing/utbot-javascript-773819/source.js] - started
09:44:06.920 | ERROR | JsGenerateTestsCommand | An error has occurred while generating tests for file /var/utbot/processing/utbot-javascript-773819/source.js : java.io.IOException: Cannot run program ""node"" (in directory "/var/utbot/processing/utbot-javascript-773819/utbotJs"): error=2, No such file or directory
java.io.IOException: Cannot run program ""node"" (in directory "/var/utbot/processing/utbot-javascript-773819/utbotJs"): error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
	at utils.JsCmdExec.runCommand(JsCmdExec.kt:20)
	at service.TernService.runTypeInferencer(TernService.kt:79)
	at service.TernService.<init>(TernService.kt:64)
	at api.JsTestGenerator.run(JsTestGenerator.kt:127)
	at org.utbot.cli.js.JsGenerateTestsCommand.run(JsGenerateTestsCommand.kt:102)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:204)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:213)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:17)
	at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:396)
	at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:393)
	at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:411)
	at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:436)
	at org.utbot.cli.js.ApplicationKt.main(Application.kt:31)
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
	... 14 more

And Python as well:

TEST GENERATION: FAILED
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
Error: no such option: "--visit-only-specified-source"

TEST RUN: ERROR OCCURRED
[object Object]: no details

But new Java is Ok

@viktoriia-fomina
Copy link
Member

For Python when running CLI without --visit-only-specified-source, there's an error in docker container with CLI:

# java -jar utbot-cli.jar generate_python ./example.py -s . -p /usr/bin/python3.9 -o ./tests.py --coverage ./coverage.py --install-requirements
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
13:20:26.009 | INFO  | PythonGenerateTestsCommand | Checking requirements...
java.io.IOException: Cannot run program "/usr/bin/python3.9": error=2, No such file or directory
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
        at org.utbot.python.utils.ProcessUtilsKt.startProcess(ProcessUtils.kt:14)
        at org.utbot.python.utils.ProcessUtilsKt.runCommand(ProcessUtils.kt:40)
        at org.utbot.python.utils.ProcessUtilsKt.runCommand$default(ProcessUtils.kt:39)
        at org.utbot.python.utils.RequirementsUtils.requirementsAreInstalled(RequirementsUtils.kt:22)
        at org.utbot.python.utils.RequirementsUtils.requirementsAreInstalled(RequirementsUtils.kt:16)
        at org.utbot.python.PythonTestGenerationProcessor.processTestGeneration(PythonTestGenerationProcessor.kt:74)
        at org.utbot.python.PythonTestGenerationProcessor.processTestGeneration$default(PythonTestGenerationProcessor.kt:39)
        at org.utbot.cli.language.python.PythonGenerateTestsCommand.run(PythonGenerateTestsCommand.kt:232)
        at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:204)
        at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:213)
        at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:17)
        at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:396)
        at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:393)
        at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:411)
        at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:436)
        at org.utbot.cli.language.python.ApplicationKt.main(Application.kt:31)
Caused by: java.io.IOException: error=2, No such file or directory
        at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
        at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)
        at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
        ... 17 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-github-action GitHub action, gradle plugin or maven plugin comp-infrastructure Infrastructure issues ctg-enhancement New feature, improvement or change request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade Java in utbot-cli images
2 participants