https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
n

Nicholas Bilyk

07/26/2019, 3:19 PM
For Kotlin multiplatform projects, what's the correct way to access test resources from a test class? The working directory seems to most of the time be the project directory, although that doesn't seem to be the case when running via drone.io. I tried javaClass.getResource methods but that seems to only list class directories, not resource directories.
you need to use File with the path from the project root
n

Nicholas Bilyk

07/26/2019, 3:23 PM
yeah, that's what I'm doing, but for some reason that doesn't work on drone.io ... 🤔
any idea why the working directory would be different in CI than it is when running locally? (Gradle)
k

Kris Wong

07/26/2019, 3:39 PM
it's the same commands, so that should not be the case
assuming you're using the same commands on the build server 🙂
could be a difference between IDE and command line
n

Nicholas Bilyk

07/26/2019, 3:43 PM
yeah, same commands. Command line on my machine is fine ^_^
just double checked that because when you run
gradle build
it doesn't actually log "628 tests passed" or anything like that
it's kind of a problem because drone can't give you the test results html and it's a rather complicated process to get those reports published to a 3rd party service.
so I can see what test is failing, but not why