Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking Issue: VReplication test refactoring, cleanup, documentation enhancements. #13224

Closed
8 tasks
rohit-nayak-ps opened this issue Jun 4, 2023 · 0 comments · Fixed by #14735
Closed
8 tasks

Comments

@rohit-nayak-ps
Copy link
Contributor

rohit-nayak-ps commented Jun 4, 2023

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

  • 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants