Skip to content

Commit b555f53

Browse files
authored
Allow partly parallel Maven execution (#557)
2 parents b90e57a + 6f202a9 commit b555f53

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

jvm/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
## [2.5.4] - 2025-09-12
1616
### Fixed
1717
- 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))
18+
- 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))
1819
### Changed
1920
- Bump minimum required Kotest from `5.4.0` to `5.6.0` ([#535](https://github.com/diffplug/selfie/pull/535))
2021
- required to fix `java.lang.NoSuchMethodError: 'long kotlin.time.Duration$Companion.milliseconds-UwyO8pc(long)'`

jvm/selfie-runner-junit5/src/main/kotlin/com/diffplug/selfie/junit5/SnapshotFileLayoutJUnit5.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2023-2024 DiffPlug
2+
* Copyright (C) 2023-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,13 +27,16 @@ class SnapshotFileLayoutJUnit5(settings: SelfieSettingsAPI, override val fs: FS)
2727
internal val smuggledError =
2828
AtomicReference<Throwable?>(
2929
if (settings is SelfieSettingsSmuggleError) settings.error else null)
30-
override val rootFolder = TypedPath.ofFolder(settings.rootFolder.absolutePath)
31-
private val otherSourceRoots = settings.otherSourceRoots
30+
internal val settings = settings
31+
override val rootFolder: TypedPath by lazy {
32+
TypedPath.ofFolder(settings.rootFolder.absolutePath)
33+
}
34+
private val otherSourceRoots: List<java.io.File> by lazy { settings.otherSourceRoots }
3235
override val allowMultipleEquivalentWritesToOneLocation =
3336
settings.allowMultipleEquivalentWritesToOneLocation
3437
override val javaDontUseTripleQuoteLiterals = settings.javaDontUseTripleQuoteLiterals
3538
val snapshotFolderName = settings.snapshotFolderName
36-
internal val unixNewlines = inferDefaultLineEndingIsUnix(rootFolder, fs)
39+
internal val unixNewlines: Boolean by lazy { inferDefaultLineEndingIsUnix(rootFolder, fs) }
3740
val extension: String = ".ss"
3841
private val cache =
3942
SourcePathCache(this::computePathForCall, Runtime.getRuntime().availableProcessors() * 4)

jvm/selfie-runner-kotest/src/commonMain/kotlin/com/diffplug/selfie/kotest/SnapshotFileLayoutKotest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2024 DiffPlug
2+
* Copyright (C) 2024-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)