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

Problems view is not opened after generation Kotlin tests #1589

Closed
tyuldashev opened this issue Dec 26, 2022 · 0 comments · Fixed by #1598
Closed

Problems view is not opened after generation Kotlin tests #1589

tyuldashev opened this issue Dec 26, 2022 · 0 comments · Fixed by #1598
Assignees
Labels
ctg-bug Issue is a bug lang-kotlin Issue is related to Kotlin language support

Comments

@tyuldashev
Copy link
Collaborator

Description

In case tests are generated for Kotlin file then no error list is displayed at the end of test generation.

To Reproduce

Steps to reproduce the behavior:

class SimpleFunctions {
    fun div(x: Int, y: Int) = x / y
}
  1. Enable 'Display detected errors on the Problems tool window' in UTBot settings
  2. Generate code for Kotlin code above

Expected behavior

Tests are generated. Problems view has been opened with detected errors

Actual behavior
Tests are generated, but 'Problems view' is not opened and following message is shown:
image

Additional context
Problem reproducible no matter what target language is Kotlin or Java.

SARIF report is generated and contains some errors.

In case user switched to another project till generation is finished then exception is thrown at the end of test generation.

java.lang.Throwable: Non-physical PsiElement. Physical element is required to be able to anchor the problem in the source tree: PsiFile:ListSample.kt; parent: PsiDirectory:C:\Users\t00814305\IdeaProjects\Kotlin\UTBotJavaSamples\src\main\kotlin\org\utbot\examples\collections; file: PsiFile:ListSample.kt
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
	at com.intellij.codeInspection.ProblemDescriptorBase.assertPhysical(ProblemDescriptorBase.java:115)
	at com.intellij.codeInspection.ProblemDescriptorBase.<init>(ProblemDescriptorBase.java:54)
	at com.intellij.codeInspection.InspectionManagerBase.createProblemDescriptor(InspectionManagerBase.java:105)
	at org.utbot.intellij.plugin.inspection.UnitTestBotInspectionTool.checkFile(UnitTestBotInspectionTool.kt:84)

@tyuldashev tyuldashev added ctg-bug Issue is a bug lang-kotlin Issue is related to Kotlin language support labels Dec 26, 2022
@tyuldashev tyuldashev moved this to Todo in UTBot Java Dec 26, 2022
@mmvpm mmvpm moved this from Todo to In Progress in UTBot Java Dec 26, 2022
@github-project-automation github-project-automation bot moved this from In Progress to Done in UTBot Java Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ctg-bug Issue is a bug lang-kotlin Issue is related to Kotlin language support
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants