Skip to content

Exception in Error message with saving test generation report when an empty test class is generated  #1425

Closed
@alisevych

Description

@alisevych

Description

Exception in Error message with saving SARIF report when an empty test class is generated (error report is only).

To Reproduce

  1. Run a project with JDK 11 in IntelliJ Idea
  2. Install exact plugin version
  3. Set Fuzzing only mode
  4. Generate tests for the following Java class:
public class Lambda {
    Function<String, Integer> returnLambda(int buffer) {
        return s -> s.length() + buffer;
    }
}

Expected behavior

Error message should not be shown - especially with exception stack trace.

Actual behavior

Error message Failed to save tests report is shown with java.lang.IllegalStateException No executables found in test report stack trace.

Visual proofs (screenshots, logs, images)

image

Cannot save tests generation report: error occurred 'No executables found in test report, reason: java.lang.IllegalStateException: No executables found in test report 

at org.utbot.framework.codegen.reports.TestsGenerationReport.getClassUnderTest(TestsGenerationReport.kt:24) 
at org.utbot.framework.codegen.reports.TestsGenerationReport.toString(TestsGenerationReport.kt:76) 
at org.utbot.framework.process.EngineMainKt$setup$10.invoke(EngineMain.kt:205) 
at org.utbot.framework.process.EngineMainKt$setup$10.invoke(EngineMain.kt:193) 
at org.utbot.rd.CallsSynchronizer$measureExecutionForTermination$1$1.invoke(ClientProcessUtil.kt:84) 
at org.utbot.rd.CallsSynchronizer.measureExecutionForTermination(ClientProcessUtil.kt:75) 
at org.utbot.rd.CallsSynchronizer$measureExecutionForTermination$1.invoke(ClientProcessUtil.kt:83) 
at com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:182) 
at com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:182) 
at com.jetbrains.rd.framework.impl.RdCall.onWireReceived(RdTask.kt:360) 
at com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:57) 
at com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:56) 
at com.jetbrains.rd.framework.impl.ProtocolContexts.readMessageContextAndInvoke(ProtocolContexts.kt:148) 
at com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:56) 
at com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:54) 
at com.jetbrains.rd.util.threading.SingleThreadSchedulerBase.queue$lambda-3(SingleThreadScheduler.kt:41) 
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 
at java.base/java.lang.Thread.run(Thread.java:829)

Environment

Windows 10 Pro
IntelliJ IDEA 2022.2.3
Gradle project
JDK 11

Additional context

There was an error in concrete executor that led to error-test only - and in fact empty test class.
It is fixed already. SO please use the following plugin version:
https://github.com/UnitTestBot/UTBotJava/actions/runs/3538142501

Metadata

Metadata

Labels

ctg-bugIssue is a bug

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions