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

Test class is not generated in debug IDEA #2601

Closed
alisevych opened this issue Sep 15, 2023 · 4 comments
Closed

Test class is not generated in debug IDEA #2601

alisevych opened this issue Sep 15, 2023 · 4 comments
Assignees
Labels
comp-codegen Issue is related to code generator comp-spring Issue is related to Spring projects support ctg-bug Issue is a bug ctg-qa Issue is related to QA process

Comments

@alisevych
Copy link
Member

alisevych commented Sep 15, 2023

Description

Test generation ends without creating test class in a Spring project

To Reproduce

  1. Open utbot project in IntelliJ IDEA Ultimate
  2. update and checkout main branch
  3. Run runIde gradle task
  4. Open spring-petclinic in debug IDEA
  5. Generate Unit tests with No configuration for VetController

Expected behavior

VetControllerTest class should be generated.

Actual behavior

No resulting test class is generated.
Generate test cases for class VetController in inline progress panel was shown.
Tests are generated (see logs), but code generation is not started.

Screenshots, logs

13:18:05.476 | INFO  | EngineProcessMain         | -----------------------------------------------------------------------
13:18:05.477 | INFO  | EngineProcessMain         | -------------------NEW ENGINE PROCESS STARTED--------------------------
13:18:05.477 | INFO  | EngineProcessMain         | -----------------------------------------------------------------------
13:18:05.753 | INFO  | AnalyticsConfigureUtil    | PathSelectorType: INHERITORS_SELECTOR
13:18:18.984 | INFO  | TestCaseGenerator         | Resuming method org.springframework.samples.petclinic.vet.VetController.showResourcesVetList
13:18:19.734 | INFO  | JavaLanguage              | Starting fuzzing for method: org.springframework.samples.petclinic.vet.VetController.showVetList
13:18:19.735 | INFO  | JavaLanguage              | 	use thisInstance = true
13:18:19.736 | INFO  | JavaLanguage              | 	parameters = [int, org.springframework.ui.Model]
13:18:19.856 | INFO  | InstrumentedProcess       | ------------------------------------------------------------------
--------Instrumented process started with PID=26512--------
------------------------------------------------------------------
13:18:19.871 | INFO  | JavaLanguage              | Starting fuzzing for method: org.springframework.samples.petclinic.vet.VetController.showResourcesVetList
13:18:19.871 | INFO  | JavaLanguage              | 	use thisInstance = true
13:18:19.871 | INFO  | JavaLanguage              | 	parameters = []
13:18:20.085 | INFO  | TestCaseGenerator         | Resuming method org.springframework.samples.petclinic.vet.VetController.showVetList
13:18:21.185 | INFO  | TestCaseGenerator         | Resuming method org.springframework.samples.petclinic.vet.VetController.showResourcesVetList
13:18:22.285 | INFO  | TestCaseGenerator         | Resuming method org.springframework.samples.petclinic.vet.VetController.showVetList
13:18:22.563 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/samples/petclinic/vet/VetController 
13:18:22.677 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/data/domain/Pageable 
13:18:22.680 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/samples/petclinic/vet/VetRepository 
13:18:22.681 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/data/repository/Repository 
13:18:22.684 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/stereotype/Indexed 
13:18:22.692 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/samples/petclinic/vet/Vet 
13:18:22.696 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/samples/petclinic/model/Person 
13:18:22.699 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/samples/petclinic/model/BaseEntity 
13:18:22.705 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/dao/DataAccessException 
13:18:22.714 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/core/NestedRuntimeException 
13:18:22.721 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/data/domain/Page 
13:18:22.725 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/data/domain/Slice 
13:18:22.735 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/data/util/Streamable 
13:18:22.738 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/transaction/annotation/Transactional 
13:18:22.742 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/transaction/annotation/Isolation 
13:18:22.745 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/transaction/annotation/Propagation 
13:18:22.749 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/aot/hint/annotation/Reflective 
13:18:22.753 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/cache/annotation/Cacheable 
13:18:22.791 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/aot/hint/annotation/SimpleReflectiveProcessor 
13:18:22.793 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/aot/hint/annotation/ReflectiveProcessor 
13:18:22.806 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/samples/petclinic/vet/VetRepository$MockitoMock$5AjRpuAs 
13:18:22.808 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/samples/petclinic/vet/VetRepository$MockitoMock$5AjRpuAs$auxiliary$o6O2ik0r 
13:18:22.810 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/samples/petclinic/vet/VetRepository$MockitoMock$5AjRpuAs$auxiliary$wKGNLQMm 
13:18:22.822 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/samples/petclinic/vet/Vets 
13:18:22.825 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/ui/Model 
13:18:22.839 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/data/domain/PageRequest 
13:18:22.849 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/data/domain/AbstractPageRequest 
13:18:22.859 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/data/domain/Sort 
13:18:22.879 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/data/domain/Sort$Order 
13:18:22.904 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/util/Assert 
13:18:22.915 | INFO  | InstrumentedProcess       | RdCategory: DynamicClassTransformer   | Transformed: org/springframework/data/domain/Sort$Direction 
13:18:23.248 | INFO  | UtBotSymbolicEngine       | Fuzzing overtime: org.springframework.samples.petclinic.vet.VetController.showVetList
13:18:23.249 | INFO  | UtBotSymbolicEngine       | Test created by fuzzer: 1
13:18:23.250 | INFO  | JavaLanguage              | Finishing fuzzing for method: org.springframework.samples.petclinic.vet.VetController.showVetList in 3515 ms
13:18:23.250 | INFO  | JavaLanguage              | 	Total execution called: 2
13:18:23.262 | INFO  | MockValueProvider         | Detected that org.springframework.samples.petclinic.vet.VetRepository.findAll may need mocking
13:18:23.262 | INFO  | MockValueProvider         | Detected that java.util.Collection.toArray may need mocking
13:18:23.309 | INFO  | UtBotSymbolicEngine       | Fuzzing overtime: org.springframework.samples.petclinic.vet.VetController.showResourcesVetList
13:18:23.310 | INFO  | UtBotSymbolicEngine       | Test created by fuzzer: 1
13:18:23.310 | INFO  | JavaLanguage              | Finishing fuzzing for method: org.springframework.samples.petclinic.vet.VetController.showResourcesVetList in 3439 ms
13:18:23.310 | INFO  | JavaLanguage              | 	Total execution called: 2
13:18:23.385 | INFO  | TestCaseGenerator         | Resuming method org.springframework.samples.petclinic.vet.VetController.showResourcesVetList
13:18:23.399 | INFO  | TestCaseGenerator         | Resuming method org.springframework.samples.petclinic.vet.VetController.showVetList
13:18:23.410 | INFO  | ConcreteExecutor          | RdCategory: Server                    | ServerSocket: start terminating lifetime 
13:18:23.414 | INFO  | ConcreteExecutor          | RdCategory: Server                    | ServerSocket: termination finished 
13:18:23.423 | WARN  | ConcreteExecutor          | RdCategory: Client                    | ClientSocket: Exception raised during ACK, seqn = 8785 

Environment

IntelliJ IDEA version - 2023.2 (Community Edition)
Project - spring-petclinic Gradle/Maven
JDK - 17

Additional context

Not reproducing in IntelliJ IDEA 2023.2 (Ultimate Edition) when plugin built from same main is installed.
Test class is generated.

Found by autotest: org.utbot.tests.SpringUTBotActionTest#checkSpringUnitTestsGeneration

@alisevych alisevych added ctg-bug Issue is a bug comp-codegen Issue is related to code generator comp-spring Issue is related to Spring projects support labels Sep 15, 2023
@alisevych alisevych added this to the Spring Phase 4 milestone Sep 15, 2023
@IlyaMuravjov
Copy link
Collaborator

Can't reproduce. Can you check that it reproduces consistently for you, so we know whether it's a flaky issue or I have something configured differently?

@alisevych
Copy link
Member Author

@IlyaMuravjov
This issue is reproducing constantly for me. I've restarted IDEA and OS several times, changing JAVA_HOME and PATH.

@alisevych
Copy link
Member Author

Also I've checked test generation in debug IDEA in another project - same issue.

@alisevych alisevych added the ctg-qa Issue is related to QA process label Sep 26, 2023
@alisevych
Copy link
Member Author

Issue not reproducing on the newest main any more.
Tried with IU and IC ideType.

@alisevych alisevych closed this as not planned Won't fix, can't repro, duplicate, stale Sep 29, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in UTBot Java Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-codegen Issue is related to code generator comp-spring Issue is related to Spring projects support ctg-bug Issue is a bug ctg-qa Issue is related to QA process
Projects
Archived in project
Development

No branches or pull requests

2 participants