Skip to content

Commit

Permalink
Update spek framework to 2.0.13 (#3070)
Browse files Browse the repository at this point in the history
* Update spek framework to 2.0.13

Release note:
https://github.com/spekframework/spek/releases/tag/2.0.13

* Remove duplicate package entries in test snippets

This could be the reason for the exceptions in the JSR223 API (compileAndLint).

org.jetbrains.kotlin.util.KotlinFrontEndException: Front-end Internal error: Failed to analyze declaration Line_51

* Remove redundant package entry in test snippets

Duplicate package entries could be the reason for the exceptions in the JSR223 API (compileAndLint).

org.jetbrains.kotlin.util.KotlinFrontEndException: Front-end Internal error: Failed to analyze declaration Line_51

* Use new spek timeout property

This fixes the issued warning by the spek framework.
SPEK2_TIMEOUT is deprecated please use spek2.execution.test.timeout instead
  • Loading branch information
schalkms committed Sep 17, 2020
1 parent 19f8cb4 commit 793cece
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/commons.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ configure(subprojects.filter { it.name != "detekt-bom" }) {
tasks.withType<Test>().configureEach {
useJUnitPlatform()
systemProperty("spek2.jvm.cg.scan.concurrency", 1) // use one thread for classpath scanning
systemProperty("SPEK_TIMEOUT", 0) // disable test timeout
systemProperty("spek2.execution.test.timeout", 0) // disable test timeout
val compileSnippetText: Boolean = if (project.hasProperty("compile-test-snippets")) {
(project.property("compile-test-snippets") as String).toBoolean()
} else {
Expand Down
2 changes: 1 addition & 1 deletion detekt-bom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

dependencies {
val version = object {
val spek = "2.0.12"
val spek = "2.0.13"
val ktlint = "0.39.0"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class ForbiddenPublicDataClassSpec : Spek({

it("public data class inside a random package should fail") {
val code = """
package com.example
package com.random
data class C(val a: String)
"""
Expand All @@ -148,12 +148,12 @@ class ForbiddenPublicDataClassSpec : Spek({

it("public data class inside an ignored package should pass config as string") {
val code = """
package com.example
package org.example
data class C(val a: String)
"""

val config = TestConfig("ignorePackages" to "*.hello,com.example", Config.INCLUDES_KEY to "*.kt")
val config = TestConfig("ignorePackages" to "*.hello,org.example", Config.INCLUDES_KEY to "*.kt")
assertThat(ForbiddenPublicDataClass(config).compileAndLint(code)).isEmpty()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ class WildcardImportSpec : Spek({

context("a kt file with wildcard imports") {
val code = """
package org
import io.gitlab.arturbosch.detekt.*
import org.spekframework.*
Expand Down

0 comments on commit 793cece

Please sign in to comment.