Skip to content

Commit

Permalink
fixing the kotest autoscan warning message to reference the right pro…
Browse files Browse the repository at this point in the history
…perty name (#4000)

The original warning message was referencing property:
```
kotest.framework.classpath.scanning.config.disable
```
which doesn't exist. 
With this change, the right property name is dynamically resolved and
currently would resolve to:
```
kotest.framework.classpath.scanning.autoscan.disable
```

---------

Co-authored-by: OliverO2 <Oliver.O456i@gmail.com>
  • Loading branch information
stepanv and OliverO2 committed May 9, 2024
1 parent 5162c84 commit ea483aa
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -22,7 +22,12 @@ internal actual fun applyConfigFromAutoScan(configuration: ProjectConfiguration)
return
}

println("Warning: Kotest autoscan is enabled. This means Kotest will scan the classpath for extensions that are annotated with @AutoScan. To avoid this startup cost, set autoscan to false by setting the system property 'kotest.framework.classpath.scanning.config.disable=true'. In 6.0 this value will default to true. For further details see https://kotest.io/docs/next/framework/project-config.html#runtime-detection")
println("Warning: Kotest autoscan is enabled. This means Kotest will scan the classpath for extensions that are "
+ "annotated with @AutoScan. To avoid this startup cost, disable autoscan by setting the system property "
+ "'${KotestEngineProperties.disableAutoScanClassPathScanning}=true'. "
+ "In 6.0 this value will default to true. For further details see "
+ "https://kotest.io/docs/next/framework/project-config.html#runtime-detection"
)

classgraph().scan().use { result ->
result.getClassesWithAnnotation(AutoScan::class.java.name)
Expand Down

0 comments on commit ea483aa

Please sign in to comment.