Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quote compilers' filepaths with "" for Windows #406

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

Vladislav0Art
Copy link
Collaborator

@Vladislav0Art Vladislav0Art commented Oct 28, 2024

Description of changes made

Closes #402

Please write if you have anything to add

I still treat non-Windows systems separately: I used a single quote ' ' to escape compilers' filepaths for Unix because bash treats a single quote as plain text, the double quote may contain command calls.

I tested both on Windows and Mac; the error from the issue got resolved. For Windows though, there is another one #407, which is not covered here.

  • I have checked that I am merging into correct branch

@Vladislav0Art Vladislav0Art marked this pull request as ready for review October 28, 2024 16:15
@Vladislav0Art Vladislav0Art self-assigned this Oct 28, 2024
@Vladislav0Art Vladislav0Art added Ready for review PR redy for review Urgent Urgant PR and removed Urgent Urgant PR labels Oct 28, 2024
@SergeyDatskiv
Copy link
Collaborator

I created tests using ChatGPT on my Windows machine for a Java program and can confirm that they do run now.

However, it seems that I am struggling to run tests for Kotlin. The test generated by the LLM results in a failure with the exception message "file." when running from the TestSpark tool window. But when copying the same tests into a test file, the test runs just fine; see the attached screenshot. If this is caused by a separate issue, it could be addressed in another PR.

TestSparkKotlinTestsNotRunning

@SergeyDatskiv
Copy link
Collaborator

Also, I noticed I get the following warning in the console when running the LLM-generated tests.
TestSparkConsoleWarning

@Hello-zoka
Copy link
Collaborator

Can you please check if classfiles are saved properly for Kotlin compilation on Windows? This potentially can cause the issue from #407 and such an error like .file.

Expected behavior for it: classfile is stored in the same location as the source file. In other fords -d option path + package path == path to source file

@Vladislav0Art @SergeyDatskiv

@SergeyDatskiv
Copy link
Collaborator

@Hello-zoka
Actually, I get the following error when running kotlinc from command prompt. So it seems the problem is in the kotlinc path, not in the location where the files are saved (at least not yet).

'java' is not recognized as an internal or external command, operable program or batch file.

My path to kotlinc (according to TestSpark) is following "C:\Users\my_user_name\.gradle\caches\8.8\transforms\59dd4cdd51e5ae6cd765ecd455ab2df8\transformed\ideaIC-2024.2.3-win\plugins\Kotlin\kotlinc\bin\kotlinc"

@SergeyDatskiv
Copy link
Collaborator

So... I debugged the problem a bit more and found out that the reason I get 'java' is not recognized as an internal or external command, operable program or batch file. is because I do not have java in my path variable. To overcome this problem, you can change the command to include the java path or add it to the path variables of your system. The former will probably resolve the issue for all windows machines, while the latter will resolve the issue only on a local machine.

The new command will look something like C:\Program Files\Java\jdk-11\bin\java -jar path\to\kotlinc.jar -cp . -d out src\main\kotlin\Main.kt according to Bing Copilot. I tried it, and it seems to work.

@pderakhshanfar pderakhshanfar requested review from SergeyDatskiv and removed request for arksap2002 October 30, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for review PR redy for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running tests fails on Windows
3 participants