https://kotlinlang.org logo
Title
v

Viktor Orlyk

06/11/2022, 5:06 PM
Hi, all) want to use envs in tests but faced some problems, can you please help? More details in stackoverflow question. https://stackoverflow.com/questions/72586298/kotest-change-environment-variables
j

Jim

06/11/2022, 5:13 PM
I'm on a trip right now but can help when I get back Monday, I use withEnvironment all the time 👍 I think you might just need to set the correct override as the second argument to the withEnvironment call
❤️ 1
e

Emil Kantis

06/11/2022, 6:51 PM
Happens when you try to use withEnvironment with JDK17. If you try it with lower java version it should work. I'm not sure if there's any workaround right now
s

sam

06/11/2022, 9:57 PM
I think realistically the only "fix" is it not use env vars for this, but pass some variables in that you can then populate separately in tests.
e

Emil Kantis

06/13/2022, 12:33 PM
Came across this. Maybe something in there could work. https://github.com/junit-pioneer/junit-pioneer/issues/509
s

sam

06/13/2022, 1:15 PM
There is really no nicer way to say this: you should have read the documentation
lol
😂 1