Has anybody had any luck getting JS unit tests run...
# multiplatform
n
Has anybody had any luck getting JS unit tests running in Ubuntu? If I run allTests, in windows 10 I get JVM and JS test results, but in Ubuntu I only get the JVM side. (Using 1.3.50)
s
I don't have an Ubuntu machine (I'm a Solus man), but do you have the project handy? I can give it a run on Solus and see if it's distro-specific
n
I'm trying to get it to run in CI - it runs the correct tasks, but no reports are published for JS https://cloud.drone.io/polyforest/acornui/106/1/2
s
Odd, I'm not seeing results for JS either when running
./gradlew check
n
I feel like this was working in 1.3.41 but I couldn't stay on 41 because it had IDE performance problems
so I can't say for certain, I was only briefly on 41
50 is fast though (thank goodness)
For Linux I don't see kotlinNpmInstall anywhere in the build logs
s
Just ran it using 1.3.41 (specified via buildSrc) and still no JS results. Odd.
n
Are js tests running for you in other projects?
s
I intentionally avoid kotlin/JS 😛 but I can spin something up to test it locally
c
I've seen some weird stuff with Kotlin/JS try disabling incremental compilation
n
I don't think that's it, it happens in a fresh vm
I want to hear from someone that has seen kotlin js unit tests run in linux 🙂
Given that it's running fine but skipping js testing, I'm not entirely sure that the feature is supported yet..
s
I don't think it's skipping JS testing entirely, as it does generate output.bin files in
build/test-results/browserTest/binary
in a fresh Kotlin/JS project on 1.3.50
but those files are empty, so it's entirely possible that the actual tests just aren't running, for whatever reason
I think this is almost certainly a bug, and should be looked into
n
yeah, seems so, it's not doing the kotlin npm install stuff either
trying on a mac
s
JB ostensibly uses Macs, so it probably works there 😛
n
unfortunately it's CI that I really want to work 🙂
s
Yeah, multiplatform has some CI hitches... Especially on Linux, seemingly. Kotlin/Native ships with an outdated version of the clang toolchain, which looks for
libtinfo.so.5
, which has been merged into
libncurses
for a while now
n
other than js tests it's been working pretty well for me overall.
haven't tried kotlin native yet though
or webasm
yep, works on mac, just not linux
will file a bug
s
👍
n
thanks for help looking into it
s
No problem, happy to help!
a
I'm on Ubuntu and JS tests work for me. I mean if I add failing test then "check" task fails with reasonable output. Otherwise build successful.
c
Turns out my jsTest never executes!
NO-SOURCE
?
n
@Arkadii Ivanov I think my problem is that in CI and my windows Ubuntu sub-system I don't have any browsers, so listing the browsers to test does nothing. What browser do you have listed in your test configuration?
c
add
nodejs()
did the thing for me
n
I will try that.
I know that didn't work for me before, but I since changed to UMD module types instead of AMD, so that should theoretically work in NodeJS
Hmm, interesting! The tests run now! They fail because of some dependencies on browser things, but I may be able to catch that for the js tests.
c
you need at least one of
nodejs()
or
browsers()
n
That's what I was trying to say -- browser() works for mac and windows, not linux, but it may be because for linux it's CI or Ubuntu windows subsystem, which may not actually have any headless browsers that work with the tests
c
I think there is a chromium headless installation but it may still have dependencies not supported by WSL 1 it seems that WSL 2 will change that
n
It may be easier for me to get this running in nodejs than to get chromium headless installed in drone io
I would like a headless js mode anyway - like I have a headless jvm mode
c
yes. getting unit testing in node with mpp is straight forward unless you need special bindings to node specifics.
n
yeah, I just need to check for things like window.navigator
lol, the linux gods are spiting me... What the hell do I do to fix this? -????????? ? ? ? ? ? userInfo.kt
it can't see a file I'm editing
c
Ouch
n
The tests are all running now under node! A couple oddities I wasn't expecting - In node the Intl date classes aren't responding to locale changes. - kotlinx serialization isn't working - NodeJS apparently does base64 encoding differently
c
base64?? That shouldn't?
n
in a browser it's window.btoa and window.atob, nodejs doesn't have a window
a quick search suggests in node you're supposed to use 'Buffer'
which doesn't exist in a browser.. so 😛
W00t W00t
I had to ignore the i18n tests in node, but other than that I got it all working. And Base64 stuff switches to use Buffer
Thanks for the help. I might not have re-tried getting it to work in nodejs otehrwise.