Skip to content

Commit

Permalink
Prepare release notes for 2.4-M2
Browse files Browse the repository at this point in the history
  • Loading branch information
leonard84 committed Feb 25, 2024
1 parent 7e1cf5b commit 75505ce
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 16 deletions.
2 changes: 2 additions & 0 deletions docs/extensions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down Expand Up @@ -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.
Expand Down
67 changes: 51 additions & 16 deletions docs/release_notes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

include::include.adoc[]

== 2.4 (tbd)
== 2.4-M2 (tbd)

=== Highlights

* Spock now supports pluggable <<extensions.adoc#mock-makers,mock makers>> loaded via ServiceLoader spockPull:1746[]
** This allows external libraries to contribute mocking logic to Spock and use the same API for the users
Expand All @@ -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 <<interaction-based-testing.adoc#static-mocks,static mock methods>> will delegate the creation to the mock makers
* Add <<extensions.adoc#parameter-injection,annotation extensions for parameters>> spockPull:1599[]
* Add support for <<extensions.adoc#extension-store,keeping state in extensions>> spockPull:1692[]
* Add <<extensions.adoc#spock-interceptors,feature-scoped interceptors>> spockPull:1844[]
* Add `@Snapshot` extension for <<extensions.adoc#snapshot-testing,snapshot testing>> spockPull:1873[]
* Add `!!` as <<spock-primer.adoc#opt-out-of-condition-handling,opt-out operator for assertions>> 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 <<parallel-execution.adoc#parallel-execution, parallel execution>> is enabled,
will now require that the spec is annotated with <<parallel-execution.adoc#isolated-execution, @Isolated>> or `@ResourceLock(org.spockframework.runtime.model.parallel.Resources.META_CLASS_REGISTRY)`. See <<interaction-based-testing.adoc#global-mocks-parallel-execution, Global mocks and parallel execution>>
* `@TempDir` `spock.tempDir.keep` has been replaced by `spock.tempdir.cleanup`. See <<extensions.adoc#_temp_dir_cleanup,TempDir Cleanup>>
will now require that the spec is annotated with <<parallel-execution.adoc#isolated-execution, @Isolated>> or `@ResourceLock(org.spockframework.runtime.model.parallel.Resources.META_CLASS_REGISTRY)`. See <<interaction-based-testing.adoc#global-mocks-parallel-execution, Global mocks and parallel execution>> spockPull:1848[]
* `@TempDir` `spock.tempDir.keep` has been replaced by `spock.tempdir.cleanup`. See <<extensions.adoc#_temp_dir_cleanup,TempDir Cleanup>> spockPull:1525[]

=== Misc
* Add support for <<extensions.adoc#extension-store,keeping state in extensions>>
* Add support for parameter injection of `@TempDir`
* Add `@Snapshot` extension for <<extensions.adoc#snapshot-testing,snapshot testing>>
* Add <<extensions.adoc#spock-interceptors,feature-scoped interceptors>> 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 <<extensions.adoc#timeout-extension,@Timeout interrupts>> 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)

Expand Down
1 change: 1 addition & 0 deletions docs/spock_primer.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 75505ce

Please sign in to comment.