https://kotlinlang.org logo
n

Nicholas Bilyk

08/29/2019, 9:40 PM
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

serebit

08/29/2019, 9:41 PM
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

Nicholas Bilyk

08/29/2019, 9:42 PM
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

serebit

08/29/2019, 9:50 PM
Odd, I'm not seeing results for JS either when running
./gradlew check
n

Nicholas Bilyk

08/29/2019, 9:50 PM
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

serebit

08/29/2019, 9:58 PM
Just ran it using 1.3.41 (specified via buildSrc) and still no JS results. Odd.
n

Nicholas Bilyk

08/29/2019, 9:59 PM
Are js tests running for you in other projects?
s

serebit

08/29/2019, 9:59 PM
I intentionally avoid kotlin/JS 😛 but I can spin something up to test it locally
c

corneil

08/29/2019, 10:00 PM
I've seen some weird stuff with Kotlin/JS try disabling incremental compilation
n

Nicholas Bilyk

08/29/2019, 10:00 PM
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

serebit

08/29/2019, 10:08 PM
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

Nicholas Bilyk

08/29/2019, 10:08 PM
yeah, seems so, it's not doing the kotlin npm install stuff either
trying on a mac
s

serebit

08/29/2019, 10:09 PM
JB ostensibly uses Macs, so it probably works there 😛
n

Nicholas Bilyk

08/29/2019, 10:09 PM
unfortunately it's CI that I really want to work 🙂
s

serebit

08/29/2019, 10:10 PM
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

Nicholas Bilyk

08/29/2019, 10:12 PM
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

serebit

08/29/2019, 10:13 PM
👍
n

Nicholas Bilyk

08/29/2019, 10:17 PM
thanks for help looking into it
s

serebit

08/29/2019, 10:17 PM
No problem, happy to help!
a

Arkadii Ivanov

08/30/2019, 4:00 AM
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

corneil

08/30/2019, 7:26 AM
Turns out my jsTest never executes!
NO-SOURCE
?
n

Nicholas Bilyk

09/12/2019, 1:39 PM
@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

corneil

09/12/2019, 1:51 PM
add
nodejs()
did the thing for me
n

Nicholas Bilyk

09/12/2019, 1:52 PM
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

corneil

09/12/2019, 2:02 PM
you need at least one of
nodejs()
or
browsers()
n

Nicholas Bilyk

09/12/2019, 2:03 PM
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

corneil

09/12/2019, 2:04 PM
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

Nicholas Bilyk

09/12/2019, 2:06 PM
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

corneil

09/12/2019, 2:07 PM
yes. getting unit testing in node with mpp is straight forward unless you need special bindings to node specifics.
n

Nicholas Bilyk

09/12/2019, 2:08 PM
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

corneil

09/12/2019, 2:36 PM
Ouch
n

Nicholas Bilyk

09/12/2019, 3:02 PM
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

corneil

09/12/2019, 3:05 PM
base64?? That shouldn't?
n

Nicholas Bilyk

09/12/2019, 3:05 PM
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.
4 Views