All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.18.1 - 2024-10-05
- Use
enginekit/message
instead ofconfigkit/message
. - It is no longer possible to (mis-)use a single message type as both a pointer
and a non-pointer. If a type implements
dogma.Command
,dogma.Event
, ordogma.Timeout
using pointer receivers then a pointer type must be used; otherwise, a non-pointer type must be used.
0.18.0 - 2024-10-03
- Added
Not()
expectation, which negates a single expectation.Not()
is functionally equivalent to usingNoneOf()
with a single argument, but produces more intuitive test reports. - Added
CommandValidationScope()
,EventValidationScope()
, andTimeoutValidationScope()
to help when testing message validation logic.
0.17.2 - 2024-09-25
- Fix argument type of
ToRecordEvent()
andToRecordEventOfType()
.
0.17.1 - 2024-09-25
- Fixed issue that caused an empty
SUGGESTIONS
section to be printed on test reports in some circumstances. ToExecuteCommandMatching()
,ToOnlyExecuteCommandsMatching()
,ToRecordEventMatching()
andToOnlyRecordEventsMatching()
now properly report impossible assertions when the predicate's argument type is not a recognized message.
0.17.0 - 2024-08-21
- Added
ReportGenerationContext
to hold information required when generating test reports. - Added
Test.Annotate()
to add human-readable annotations to values within test reports.
- [BC] Changed
Predicate.Report()
to accept aReportGenerationContext
instead of individual arguments.
0.16.0 - 2024-08-17
- Bumped Dogma to v0.14.0, which involved removing any calls to the
TimeoutHint()
method on the handler interfaces, which has been removed. ToExecuteCommandMatching()
andToRecordEventMatching()
now accept predicate functions with a more specific argument type thandogma.Command
anddogma.Event
, respectively. Any message that does not match the argument type of the predicate is ignored.ToOnlyExecuteCommandsMatching()
andToOnlyRecordEventsMatching()
now accept predicate functions with a more specific argument type thandogma.Command
anddogma.Event
, respectively. Any message that does not match the argument type of the predicate is considered a failure.
- Fixed poor wording of
ToOnlyExecuteCommandsMatching()
andToOnlyRecordEventsMatching()
failure reports when no messages were matched. - Fixed a few swapped references to
dogma.Command
anddogma.Event
which were aliases preior to Dogma v0.14.0.
0.15.4 - 2024-08-16
- Added
ToExecuteCommandType[T]()
andToRecordEventType[T]()
expectations.
- Marked
ToExecuteCommandOfType()
andToRecordEventOfType()
as deprecated. These functions will be removed in a future release; use the new generic versions instead.
0.15.3 - 2024-08-16
- Use
dogma.Command
,Event
andTimeout
interfaces instead ofdogma.Message
where appropriate.
- Supress rendering of explanation and suggestions in test reports when a failed
expectation is negated by
NoneOf()
(thanks @sameaste92).
0.15.2 - 2024-07-24
- Fixed log messages about disabled handlers to properly indicate why they are disabled.
0.15.1 - 2024-07-16
- Added support for
Disable()
method indogmatiq/dogma
v0.13.1.
0.15.0 - 2024-03-26
- Added
Test.EnableHandlersLike()
andDisableHandlersLike()
, which enable/disable any handler with a name matches at least one of a given set of regular expressions.
- [BC]
Test.EnableHandlers()
andDisableHandlers()
will now panic when called with names of handlers that do not exist.
0.14.0 - 2024-03-26
This release updates the testkit
implementation to adhere to Dogma v0.13.0
interfaces.
- [BC] Removed
Test.EventRecorder()
. - [BC] Removed
EventRecorder
. - [BC] Removed
EventRecorderInterceptor
andInterceptEventRecorder()
. - [BC] Removed
engine.EventRecorder
. - [BC] Removed
ActionScope.EventRecorder
.
0.13.12 - 2024-03-05
- Improved wording of "empty instance ID" error message.
- Fixed issue that caused internal/mangled names of anonymous functions to be rendered in test reports on some platforms.
0.13.11 - 2023-04-09
This release updates the testkit
implementation to adhere to Dogma v0.12.0
interfaces.
0.13.10 - 2023-03-27
- Added
MessageDescription
method to internal test messages in preparation for it becoming mandatory.
0.13.9 - 2023-01-06
- Bumped
dogmatiq/linger
to v1.0.0
0.13.8 - 2022-08-07
- Bumped
dogmatiq/dogma
to v0.4.4 to gain support fordapper.Stringer
0.13.7 - 2022-01-24
- Fix malformed panic message in
engine.CommandExecutor
andEventRecorder
when passed an unrecognized message
0.13.6 - 2021-04-28
- Fix issue rendering Protocol Buffers diffs by upgrading to
dogmatiq/dapper
v0.4.3
0.13.5 - 2021-04-26
- Add
InterceptCommandExecutor()
andInterceptEventRecorder()
options - Add functional options to
Call()
, seeCallOption
0.13.4 - 2021-04-22
- Hide unexported struct fields in message diffs
0.13.3 - 2021-04-22
- Add
WithMessageComparator()
for specifying custom message comparison behavior within a test - Add
DefaultMessageComparator()
, the default comparator, with support for protocol buffers messages
0.13.2 - 2021-04-16
- Add
ToOnlyExecuteCommandsMatching()
andToOnlyRecordEventsMatching()
expectations
0.13.1 - 2021-04-13
- Add
ToExecuteCommandMatching()
andToRecordEventMatching()
expectations - Add
ToRepeatedly()
expectation
0.13.0 - 2021-03-01
- [BC] Updated to Dogma to v0.11.0
0.12.0 - 2020-12-20
This release includes several changes to the underlying action and expectation systems, some of which are not backwards compatable. Tests written using v0.11.0 should continue to work without modification.
- [BC] Add
PredicateOptions
toPredicateScope
- [BC] Add
Action.Location()
method
- [BC] Renamed
Action.Apply()
toDo()
Test.Expect()
now returns theTest
, allowing chained calls
- [BC] Removed the
PredicateOptions
parameter fromExpectation.Predicate()
0.11.0 - 2020-11-27
This release includes extensive changes to the testing API. It formalizes the concepts of "actions" and "expectations" with the goal of a more consistent API and a greater level of extensibility.
Despite the large number of backwards incompatible changes it is relatively simple to migrate existing tests to the new API. Please see the migration guide for detailed instructions.
- Add
Begin()
andBeginContext()
functions, used to start a newTest
- Add
ExecuteCommand()
,RecordEvent()
,AdvanceTime()
andCall()
functions - Add
Expect()
method toTest
- Add
EnableHandlers()
andDisableHandlers()
methods toTest
- Add
TimeAdjuster
interface, for use withAdvanceTime()
- Add
Action
andActionScope
types - Add
Expectation
,Predicate
,PredicateScope
andPredicateOptions
types - [BC] Add
Failed()
,Fatal()
andHelper()
to theTestingT
interface
- [BC]
Test.Prepare()
now accepts...Action
(previously...dogma.Message
) - [BC] The function passed to
Call()
no longer returns anerror
- [BC] Rename
WithStartTime()
toStartTimeAt()
- [BC] Rename
WithOperationOptions()
toWithUnsafeOperationOptions()
- [BC] Move
assert.AllOf()
,AnyOf()
andNoneOf()
to thetestkit
package - [BC] Move
assert.Should()
, totestkit.ToSatisfy()
- [BC] Move
assert.CommandExecuted()
, totestkit.ToExecuteCommand()
- [BC] Move
assert.CommandTypeExecuted()
, totestkit.ToExecuteCommandOfType()
- [BC] Move
assert.EventExecuted()
, totestkit.ToRecordEvent()
- [BC] Move
assert.EventTypeExecuted()
, totestkit.ToRecordEventOfType()
- [BC] Remove the
Runner
type andNew()
which constructed it - [BC] Remove
ExecuteCommand()
,RecordEvent()
,AdvanceTime()
andCall()
methods fromTest
- [BC] Remove
TimeAdvancer
function (replaced withTimeAdjustment
interface) - [BC] Remove
WithEngineOptions()
- [BC] Remove the
assert
package - [BC] Remove the
compare
package - [BC] Remove the
render
package
- Add
EnableHandler()
operation option
- [BC]
engine.New()
andMustNew()
now require aconfigkit.RichApplication
- [BC] Moved the
engine/fact
package tofact
- [BC] Moved the
engine/envelope
package toenvelope
- [BC] Remove the
engine/controller
package
Engine.Tick()
now properly ignores disabled handlers
0.10.0 - 2020-11-16
- [BC] Updated to Dogma to v0.10.0
- Add support for projection compaction
- Fix issue where engine operation options were not taking precedence over test options
0.9.0 - 2020-11-06
- [BC] Updated to Dogma to v0.9.0
0.8.1 - 2020-11-04
- Add
engine.MustNew()
0.8.0 - 2020-11-03
- [BC] Remove aggregate
Create()
andExists()
methods (complies with Dogma v0.8.0)
0.7.0 - 2020-11-02
- Add
Test.AdvanceTime()
,ByDuration()
andToTime()
- Add
Test.Call()
- Add
assert.Nothing
- Add
engine.CommandExecutor
- Add
engine.EventRecorder
- [BC] Add
op
parameter toassert.Assertion.Begin()
- [BC] Remove
Test.AdvanceTimeTo()
andAdvanceTimeBy()
- [BC] Remove
verbose
parameterassert.Assertion.BuildReport()
- [BC] Remove
RunnerVerbose()
andVerbose()
options - [BC] Remove
Engine.ExecuteCommand()
andRecordEvent()
- The
-v
(verbose) option togo test
no longer affects testkit's behavior, full logs are always rendered
0.6.2 - 2020-10-19
Test.AdvanceTimeBy()
andAdvanceTimeTo()
can now be called without making any assertions by passing anil
assertion
0.6.1 - 2020-10-19
- Add
Exists()
andHasBegun()
methods to aggregate & process scopes
0.6.0 - 2020-06-12
- [BC] Renamed
T
toTestingT
, to avoid conflicts with*testing.T
when dot-importing - [BC] Renamed
assert.T
toS
, to avoid conflicts with*testing.T
when dot-importing
0.5.0 - 2020-06-11
- [BC] Add
assert.Assertion.End()
- Add
engine.Run()
andRunTimeScaled()
engine.Engine
now protects its internal state with a mutex, allowing concurrent use
- [BC]
assert.Should()
now provides anassert.T
to the user instead of checking theerror
return value - [BC] Rename
assert.Assertion.Prepare()
toBegin()
- [BC] Add
verbose
parameter toassert.Assertion.BuildReport()
0.4.0 - 2020-02-04
- Add
assert.Should()
for specifying user-defined assertions
- [BC] Switched from
enginekit
toconfigkit
for application configurations - [BC] Flatten fields from
Envelope.Correlation
directly intoEnvelope
- Test logs and assertion reports now display the file and line number of the test operation
- [BC] Removed the
assert.CompositeAssertion
type - [BC] Removed the
assert.MessageAssertion
type - [BC] Removed the
assert.MessageTypeAssertion
type
assert.CommandExecuted()
now renders the correct suggestions when it fails due to mismatched message role
0.3.0 - 2019-10-31
- Updated EngineKit to v0.8.0
0.2.0 - 2019-10-21
- [BC] Rename
StartTime()
option toWithStartTime()
for consistency
0.1.1 - 2019-10-18
- Add
StartTime()
test option to configure the initial time of the test clock
0.1.0 - 2019-08-01
- Initial release