I am kicking off a new :thread: for browser-based ...
# kotest-contributors
b
I am kicking off a new đŸ§µ for browser-based tests. In browser environments, using SystemFileSystem will result in a hard fail (runtime exception). So how does kotlin.test handle it? I don't know but I have a really hacky Idea how we can make it happen: • Start a webserver on a random port (or specify it in the test config) • Let the test runner in the browser push test results to the web server • Let the web server save the reports to disk • ??? • Profit So this hard fail could explain why my prototype didn't even show tests being run, id the file system is accessed early enough. (I'm now AFK for 2-3 hours)
s
the other way that's probably less hacky is that the Kotest Gradle Plugin JS Task can pipe the results and parse the output and then use that. We already have the parsers (other plugins use it) and that's the way it works for some other non-kotest gradle plugins
b
Does piping like that work on windows hosts? A TCP socket is universal. Personally, I think the less hacky the better, as long as it's portable
s
Actually it won't work because if you're not in intellij the output is just plain text. I'll think on it.
Working on the other issues atm
b
I probably won't have time to get a working prototype done any time soon, but using ktor, a quick and dirty solution should be less than 200 LoC. Doing it properly though, requires considering security implications. From the top of my head, I don't see any because of you put secrets into your test report you're doing it wrong anyway, but even localhost-only ports defeat process isolation, so at least some auth should be there. mTLS is probably overkill, but I need to think about this as well
a
I haven't been keeping up to date with the new Kotest plugin, but last time I looked into this I thought using Ktor to host the K/JS files and Playwright to run the browser would be best https://kotlinlang.slack.com/archives/CSYLDDZUY/p1712419742142749
(Just sharing in case there's info that helps - I'm not suggesting my way would be better :))
b
Dummy question: wasn't TeamCity-style report genration deliberately removed from Kotest during the 6.0 Cycle?
a
hmmm do you have more info? I have a vague recollection, but I think that was about something else.
(and no problem with dummy questions, keep them coming :))
b
I just looked at the commit history a couple of weeks ago, so I really have no more concrete info
a
I suspect it's unrelated. Kotlin/JS tests using TeamCity log format for JS tests is an internal implementation detail, and is only used to encode/decode messages (sent over stdout) from the JS tests to KGP.
b
well then why did all the non-jvm test report disappear?
a
sorry, I'm not sure what you mean
b
I seem to recall that Kotest 4 and 5 produced reports on all platforms