Sebastian Schuberth
02/16/2022, 1:43 PMbeforeSpec
is executed for a test that does not match a kotest.tag
?Sourabh Rawat
02/16/2022, 1:44 PMshouldBeEqualToComparingFields
seems to compare fields at first level only 😕Matt Watson
02/17/2022, 10:13 AMinit {}
block?Lukasz Kalnik
02/22/2022, 8:41 AMLightColorTemperatureViewModelKotest has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Lukasz Kalnik
02/22/2022, 9:54 AMkierans777
02/23/2022, 1:27 AMdata class Person(name: String, address: String)
fun aPerson(name: String, address: String): Matcher<Person> =
object: Matcher<Person> {
override fun test(value: Person): MatcherResult {
if (value.name != name) {
return MatcherResult(false, { "${value.name} should be $name" }, { "${value.name} should not be $name" })
}
if (value.address != address) {
return MatcherResult(false, { "${value.address} should be $address" }, { "${value.address} should not be $address" })
}
return MatcherResult(true, { "person is correct" }, { "person is not correct" })
}
}
Is there a better way that I'm missing?Mykola Gurov
02/23/2022, 4:49 PMcontext
and test
except for test
doesn’t support nesting?snowe
02/23/2022, 9:18 PMInt
as the type here, the tests render in the run panel correctly. But if I switch to Number
, the tests render indexed, without parameters displayed, also it shows the FQDN rather than just the Adder
name.Nathan Bedell
02/24/2022, 7:50 PMMichael Vandendriessche
03/01/2022, 6:47 PMdescribe
and inner describe
in the screenshot, in my main project it shows the package name (same as just under test results). So every describe string is replaced by my package name.
In my main project I also had 2 dynamic tests, each in their own describe. because the string in the describe is replaced by my package name for some reason it merged the tests from both describes under the same level in the result screen in Android Studio. I commented those out but no difference.
So I can see the test name, but not the describe block name.
Does anyone know more about this weird behaviour and how I can fix it?
The test itself looks fine. I have many more dependencies in my main project than in the new project, should be OK I guess. in testImplementation I only have mockK dependencies. AndroidTestImplementation dependencies should not matter for unit tests I guess.Tom Haywood
03/04/2022, 3:12 AMcom.intellij.diagnostic.PluginException: The default implementation of method 'getId' is deprecated, you need to override it in 'class io.kotlintest.plugin.intellij.KotlinTestConfigurationFactory'. The default implementation delegates to 'getName' which may be localized, but return value of this method must not depend on current localization. [Plugin: kotlintest-plugin-intellij]
at com.intellij.ide.plugins.PluginManagerCore.createPluginException(PluginManagerCore.java:290)
at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:12)
at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:83)
Tomasz Krakowiak
03/04/2022, 7:37 AMio.mockk.MockKException: Failed matching mocking signature for
SignedCall(retValue=, isRetValueMock=true, retType=class arrow.core.Either, self=SomeService(#1), method=someMethod-D7ixulQ(UUID, Source, Continuation), args=[null, com.example.SomeService$Source$Subclass0@2e0e5e9f, Continuation at com.example.SomeServiceTest$1$1.invokeSuspend(SomeServiceTest.kt:29)], invocationStr=SomeServiceTest(#1).someMethod-D7ixulQ(null, com.example.SomeService$Source$Subclass0@2e0e5e9f, continuation {}))
left matchers: [any()]
sam
03/04/2022, 2:17 PMSrki Rakic
03/05/2022, 11:41 PMstring
is null, empty, or blank?Sourabh Rawat
03/09/2022, 4:09 AM"container 1" - {
"container 2" - {
"actual test" {
}
}
}
In the generated JUnit XML report I have container 2 -- actual test
, missing the containers two step above the test node.
My Kotest config has
JunitXmlReporter(
useTestPathAsName = true
)
Any help will be appreciated!Sam
03/10/2022, 10:43 AMlateinit var fixture: SomeFixture
beforeEach {
fixture = createFixture()
}
In Spek, there's a shorthand for that using a property delegate:
val fixture by memoized { createFixture() }
Does kotest have anything similar? I think I could create one easily myself as an extension function; just want to make sure it doesn't exist already.sam
03/13/2022, 9:31 PMPitel
03/15/2022, 9:26 AM./gradlew -DproxySet=true -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8080 -Pasdfproxy=asdf :phoenix:testDebugUnitTest --tests PropTest
class PropTest: StringSpec({
"props" {
System.getProperties().keys
.filterIsInstance<String>()
.filter { it.contains("proxy", true) }
.also { println(it) }
.shouldNotBeEmpty()
}
})
And this test is failing.Adam S
03/16/2022, 5:31 PMMykola Gurov
03/17/2022, 4:06 PMintegration
, e2e
, `contract`; no tag == unit test) and executed in separate jobs on CI (gradle).Rajkumar Singh
03/18/2022, 8:00 PMiamsteveholmes
03/19/2022, 7:39 AM-native-mt
? I’m getting this in my gradle dependencies:
+--- org.jetbrains.kotlinx:kotlinx-coroutines-core:{strictly 1.6.0-native-mt} FAILED
iamsteveholmes
03/19/2022, 10:33 PMcharleskorn
03/21/2022, 10:08 PM./gradlew macosArm64Test --tests '<class name>'
but that runs all of my tests
(I swear I’ve seen something about this before but I can’t find it, apologies if this is already covered somewhere)Rajkumar Singh
03/24/2022, 5:14 AMRob Elliot
03/24/2022, 10:44 AMEmil Kantis
03/25/2022, 5:58 PMwithData
with SpringExtension, the resulting test cases don’t induce After-test lifecycle. In my case, this resulted in mocks not being cleared between tests. Is there any reason why this might be desired behaviour? I see that withData
adds tests with TestType.Dynamic
which are not considered applicable by the SpringExtensionIvan Pavlov
03/26/2022, 10:40 AMbeforeSpec
. It works in JVMsam
03/28/2022, 9:03 AMRichard Gomez
03/29/2022, 1:17 PM