Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix gradle include combinator #3278

Merged
merged 2 commits into from Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -18,7 +18,7 @@ class ContainerTimeoutTest : FunSpec() {
.launch()
collector.tests.keys.map { it.name.testName }.toSet() shouldBe setOf("a")
collector.tests.values.map { it.errorOrNull?.message }.toSet() shouldBe setOf(
"Test 'a' did not complete within 10ms",
"Test 'a' did not complete within 100ms",
)
}
}
Expand Down
Expand Up @@ -14,7 +14,7 @@ class GradleClassMethodRegexTestFilter(private val patterns: List<String>) : Tes
logger.log { Pair(descriptor.toString(), "Testing against $patterns") }
return when {
patterns.isEmpty() -> TestFilterResult.Include
patterns.all { match(it, descriptor) } -> TestFilterResult.Include
patterns.any { match(it, descriptor) } -> TestFilterResult.Include
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was the bug

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@myuwono do you want to get a patch release out, or should we put the fix in 5.6?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reckon it's good to get this out as a patch version.

else -> TestFilterResult.Exclude(null)
}
}
Expand Down
Expand Up @@ -43,22 +43,22 @@ class GradleClassMethodRegexTestFilterTest : FunSpec({
val test = container.append("nested test")

withData(
nameFn = { filters -> "should be INCLUDED when evaluating $filters" },
nameFn = { filters -> "should be INCLUDED if any of the filters matches when evaluating $filters" },
listOf("\\Qio.kotest.runner.junit.platform.gradle\\E"),
listOf("\\Qio.kotest.runner.junit.platform.gradle.\\E.*"),
listOf(".*\\Qnner.junit.platform.gradle\\E"),
listOf(".*\\Qnner.junit.platform.gradle.\\E.*"),
listOf(".*\\Q.junit.platform.gradle\\E"),
listOf("\\Qio.kotest.runner.junit.platform.gra\\E.*"),
listOf("\\Qio.kotest.runner.junit\\E"),
listOf(".*\\QNotSpec\\E", "\\Qio.kotest.runner.junit\\E"),
) { filters ->
GradleClassMethodRegexTestFilter(filters).filter(spec) shouldBe TestFilterResult.Include
}

withData(
nameFn = { filters -> "should be EXCLUDED when evaluating $filters" },
nameFn = { filters -> "should be EXCLUDED if none of the filters matches when evaluating $filters" },
listOf("\\Qio.kotest.runner.junit2\\E"),
listOf("\\Qio.kotest.runner.junit\\E", ".*\\QSpec\\E"),
listOf("\\Qio.kotest.runner.junit2\\E", ".*\\QNotSpec\\E"),
) { filters ->
GradleClassMethodRegexTestFilter(filters).filter(spec) shouldBe TestFilterResult.Exclude(null)
}
Expand Down