Is there are way to setup testballoon using the ko...
# testballoon
a
Is there are way to setup testballoon using the kotlin toolchain’s module.yaml file? Adding dependencies alone produces the following:
Copy code
ERROR: JVM tests failed for module 'experiment' with exit code 2 (no tests were discovered) (see errors above)
o
Yes, there is. The following message explains how to do it and the thread details why it currently is that way: https://kotlinlang.slack.com/archives/C062WG3A7T8/p1788386338985339?thread_ts=1788381943.063739&cid=C062WG3A7T8
a
thanks @Oliver.O for the reply. I will test the configuration.
d
BTW, @Oliver.O I know you are working with the Kotlin Toolchain folks for integrating TestBalloon. I have a recurring problem with the TESTBALLOON_INCLUDE_PATTERNS variable. If I define it in the
module.yml
, then my agents can’t override it. If I don’t define it, and despite I explain that in the docs for agents, my agents spend many credits trying to call the toolchain forgetting the
TESTBALLOON_INCLUDE_PATTERNS=*
or with
--include-classes
. Having a default value of “*” would help a lot!
o
I guess there is unfortunately not much TestBalloon could do. IIRC, Kotlin Toolchains invokes it with incompatible “class selectors”, which makes TestBalloon consider this invocation as directed at another “test engine” (e.g. JUnit Jupiter): github.com/infix-de/testBalloon/blob/…/TestBalloonJUnitPlatformTestEngine.kt#… If TestBalloon did not make this distinction and there would be two test frameworks in a module, TestBalloon would always run all of its tests, even if only one test was chosen for the other framework. The presence of
TESTBALLOON_INCLUDE_PATTERNS
overrides the “class selectors” and convinces TestBalloon that it is actually the target of the invocation. What you could do if you’re exclusively using TestBalloon: Set an environment variable at the shell / OS level of
TESTBALLOON_INCLUDE_PATTERNS='*'
. Would that help with your stubborn agents?
d
I will try defining it at the OS level.
👍 1
o
If you’re on a Mac, setting an environment variable which works beyond the shell in launcher-invoked apps can become ridiculously complex. Ping me if you’re not familiar with such tricks.
b
have you talked with the toolchain team about possible extensions here? it would be nice to avoid all this business with JUnit and class selectors
b
ah, looks like they’re aware 😄
o
Maybe it got a bit lost in that thread. CC @joffrey
d
@Oliver.O @Bruce Hamilton my most reliable hack!
Copy code
diff --git a/kotlin b/kotlin
index 61faebf..852ae50 100755
--- a/kotlin
+++ b/kotlin
@@ -298,5 +298,6 @@ download_and_extract "Kotlin Toolchain distribution v$kotlin_cli_version" "$kotl

 launcher_script="$kotlin_cli_target_dir/bin/launcher.sh"

+TESTBALLOON_INCLUDE_PATTERNS="${TESTBALLOON_INCLUDE_PATTERNS:-*}" \
 KOTLIN_CLI_WRAPPER_PATH="$(realpath "$0")" \
 exec /bin/sh "$launcher_script" "$@"
diff --git a/kotlin.bat b/kotlin.bat
index cae77d5..ac4c17d 100755
--- a/kotlin.bat
+++ b/kotlin.bat
@@ -271,6 +271,7 @@ if "%PROCESSOR_ARCHITECTURE%"=="ARM64" (
 rem We use busybox here because it doesn't reinterpret the user-passed command-line arguments (that we pass via %*).
 rem Also this way we can use the unified launcher script (.sh)
 set KOTLIN_CLI_WRAPPER_PATH=%~f0
+if not defined TESTBALLOON_INCLUDE_PATTERNS set TESTBALLOON_INCLUDE_PATTERNS=*

 rem The '& call' after the app run is to avoid the "Terminate batch job (Y/N)?" prompt
 "%busybox_exe%" sh "%kotlin_cli_target_dir%\bin\launcher.sh" %* & call :exitWithErrorLevel
thank you color 1
o
Makes sense. Thanks for sharing! kodee loving