From 75505ceeda3ba13924da1660a46945ea0f3ef134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20Br=C3=BCnings?= Date: Sun, 25 Feb 2024 18:57:12 +0100 Subject: [PATCH] Prepare release notes for 2.4-M2 --- docs/extensions.adoc | 2 ++ docs/release_notes.adoc | 67 +++++++++++++++++++++++++++++++---------- docs/spock_primer.adoc | 1 + 3 files changed, 54 insertions(+), 16 deletions(-) diff --git a/docs/extensions.adoc b/docs/extensions.adoc index 6bf896a262..0957cea2a0 100644 --- a/docs/extensions.adoc +++ b/docs/extensions.adoc @@ -294,6 +294,7 @@ This will pass for the first two iterations, fail on the third and skip the rema NOTE: For backward compatibility with Spock versions prior to 2.2, applying the annotation on spec level will _not_ automatically skip subsequent feature method iterations upon failure in a previous iteration. If you want that in addition to (or instead of) step-wise spec mode, you do have to annotate each individual feature method you wish to have that capability. This also conforms to the principle that if you want to skip tests under whatever conditions, you ought to document your intent explicitly. +[[timeout-extension]] === Timeout To fail a feature method, fixture, or class that exceeds a given execution duration, use `spock.lang.Timeout`, @@ -1026,6 +1027,7 @@ include::{sourcedir}/extension/InterceptorSpec.groovy[tag=interceptor-register-s include::{sourcedir}/extension/InterceptorSpec.groovy[tag=interceptor-register-feature] ---- +[[parameter-injection]] ==== Injecting Method Parameters Starting with Spock 2.4, it is possible to create `IAnnotationDrivenExtension` that target method parameters directly. diff --git a/docs/release_notes.adoc b/docs/release_notes.adoc index c50c145524..cf18816a19 100644 --- a/docs/release_notes.adoc +++ b/docs/release_notes.adoc @@ -3,7 +3,9 @@ include::include.adoc[] -== 2.4 (tbd) +== 2.4-M2 (tbd) + +=== Highlights * Spock now supports pluggable <> loaded via ServiceLoader spockPull:1746[] ** This allows external libraries to contribute mocking logic to Spock and use the same API for the users @@ -13,40 +15,73 @@ include::include.adoc[] ** Mocking of static methods ** Mocking of classes and interface from different classloaders spockPull:1878[] ** Requires `org.mockito:mockito-core` >= 4.11 in the test class path -* Fix issue with mocks of Groovy classes, where the Groovy MOP for `@Internal` methods was not honored by the `byte-buddy` mock maker spockPull:1729[] -** This fixes multiple issues with Groovy MOP: spockIssue:1501[], spockIssue:1452[], spockIssue:1608[] and spockIssue:1145[] -* Replaced `gentyref` code with https://github.com/leangen/geantyref[geantyref] library spockPull:1743[] -** This is now a required dependency used by spock: `io.leangen.geantyref:geantyref:1.3.14` -* Better support for generic return types for mocks spockPull:1731[] -** This fixes the issues: spockIssue:520[], spockIssue:1163[] * Added support for mocking of static methods also for Java code with the new API `SpyStatic()` spockPull:1756[] ** The <> will delegate the creation to the mock makers +* Add <> spockPull:1599[] +* Add support for <> spockPull:1692[] +* Add <> spockPull:1844[] +* Add `@Snapshot` extension for <> spockPull:1873[] +* Add `!!` as <> spockPull:1532[] === Breaking Changes * Calling `old(...)` with multiple arguments is now a compilation error. Previously the additional arguments were simply ignored. * Creating `GroovyMock`/`GroovyStub`/`GroovySpy` for an already mocked type will now fail. * Creating a global `GroovyMock`/`GroovyStub`/`GroovySpy` when <> is enabled, - will now require that the spec is annotated with <> or `@ResourceLock(org.spockframework.runtime.model.parallel.Resources.META_CLASS_REGISTRY)`. See <> -* `@TempDir` `spock.tempDir.keep` has been replaced by `spock.tempdir.cleanup`. See <> + will now require that the spec is annotated with <> or `@ResourceLock(org.spockframework.runtime.model.parallel.Resources.META_CLASS_REGISTRY)`. See <> spockPull:1848[] +* `@TempDir` `spock.tempDir.keep` has been replaced by `spock.tempdir.cleanup`. See <> spockPull:1525[] === Misc -* Add support for <> * Add support for parameter injection of `@TempDir` -* Add `@Snapshot` extension for <> -* Add <> spockPull:1844[] +* Add cleanup switch for `@TempDir` spockPull:1525[] +* Add support for creation of global Groovy mocks for abstract classes spockPull:1754[] +* Add optional reason to `@ResourceLock` spockPull:1890[] +* Add optional reason to `@Execution` spockPull:1576[] +* Add `onTimeout` support for `PollingConditions` spockPull:1853[] +* Add `SpecInfo#getAll...Methods()` methods spockPull:1770[] +* Add array support to collection conditions spockPull:1734[] +* Add support for logging thread dumps when <> are ignored spockPull:1658[] +* Add implied features to force execution of features even when removed by a build tool spockPull:1598[] +* Improve StackTraceFilter by ignoring `java.lang.invoke.*` spockPull:1892[] * Improve `@TempDir` field injection, now it happens before field initialization, so it can be used by other field initializers. +* Improve Spock-Compiler does not use wrapper types anymore spockPull:1765[] +* Improve reduce lock contention of the `byte-buddy` mock maker, when multiple mocks are created concurrently spockPull:1778[] +* Improve `@Use` on feature and fixture method for parallel execution spockPull:1691[] +* Improve IDE support +** by adding a closure signature hint that derives closure argument type from variable type spockPull:1785[] +** by adding missing closure hints for Spy(T, Closure) spockPull:1786[] +** by adding GDSL/DSLD for ConditionalExtension's annotations spockPull:1808[] +** by making `spock.gdsl` fail-safe and cover some more cases spockPull:1783[] +* Improve RunContexts behavior in multithreaded executions spockPull:1758[], spockPull:1846[] +* Improve generic handling by replacing `gentyref` code with https://github.com/leangen/geantyref[geantyref] library spockPull:1743[] +** This is now a required dependency used by spock: `io.leangen.geantyref:geantyref:1.3.14` +* Improve handling of passing `null` to `thrown()` to be consistent with mock object creation spockPull:1799[] +* Improve `old(...)` calls by validating their argument count spockPull:1810[] +* Improve robustness of the AST transformation against missing classes in the compile classpath spockPull:1704[] +* Improve handling of `shared.` conditions in `@IgnoreIf`/`@Requires`, the condition is now checked before creating data providers spockPull:1711[] +* Fix issue with mocks of Groovy classes, where the Groovy MOP for `@Internal` methods was not honored by the `byte-buddy` mock maker spockPull:1729[] +** This fixes multiple issues with Groovy MOP: spockIssue:1501[], spockIssue:1452[], spockIssue:1608[] and spockIssue:1145[] +* Improve support for generic return types for mocks spockPull:1731[] +** This fixes the issues: spockIssue:520[], spockIssue:1163[] +* Fix the lifecycle of simple features spockPull:1675[] * Fix exception when configured `baseDir` was not existing, now `@TempDir` will create the baseDir directory if it is missing. * Fix bad error message for collection conditions, when one of the operands is `null` +* Fix docs about initializer method interceptors spockPull:1666[] * Fix possible deadlock, when blocking in mock response generators spockPull:1885[] ** This fixes the issues: spockIssue:583[], spockIssue:1882[] +* Fix SpringSpy not working with `DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD` spockPull:1869[] +* Fix null handling for collection conditions spockPull:1858[] +* Fix interceptor contexts spockPull:1676[] +* Fix properly call `IRunListener.specSkipped` and `.featureSkipped` spockPull:1811[] +* Fix defining responses for additionalInterfaces spockPull:1730[] +* Fix lost execution mode for iteration nodes of implied data-driven features spockPull:1615[] +* Fix docs how to register all possible interceptors spockPull:1667[], spockPull:1824[] * Document `@ConditionBlock` Annotation spockPull:1709[] * Document `old`-Method spockPull:1708[] +* Document for DetachedMockFactory spockPull:1728[] * Clarify documentation for global Mocks spockPull:1755[] -* Spock-Compiler does not use wrapper types anymore spockPull:1765[] -* Reduce lock contention of the `byte-buddy` mock maker, when multiple mocks are created concurrently spockPull:1778[] -* Documentation for DetachedMockFactory spockPull:1728[] -* Support creation of global Groovy mocks for abstract classes spockPull:1754[] + +Thanks to all the contributors to this release: Andreas Turban, Björn Kautler, Goooler, Jérôme Prinet, Marcin Zajączkowski, Michał Wiśniewski, Nelson Osacky, Pavlo Shevchenko, RahulGautamSingh, Said Boudjelda, Tasuku Nakagawa, jochenberger, soosue == 2.4-M1 (2022-11-30) diff --git a/docs/spock_primer.adoc b/docs/spock_primer.adoc index 4e63dfc161..f5aa732a15 100644 --- a/docs/spock_primer.adoc +++ b/docs/spock_primer.adoc @@ -242,6 +242,7 @@ def setup() { If an explicit condition is violated, it will produce the same nice diagnostic message as an implicit condition. +[[opt-out-of-condition-handling]] ====== Opt-out of condition handling Sometimes, you may want to use a top-level expression that is not treated as a condition.