Also I noticed that since upgrading to Spek 2.0.3 ...
# spek
s
Also I noticed that since upgrading to Spek 2.0.3 the amount of test results drastically reduced in Jenkins from 1000 to a few hundreds. After upgrading to 2.0.4 even less tests are reported. Did something change how Spek reports JUnit test results?
r
Nothing changed on the reporting side. But then again there is a critical bug introduced in
2.0.3
, exceptions were not propagated properly (failed tests are being reported as passed). This bug was fixed in
2.0.4
. Are you able to share a reproducer?
s
I compared the output of
./gradlew test
between Spek 2.0.2 and 2.0.3 and don't see a difference. However Jenkins has "lost" many test results since the Spek upgrade. Not sure why...
r
Weird, no upgrade was done to JUnit 5 dependency (which is responsible for reporting).
t
noticed this as well after upgarding to
2.0.4
version: now report doesn't contain any text from
context(..) {}
and
describe {}
methods, only from
it(..) {}
s
Still trying to figure out why suddenly many tests are not discovered anymore. First I thought this is only an issue on Jenkins but today I realized that it happens on my local machine, too. This wasn't apparent immediatly because the test work when running inside the IDE. But
./gradlew test
does only discover a portion of the tests. Also I'm not really sure what the pattern is here. For instance I have the modules
core/common
and
core/domain
. Both modules have the exact same configuration. However tests are only discovered for
core/common
?! I'm really scratching my head here 🤯
r
Hey! Would it be possible to share the project?
s
Unfortunately not. It's a very complex and commercial project. I tried to reproduce this in an example project but was not able to reproduce the issue yet.
r
Have you tried running the test for a specific module? Something like: ./gradlew coredomaintest..
s
Yes, tests are not discovered
r
Have you tried running it with —info or —debug?
s
./gradlew :core:common:test
works but
./gradlew :core:domain:test
does not. Does not work means that the build succeeds. However tests are not run. I forced an AssertionError in one of the tests under
domain
but the error is not reported
r
Discovery failures are silently consumed by junit 5
Best bet is one of the test classes is causing discovery failures. Junit 5 would just print an error but never propagate that failure to gradle
s
Ooops, this seems to be the case. I just ran with
--info
and there is a discovery error produced by some library I use in
domain
.
Really odd that this is not reported as an error
but says build runs fine
r
Yeah, not sure if it’s a problem with junit 5 or how gradle implemented support for it. Could be both 🤷‍♂️
s
Oh, that's and old ticket 😮 Just upvoted it