Skip to content

Commit c92ec6e

Browse files
committed
Remove redundant debug logs and unused methods in console and callback classes
Cleaned up unused print statements, removed deprecated debug logs, and eliminated unused methods in `KotestServiceMessageCallback` and console-related classes for better code clarity and maintainability.
1 parent 43ccc46 commit c92ec6e

File tree

4 files changed

+3
-40
lines changed

4 files changed

+3
-40
lines changed

src/main/kotlin/io/kotest/plugin/intellij/console/KotestExecutionConsoleManager.kt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,6 @@ class KotestExecutionConsoleManager : ExternalSystemExecutionConsoleManager<SMTR
6565
// sets up the process listener on the console view, using the properties that were passed to the console
6666
SMTestRunnerConnectionUtil.initConsoleView(console, Constants.FRAMEWORK_NAME)
6767

68-
// console.resultsViewer.testsRootNode.executionId = env.executionId
69-
// console.resultsViewer.testsRootNode.setSuiteStarted()
70-
71-
// publisher.onSuiteStarted(console.resultsViewer.testsRootNode)
72-
// console.resultsViewer.onSuiteStarted(console.resultsViewer.testsRootNode)
73-
74-
processHandler.addProcessListener(object : ProcessListener {
75-
override fun onTextAvailable(event: ProcessEvent, outputType: Key<*>) {
76-
println("text=${event.text} outputType=${outputType}")
77-
}
78-
})
79-
8068
val testsRootNode = console.resultsViewer.testsRootNode
8169
testsRootNode.executionId = env.executionId
8270
testsRootNode.setSuiteStarted()

src/main/kotlin/io/kotest/plugin/intellij/console/KotestSMTRunnerConsole.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package io.kotest.plugin.intellij.console
22

33
import com.intellij.build.BuildViewSettingsProvider
44
import com.intellij.execution.Platform
5-
import com.intellij.execution.filters.HyperlinkInfo
65
import com.intellij.execution.testframework.sm.runner.SMTRunnerEventsListener
76
import com.intellij.execution.testframework.sm.runner.SMTestProxy
87
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView
@@ -33,10 +32,6 @@ class KotestSMTRunnerConsole(
3332

3433
override fun isExecutionViewHidden() = false
3534

36-
override fun printHyperlink(hyperlinkText: String, info: HyperlinkInfo?) {
37-
super.printHyperlink(hyperlinkText, info)
38-
}
39-
4035
override fun print(s: String, contentType: ConsoleViewContentType) {
4136
if (detectUnwantedEmptyLine(s)) return
4237
super.print(s, contentType)

src/main/kotlin/io/kotest/plugin/intellij/console/KotestServiceMessageCallback.kt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,11 @@ class KotestServiceMessageCallback(
1919

2020
// this is text that was a service message but couldn't be parsed
2121
override fun parseException(p0: ParseException, p1: String) {
22-
println("Error parsing test result: $p1")
2322
console.notifyWarn("Error parsing test result", p0.message ?: "")
2423
}
2524

2625
// this is text that wasn't a service message, we don't care about this
2726
override fun regularText(p0: String) {
28-
if (p0.isNotBlank())
29-
println("Regular text: $p0")
3027
}
3128

3229
override fun serviceMessage(msg: ServiceMessage) {
@@ -67,7 +64,6 @@ class KotestServiceMessageCallback(
6764
console.publisher.onTestIgnored(proxy)
6865
}
6966
ServiceMessageTypes.TEST_FAILED -> {
70-
println("Handle test failed message $msg")
7167
val proxy = getProxy(msg)
7268
val attrs = MessageAttributeParser.parse(msg)
7369
proxy.setTestFailed(attrs.message, attrs.details, true)
@@ -78,25 +74,6 @@ class KotestServiceMessageCallback(
7874
}
7975
}
8076

81-
/**
82-
* Adds a placeholder to the console to indicate that no tests were found (if necessary).
83-
*/
84-
fun addNoTestsPlaceholder() {
85-
val proxy = TestProxyBuilder.builder("No tests were found", false, root()).build()
86-
proxy.setStarted()
87-
88-
console.resultsViewer.onTestStarted(proxy)
89-
console.publisher.onTestStarted(proxy)
90-
91-
proxy.setTestFailed("No tests were found", null, true)
92-
console.resultsViewer.onTestFailed(proxy)
93-
console.publisher.onTestFailed(proxy)
94-
95-
proxy.setFinished()
96-
console.resultsViewer.onTestFinished(proxy)
97-
console.publisher.onTestFinished(proxy)
98-
}
99-
10077
private fun createProxy(msg: ServiceMessage, suite: Boolean): SMTestProxy {
10178
val attrs = MessageAttributeParser.parse(msg)
10279
val parentId = attrs.parentId

src/main/kotlin/io/kotest/plugin/intellij/run/TestOrSpecGradleRunConfigurationProducer.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ class TestOrSpecGradleRunConfigurationProducer : GradleRunConfigurationProducer(
7474
val project = context.project ?: return false
7575
val module = context.module ?: return false
7676

77+
println("module = " + module.name)
78+
7779
// we must have the element we clicked on as we are running from the gutter
7880
val element = sourceElement.get() ?: return false
7981

@@ -85,6 +87,7 @@ class TestOrSpecGradleRunConfigurationProducer : GradleRunConfigurationProducer(
8587

8688
// this is the path to the project on the file system
8789
val modulePath = GradleUtils.resolveModulePath(module) ?: return false
90+
println("modulePath = " + modulePath)
8891

8992
// this is the psi element associated with the run, needed by the JavaRunConfigurationExtensionManager
9093
val location = context.location ?: return false

0 commit comments

Comments
 (0)