Skip to content
Permalink
Browse files

Property test rework (#1135)

* Reworking property tests to allow for suspension, seeds, and other configuration

* Moved new property testing to a seperate module; added kts build scripts; moved map and filter to Gen

* Converted all remaining gradle files to kts

* Added constant Arb, added PropArgs container, added tests

* Added string arb with tests; added forAll1

* Added arbitrary of maps and added MapShrinker

* Added arbitrary for maps generated from two seperate generators

* Added multiples arbitrary; moved some arbitraries to proper package

* Added check for all non-boolean version of properties; forAll delegates to this now

* Added test1/test3 versions of property tests

* Added collection arbs and constant progression; some reorg

* Catching all exceptions in prop tests

* feedback

* feedback

* feedback

* feedback

* Renamed package

* Fixed imports
  • Loading branch information
sksamuel committed Dec 27, 2019
1 parent c452f94 commit cd91426af2430309b293684464ab776e929d48d8
Showing with 3,817 additions and 1,396 deletions.
  1. +49 −59 build.gradle
  2. +1 −1 gradle/wrapper/gradle-wrapper.properties
  3. +0 −88 kotest-assertions/build.gradle
  4. +95 −0 kotest-assertions/build.gradle.kts
  5. +0 −47 kotest-assertions/kotest-assertions-arrow/build.gradle
  6. +70 −0 kotest-assertions/kotest-assertions-arrow/build.gradle.kts
  7. +0 −43 kotest-assertions/kotest-assertions-json/build.gradle
  8. +69 −0 kotest-assertions/kotest-assertions-json/build.gradle.kts
  9. +0 −54 kotest-assertions/kotest-assertions-jsoup/build.gradle
  10. +69 −0 kotest-assertions/kotest-assertions-jsoup/build.gradle.kts
  11. +0 −40 kotest-assertions/kotest-assertions-ktor/build.gradle
  12. +69 −0 kotest-assertions/kotest-assertions-ktor/build.gradle.kts
  13. +2 −0 kotest-assertions/src/commonMain/kotlin/io/kotest/assertions/show/Show.kt
  14. +1 −1 kotest-assertions/src/commonMain/kotlin/io/kotest/matchers/collections/matchers.kt
  15. +90 −83 kotest-assertions/src/commonMain/kotlin/io/kotest/properties/Gen.kt
  16. +1 −0 kotest-assertions/src/commonMain/kotlin/io/kotest/properties/PropertyContext.kt
  17. +1 −0 kotest-assertions/src/commonMain/kotlin/io/kotest/properties/PropertyTesting.kt
  18. +47 −0 kotest-assertions/src/commonMain/kotlin/io/kotest/properties/PropertyTestingAssertAll.kt
  19. +41 −0 kotest-assertions/src/commonMain/kotlin/io/kotest/properties/PropertyTestingForAll.kt
  20. +1 −0 kotest-assertions/src/commonMain/kotlin/io/kotest/properties/defaults.kt
  21. +3 −0 kotest-assertions/src/commonMain/kotlin/io/kotest/properties/errors.kt
  22. +21 −0 kotest-assertions/src/commonMain/kotlin/io/kotest/properties/gens.kt
  23. +21 −8 kotest-assertions/src/commonMain/kotlin/io/kotest/properties/shrinking/IntShrinker.kt
  24. +1 −1 kotest-assertions/src/commonMain/kotlin/io/kotest/properties/shrinking/shrink.kt
  25. +5 −0 kotest-assertions/src/commonMain/kotlin/io/kotest/properties/tests.kt
  26. +38 −0 kotest-assertions/src/commonMain/kotlin/io/kotest/tuples/tuples.kt
  27. +0 −66 kotest-core/build.gradle
  28. +72 −0 kotest-core/build.gradle.kts
  29. +67 −4 kotest-core/src/commonMain/kotlin/io/kotest/specs/FunSpec.kt
  30. +0 −53 kotest-extensions/build.gradle
  31. +72 −0 kotest-extensions/build.gradle.kts
  32. +0 −51 kotest-extensions/kotest-extensions-allure/build.gradle
  33. +74 −0 kotest-extensions/kotest-extensions-allure/build.gradle.kts
  34. +0 −49 kotest-extensions/kotest-extensions-koin/build.gradle
  35. +69 −0 kotest-extensions/kotest-extensions-koin/build.gradle.kts
  36. +0 −48 kotest-extensions/kotest-extensions-robolectric/build.gradle
  37. +68 −0 kotest-extensions/kotest-extensions-robolectric/build.gradle.kts
  38. +0 −53 kotest-extensions/kotest-extensions-spring/build.gradle
  39. +74 −0 kotest-extensions/kotest-extensions-spring/build.gradle.kts
  40. +0 −48 kotest-plugins/kotest-plugins-pitest/build.gradle
  41. +78 −0 kotest-plugins/kotest-plugins-pitest/build.gradle.kts
  42. +96 −0 kotest-property/build.gradle.kts
  43. +90 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/Arbitrary.kt
  44. +71 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/Gen.kt
  45. +32 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/Progression.kt
  46. +28 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/Shrinker.kt
  47. +19 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/ShrinkingMode.kt
  48. +24 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/arbitraries.kt
  49. +21 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/collections.kt
  50. +70 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/doubles.kt
  51. +71 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/floats.kt
  52. +96 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/ints.kt
  53. +38 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/longs.kt
  54. +95 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/maps.kt
  55. +35 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/multiples.kt
  56. +47 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/propertyInput.kt
  57. +54 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/arbitrary/strings.kt
  58. +15 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/args.kt
  59. +11 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/config.kt
  60. +24 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/context.kt
  61. +23 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/gens.kt
  62. +45 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/internal/errors.kt
  63. +77 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/internal/shrink.kt
  64. +70 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/internal/test1.kt
  65. +110 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/internal/test2.kt
  66. +96 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/internal/test3.kt
  67. +7 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/progression/collections.kt
  68. +44 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/progression/progressions.kt
  69. +37 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/propertyTest1.kt
  70. +41 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/propertyTest2.kt
  71. +51 −0 kotest-property/src/commonMain/kotlin/io/kotest/property/propertyTest3.kt
  72. +97 −0 kotest-property/src/jvmTest/kotlin/io/kotest/property/CheckAll2Test.kt
  73. +84 −0 kotest-property/src/jvmTest/kotlin/io/kotest/property/ForAll2Test.kt
  74. +14 −0 kotest-property/src/jvmTest/kotlin/io/kotest/property/GenFunctionsTest.kt
  75. +19 −0 kotest-property/src/jvmTest/kotlin/io/kotest/property/PropertyExceptionTest.kt
  76. +41 −0 kotest-property/src/jvmTest/kotlin/io/kotest/property/StringArbitraryTest.kt
  77. +16 −0 kotest-property/src/jvmTest/kotlin/io/kotest/property/arbitrary/MultipleArbitraryTest.kt
  78. +0 −44 kotest-runner/kotest-runner-console/build.gradle
  79. +73 −0 kotest-runner/kotest-runner-console/build.gradle.kts
  80. +17 −20 kotest-runner/kotest-runner-js/build.gradle
  81. +42 −38 kotest-runner/kotest-runner-junit4/build.gradle
  82. +0 −39 kotest-runner/kotest-runner-junit5/build.gradle
  83. +54 −0 kotest-runner/kotest-runner-junit5/build.gradle.kts
  84. +74 −65 kotest-runner/kotest-runner-junit5/src/jvmMain/kotlin/io/kotest/runner/junit5/KotestEngine.kt
  85. +0 −65 kotest-runner/kotest-runner-jvm/build.gradle
  86. +75 −0 kotest-runner/kotest-runner-jvm/build.gradle.kts
  87. +0 −73 kotest-tests/kotest-tests-core/build.gradle
  88. +71 −0 kotest-tests/kotest-tests-core/build.gradle.kts
  89. +39 −35 kotest-tests/kotest-tests-junit4-assertions/build.gradle
  90. +16 −16 kotest-tests/kotest-tests-junit4-assertions/src/jvmTest/kotlin/io/kotest/JUnit4AssertionsTest.kt
  91. +0 −61 kotest-tests/kotest-tests-junit5/build.gradle
  92. +66 −0 kotest-tests/kotest-tests-junit5/build.gradle.kts
  93. +0 −59 kotest-tests/kotest-tests-parallelism/build.gradle
  94. +63 −0 kotest-tests/kotest-tests-parallelism/build.gradle.kts
  95. +0 −61 kotest-tests/kotest-tests-timeout/build.gradle
  96. +64 −0 kotest-tests/kotest-tests-timeout/build.gradle.kts
  97. +61 −0 propertytest_requirements.md
  98. +0 −23 settings.gradle
  99. +24 −0 settings.gradle.kts
@@ -1,82 +1,72 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.arrow_version = '0.10.3'
ext.isTravis = System.getenv("TRAVIS") == "true"
ext.travisBuildNumber = System.getenv("TRAVIS_BUILD_NUMBER")
ext.isReleaseVersion = !isTravis
ext.JUnitPlatformVersion = "1.5.1"
ext.junitJupiterVersion = "5.5.1"
ext.dokkaVersion = '0.9.17'
ext.coroutinesVersion = "1.3.0"
ext.argparse4jVersion = "0.8.1"
ext.mockkVersion = "1.9.3"
ext.ktorVersion = "1.2.3"
ext.mordantVersion = "1.2.1"
ext.log4jVersion = "2.12.1"
ext.slf4jVersion = "1.7.28"
ext.classgraphVersion = "4.8.47"
ext.jsonPathVersion = "2.4.0"
repositories {
mavenCentral()
mavenLocal()
}
ext.kotlin_version = '1.3.61'
ext.arrow_version = '0.10.3'
ext.isTravis = System.getenv("TRAVIS") == "true"
ext.travisBuildNumber = System.getenv("TRAVIS_BUILD_NUMBER")
ext.isReleaseVersion = !isTravis
ext.JUnitPlatformVersion = "1.5.1"
ext.junitJupiterVersion = "5.5.1"
ext.dokkaVersion = '0.9.17'
ext.coroutinesVersion = "1.3.0"
ext.argparse4jVersion = "0.8.1"
ext.mockkVersion = "1.9.3"
ext.ktorVersion = "1.2.3"
ext.mordantVersion = "1.2.1"
ext.log4jVersion = "2.12.1"
ext.slf4jVersion = "1.7.28"
ext.classgraphVersion = "4.8.47"
ext.jsonPathVersion = "2.4.0"
repositories {
mavenCentral()
mavenLocal()
}

dependencies {
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion"
// classpath "io.kotest:kotest-gradle-plugin:1.1.1-LOCAL"
}
dependencies {
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion"
// classpath "io.kotest:kotest-gradle-plugin:1.1.1-LOCAL"
}
}

plugins {
id 'java'
id 'org.jetbrains.kotlin.multiplatform' version '1.3.50'
id 'java-library'
id 'maven-publish'
id 'signing'
id 'net.researchgate.release' version '2.8.0'
id("com.gradle.build-scan").version("2.4.2")
id 'java'
id 'org.jetbrains.kotlin.multiplatform' version '1.3.61'
id 'java-library'
id 'maven-publish'
id 'signing'
id 'net.researchgate.release' version '2.8.0'
}

// apply plugin: "io.kotest"

allprojects {

repositories {
mavenCentral()
jcenter()
}
repositories {
mavenCentral()
jcenter()
}

sourceCompatibility = 1.6
targetCompatibility = 1.6
sourceCompatibility = 1.8
targetCompatibility = 1.8

group = "io.kotest"
group = "io.kotest"

if (isTravis) {
version "4.0." + travisBuildNumber + "-SNAPSHOT"
}
if (isTravis) {
version "4.0." + travisBuildNumber + "-SNAPSHOT"
}

release {
failOnCommitNeeded = false
failOnPublishNeeded = false
failOnUnversionedFiles = false
}
release {
failOnCommitNeeded = false
failOnPublishNeeded = false
failOnUnversionedFiles = false
}

afterReleaseBuild.dependsOn publish
afterReleaseBuild.dependsOn publish
}

dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib"
compile "org.jetbrains.kotlin:kotlin-stdlib"
}


project(":") {
publish.enabled = false
}


buildScan {
// ./gradlew --scan $TASKNAME
// see https://dev.to/jmfayard/the-one-gradle-trick-that-supersedes-all-the-others-5bpg
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
publish.enabled = false
}
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

This file was deleted.

@@ -0,0 +1,95 @@
plugins {
id("java")
id("kotlin-multiplatform")
id("java-library")
}

repositories {
mavenCentral()
}

kotlin {

targets {
jvm {
targets {
jvm {
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
}
}
js {
val main by compilations.getting {
kotlinOptions {
moduleKind = "commonjs"
}
}
}
}

targets.all {
compilations.all {
kotlinOptions {
freeCompilerArgs + "-Xuse-experimental=kotlin.Experimental"
}
}
}

sourceSets {

val commonMain by getting {
dependencies {
implementation (kotlin ("stdlib-common"))
implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.3")
implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3")
}
}

val jsMain by getting {
dependsOn(commonMain)
dependencies {
implementation(kotlin("stdlib-js"))
}
}

val jvmMain by getting {
dependsOn(commonMain)
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
implementation("com.github.wumpz:diffutils:2.2")
implementation("com.univocity:univocity-parsers:2.8.3")
api("io.arrow-kt:arrow-core:0.10.3")
implementation("com.github.mifmif:generex:1.0.2")
}
}

val jvmTest by getting {
dependsOn(jvmMain)
dependencies {
implementation(project(":kotest-runner:kotest-runner-junit5"))
}
}
}
}

tasks {
test {
useJUnitPlatform()
testLogging {
showExceptions = true
showStandardStreams = true
events = setOf(
org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED,
org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED
)
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
}

apply(from = "../publish.gradle")

This file was deleted.

0 comments on commit cd91426

Please sign in to comment.
You can’t perform that action at this time.