Replace integration test hand-crafted traces with checking against golden file #1548
Description
Our integration tests include a mechanism to check an actual execution trace (method calls, params, return values, events etc) against an expected one. The trace is not often the primary endpoint of a test, but provide a way to check some of the internal steps of a multi-actor execution which can be difficult to verify by other means.
These expectations are hand-crafted. Crafting them takes quite some time, and they also lead to a lot of noise in the test files. Because of this, some integration tests don't have traces, and some of the available trace expectations are often omitted (some fields are optional).
A better way of doing this would be to generate the expected traces by running the test code, and check in those expectations as files. This would mean:
- all tests have expectations that are checked
- all fields in all expectations could be populated
- authors & reviewers gain complete transparency into the internal execution
- whenever anything changes, a diff in expectations is created and subject to code review
- no additional effort is required when writing new tests
After the initial work to create something which generates the trace files, this could provide both better coverage and require less ongoing effort to maintain.
Metadata
Assignees
Labels
Type
Projects
Status
No status