You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Over time the test frameworks of both unit and e2e tests for the various vreplication packages have become complex and unwieldy. Several simple things can be done to incrementally improve the overall readability and to reduce the friction in creating and updating tests.
This is a tracking issue to note areas where we can improve as we develop code.
Common
Comments as required where test code is obscure to the reviewer
Wrap logical blocks in sub-tests
Move away entirely from globals: define a test config object for each test
Extract constants
Helpers for common patterns to reduce test footprint
e2e
A doc.go to list all tests used with more high-level summary on what they do. This is an intermediate step to rationalizing the various tests to see if we can remove some in the interests of reducing CI time.
Comments on each test to detail what they and do and why. Revisit tests which had such comments to fix any drift wrt code.
doc.go can also keep track of key functionality that we are not testing.
Change tstWorkflowExec to use a Request object rather than lots of optional parameters.
Extract code which creates and runs a workflow to completion into a helper function. Eg: see testVSchemaForSequenceAfterMoveTables.
unit tests
See which tests still need the precise check on sequence of events, remove this check from others.
Check if we can move at least some of the tests to go-mysql-server's memory db. It will help with reducing the amount of mocking as well as mirror actual db functionality.
Better logging to debug test failures due to incorrect sequence of expected queries
The text was updated successfully, but these errors were encountered:
Feature Description
Over time the test frameworks of both unit and e2e tests for the various vreplication packages have become complex and unwieldy. Several simple things can be done to incrementally improve the overall readability and to reduce the friction in creating and updating tests.
This is a tracking issue to note areas where we can improve as we develop code.
Common
e2e
doc.go
to list all tests used with more high-level summary on what they do. This is an intermediate step to rationalizing the various tests to see if we can remove some in the interests of reducing CI time.doc.go
can also keep track of key functionality that we are not testing.tstWorkflowExec
to use a Request object rather than lots of optional parameters.testVSchemaForSequenceAfterMoveTables
.unit tests
go-mysql-server
's memory db. It will help with reducing the amount of mocking as well as mirror actual db functionality.The text was updated successfully, but these errors were encountered: