Skip to content

Conversation

@ramnivas
Copy link
Contributor

Our migration tests used strings in Rust files (for exo and SQL), which required string escaping, prefix stripping, and other modifications. This made reading the test code difficult. Also, we relied on exact string matches, which required paying too much attention to the precise format.

This refactoring:

  1. Move .exo and .sql files outside of rust code
  2. Uses sqlparser to match without considering the format

Note that in some cases, sqlparser doesn't parse valid syntax, so we rely on exact string comparison as a fallback/optimization. We will contribute fixes to sqlparser and then remove this reliance.

Our migration tests used strings in Rust files (for exo and SQL), which required string escaping, prefix stripping, and other modifications. This made reading the test code difficult.
Also, we relied on exact string matches, which required paying too much attention to the precise format.

This refactoring:
1. Move .exo and .sql files outside of rust code
2. Uses `sqlparser` to match without considering the format

Note that in some cases, `sqlparser` doesn't parse valid syntax, so we rely on exact string comparison as a fallback/optimization. We will contribute fixes to `sqlparser` and then remove this reliance.
@ramnivas ramnivas merged commit f22b3d7 into main Dec 19, 2024
6 checks passed
@ramnivas ramnivas deleted the refactor-migration-tests branch December 19, 2024 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants