When running tests via the intellij runner, properties set using or in a gradle build file won't be picked up of course.

To support runtime System properties, the Kotest framework will always look for key value pairs inside a file located on the classpath. Any key value pairs located in this file will be set as a system property before any tests execute.

For example, after adding this file to your classpath as


The following test would pass:

class FooTest : DescribeSpec() {
init {
describe("after adding") {
it("foo should be set") {
System.getProperty("foo") shouldBe "bar"

Specifying the properties filename#

If you don't wish to name the file, or perhaps you want to support different files based on an environment, then you can use the system property to set the properties filename.

For example, you could launch tests with then the key value file named would be loaded before any tests are executed.