diff --git a/jvm/CHANGELOG.md b/jvm/CHANGELOG.md index 16579724..7aaba6a8 100644 --- a/jvm/CHANGELOG.md +++ b/jvm/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Fixed - Unsupported test sources (such as `FieldSource`) no longer cause the JUnit5 runner to crash. ([#550](https://github.com/diffplug/selfie/pull/550) fixes [#549](https://github.com/diffplug/selfie/issues/549)) +- Partly allow parallel Maven execution with surefire and failsafe plugins with `forkCount` greater than one by making evaluation of few properties lazy. This postpones evaluation into the forks. Still, due to internal Selfie state tracking, this needs to be run with `reuseForks` set to `false`. ([#557](https://github.com/diffplug/selfie/pull/557) partly fixes [#551](https://github.com/diffplug/selfie/issues/551)) ### Changed - Bump minimum required Kotest from `5.4.0` to `5.6.0` ([#535](https://github.com/diffplug/selfie/pull/535)) - required to fix `java.lang.NoSuchMethodError: 'long kotlin.time.Duration$Companion.milliseconds-UwyO8pc(long)'` diff --git a/jvm/selfie-runner-junit5/src/main/kotlin/com/diffplug/selfie/junit5/SnapshotFileLayoutJUnit5.kt b/jvm/selfie-runner-junit5/src/main/kotlin/com/diffplug/selfie/junit5/SnapshotFileLayoutJUnit5.kt index 6c8590bc..e620fcdf 100644 --- a/jvm/selfie-runner-junit5/src/main/kotlin/com/diffplug/selfie/junit5/SnapshotFileLayoutJUnit5.kt +++ b/jvm/selfie-runner-junit5/src/main/kotlin/com/diffplug/selfie/junit5/SnapshotFileLayoutJUnit5.kt @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023-2024 DiffPlug + * Copyright (C) 2023-2025 DiffPlug * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,13 +27,16 @@ class SnapshotFileLayoutJUnit5(settings: SelfieSettingsAPI, override val fs: FS) internal val smuggledError = AtomicReference( if (settings is SelfieSettingsSmuggleError) settings.error else null) - override val rootFolder = TypedPath.ofFolder(settings.rootFolder.absolutePath) - private val otherSourceRoots = settings.otherSourceRoots + internal val settings = settings + override val rootFolder: TypedPath by lazy { + TypedPath.ofFolder(settings.rootFolder.absolutePath) + } + private val otherSourceRoots: List by lazy { settings.otherSourceRoots } override val allowMultipleEquivalentWritesToOneLocation = settings.allowMultipleEquivalentWritesToOneLocation override val javaDontUseTripleQuoteLiterals = settings.javaDontUseTripleQuoteLiterals val snapshotFolderName = settings.snapshotFolderName - internal val unixNewlines = inferDefaultLineEndingIsUnix(rootFolder, fs) + internal val unixNewlines: Boolean by lazy { inferDefaultLineEndingIsUnix(rootFolder, fs) } val extension: String = ".ss" private val cache = SourcePathCache(this::computePathForCall, Runtime.getRuntime().availableProcessors() * 4) diff --git a/jvm/selfie-runner-kotest/src/commonMain/kotlin/com/diffplug/selfie/kotest/SnapshotFileLayoutKotest.kt b/jvm/selfie-runner-kotest/src/commonMain/kotlin/com/diffplug/selfie/kotest/SnapshotFileLayoutKotest.kt index e6be8754..8e532826 100644 --- a/jvm/selfie-runner-kotest/src/commonMain/kotlin/com/diffplug/selfie/kotest/SnapshotFileLayoutKotest.kt +++ b/jvm/selfie-runner-kotest/src/commonMain/kotlin/com/diffplug/selfie/kotest/SnapshotFileLayoutKotest.kt @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 DiffPlug + * Copyright (C) 2024-2025 DiffPlug * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.