Skip to content

Conversation

aSemy
Copy link
Contributor

@aSemy aSemy commented Jul 20, 2024

Improve performance of property-based tests by avoiding file IO operations.

  • Delete seed files once PBT iterations have completed sucessfully, instead of after every individual sucessful PBT iteration.
  • General tidying.
  • Now that performance is better, re-enable tests for forAll with 19, 20, 22 inputs.
  • Make proptest() a bit simpler - create new onSuccess() helper function.
  • Lazily initialise directories.
  • Remove unnecessary @file:Suppress("NOTHING_TO_INLINE") (helps with Building Kotest produces a lot of warnings, which make it difficult to identify problems #4085)

Related

Improve performance of property-based tests by avoiding file IO operations.

- Don't eagerly delete seed files. Instead, create a list and delete them once the PBT has completed.
- General tidying.
- Now that performance is better, re-enabling PBT for 19, 20, 22 inputs.
- Make `proptest()` a bit simpler - create new `onSuccess()` helper function.

TODO move to a different PR:

- GHA Cache .kotest dir
- improve `beEmptyDirectory()` messages
- Print PBT failure message in a single println (avoid splitting up the message over multiple lines, and avoid creating list)
@aSemy aSemy added the property-testing 📏 Related to the property testing mechanisms within the testing framework. label Jul 20, 2024
aSemy added 5 commits July 20, 2024 04:02
- Print the failure message in a single `println()` to avoid splitting the message.
- Directly create a string, and avoid creating intermediate lists.
…m/fix/optimise-pbt-seed-files

# Conflicts:
#	kotest-property/src/commonMain/kotlin/io/kotest/property/internal/test.kt
github-merge-queue bot pushed a commit that referenced this pull request Jul 20, 2024
- Print the failure message in a single `println()` to avoid splitting
the message.
- Directly create a string, and avoid creating intermediate lists.

The actual message content has not changed. This PR only affects how the
string is built.


Split out from #4183

Co-authored-by: Sam <sam@sksamuel.com>
aSemy and others added 6 commits July 20, 2024 14:06
- remove old code
- tidy up kdoc
- deprecate `*IfEnabled()` functions, and just always check if seed writing is enabled
- remove unnecessary `@file:Suppress("NOTHING_TO_INLINE")`
- remove `testPathsValueCache` - there's no need now that seed-file management is only done once per test
@aSemy aSemy marked this pull request as ready for review July 20, 2024 21:19
@aSemy aSemy requested a review from sksamuel July 20, 2024 21:19
@sksamuel sksamuel enabled auto-merge July 20, 2024 23:47
@sksamuel sksamuel added this pull request to the merge queue Jul 21, 2024
Merged via the queue into master with commit a4be8bc Jul 21, 2024
7 checks passed
@sksamuel sksamuel deleted the adam/fix/optimise-pbt-seed-files branch July 21, 2024 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
property-testing 📏 Related to the property testing mechanisms within the testing framework.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants