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

Enhancement: use schema test helper to new the events used in the unit test #10909

Open
4 tasks done
3AceShowHand opened this issue Apr 16, 2024 · 0 comments
Open
4 tasks done
Assignees
Labels
area/ticdc Issues or PRs related to TiCDC. component/test Unit tests and integration tests component. type/enhancement The issue or PR belongs to an enhancement.

Comments

@3AceShowHand
Copy link
Contributor

3AceShowHand commented Apr 16, 2024

Backgroud

At the moment, we mock the event, both model.RowChangedEvent and model.DDLEvent by filling fields arbitrarily, which are used in the unit tests, spread over the codebase, it has some drawbacks:

  • the event content may be wrong, does not meet SQL constraints.
  • mock the event by handle is verbose and annoy

The entry.SchemaTestHelper is a test framework based upon the mock TiDB, it supports we can generate DDL and Basic Insert Event by writing SQL, which has the following advantages:

  • All events are generated automatically, following SQL constraints, with no content errors.
  • It makes the unit test easier to read and write.

Tasks

@3AceShowHand 3AceShowHand self-assigned this Apr 16, 2024
@3AceShowHand 3AceShowHand added component/test Unit tests and integration tests component. type/enhancement The issue or PR belongs to an enhancement. area/ticdc Issues or PRs related to TiCDC. labels Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ticdc Issues or PRs related to TiCDC. component/test Unit tests and integration tests component. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

1 participant