@@ -140,14 +140,14 @@ object CodeGenerationController {
140
140
}
141
141
}
142
142
143
- run (THREAD_POOL , indicator) {
143
+ run (THREAD_POOL , indicator, " Waiting for per-class Sarif reports " ) {
144
144
waitForCountDown(latch, indicator = indicator) {
145
- run (EDT_LATER , indicator) {
146
- run (WRITE_ACTION , indicator) {
145
+ run (EDT_LATER , indicator, " Go to EDT for utility class creation " ) {
146
+ run (WRITE_ACTION , indicator, " Need write action for utility class creation " ) {
147
147
createUtilityClassIfNeed(utilClassListener, model, baseTestDirectory, indicator)
148
- run (EDT_LATER , indicator) {
148
+ run (EDT_LATER , indicator, " Proceed test report " ) {
149
149
proceedTestReport(proc, model)
150
- run (THREAD_POOL , indicator) {
150
+ run (THREAD_POOL , indicator, " Generate summary Sarif report " ) {
151
151
val sarifReportsPath =
152
152
model.testModule.getOrCreateSarifReportsPath(model.testSourceRoot)
153
153
UtTestsDialogProcessor .updateIndicator(indicator, UtTestsDialogProcessor .ProgressRange .SARIF , " Merge Sarif reports" , 0.75 )
@@ -157,9 +157,9 @@ object CodeGenerationController {
157
157
RunConfigurationHelper .runTestsWithCoverage(model, testFilesPointers)
158
158
}
159
159
proc.forceTermination()
160
- UtTestsDialogProcessor .updateIndicator(indicator, UtTestsDialogProcessor .ProgressRange .SARIF , " Start tests with coverage " , 1.0 )
160
+ UtTestsDialogProcessor .updateIndicator(indicator, UtTestsDialogProcessor .ProgressRange .SARIF , " Generation finished " , 1.0 )
161
161
162
- invokeLater {
162
+ run ( EDT_LATER , null , " Run sarif-based inspections " ) {
163
163
runInspectionsIfNeeded(model, srcClassPathToSarifReport)
164
164
}
165
165
}
@@ -339,8 +339,8 @@ object CodeGenerationController {
339
339
340
340
val utUtilsText = utilClassKind.getUtilClassText(model.codegenLanguage)
341
341
342
- run (EDT_LATER , indicator) {
343
- run (WRITE_ACTION , indicator) {
342
+ run (EDT_LATER , indicator, " Overwrite utility class " ) {
343
+ run (WRITE_ACTION , indicator, " Overwrite utility class " ) {
344
344
unblockDocument(model.project, utilsClassDocument)
345
345
executeCommand {
346
346
utilsClassDocument.setText(utUtilsText.replace(" jdk.internal.misc" , " sun.misc" ))
@@ -510,7 +510,7 @@ object CodeGenerationController {
510
510
private fun waitForCountDown (latch : CountDownLatch , timeout : Long = 5, timeUnit : TimeUnit = TimeUnit .SECONDS , indicator : ProgressIndicator , action : Runnable ) {
511
511
try {
512
512
if (! latch.await(timeout, timeUnit)) {
513
- run (THREAD_POOL , indicator) { waitForCountDown(latch, timeout, timeUnit, indicator, action) }
513
+ run (THREAD_POOL , indicator, " Waiting for ${latch.count} sarif report(s) in a loop " ) { waitForCountDown(latch, timeout, timeUnit, indicator, action) }
514
514
} else {
515
515
action.run ()
516
516
}
@@ -633,7 +633,7 @@ object CodeGenerationController {
633
633
val editor = CodeInsightUtil .positionCursorAtLBrace(testClass.project, filePointer.containingFile, testClass)
634
634
// TODO: Use PsiDocumentManager.getInstance(model.project).getDocument(file)
635
635
// if we don't want to open _all_ new files with tests in editor one-by-one
636
- run (THREAD_POOL , indicator) {
636
+ run (THREAD_POOL , indicator, " Rendering test code " ) {
637
637
val (generatedTestsCode, utilClassKind) = try {
638
638
proc.render(
639
639
testSetsId,
@@ -658,8 +658,8 @@ object CodeGenerationController {
658
658
return @run
659
659
}
660
660
utilClassListener.onTestClassGenerated(utilClassKind)
661
- run (EDT_LATER , indicator) {
662
- run (WRITE_ACTION , indicator) {
661
+ run (EDT_LATER , indicator, " Writing generation text to documents " ) {
662
+ run (WRITE_ACTION , indicator, " Writing generation text to documents " ) {
663
663
try {
664
664
unblockDocument(testClass.project, editor.document)
665
665
// TODO: JIRA:1246 - display warnings if we rewrite the file
@@ -679,9 +679,9 @@ object CodeGenerationController {
679
679
680
680
// reformatting before creating reports due to
681
681
// SarifReport requires the final version of the generated tests code
682
- run (THREAD_POOL , indicator) {
682
+ // run(THREAD_POOL, indicator, "Intention helper" ) {
683
683
// IntentionHelper(model.project, editor, filePointer).applyIntentions()
684
- run (EDT_LATER , indicator) {
684
+ run (EDT_LATER , indicator, " Tests reformatting " ) {
685
685
try {
686
686
runWriteCommandAction(filePointer.project, " UtBot tests reformatting" , null , {
687
687
reformat(model, filePointer, testClassUpdated)
@@ -709,7 +709,7 @@ object CodeGenerationController {
709
709
710
710
unblockDocument(testClassUpdated.project, editor.document)
711
711
}
712
- }
712
+ // }
713
713
}
714
714
}
715
715
}
0 commit comments