-
Notifications
You must be signed in to change notification settings - Fork 3
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
Create suite of sanity tests across DBs and types for equivalency #39
Comments
chadlwilson
added a commit
that referenced
this issue
Nov 29, 2021
… types In practice, different drivers return different types at runtime. The previous strategy is strict, i.e if one driver/DB column returns a 32-bit int and another returns a 64-bit long, they will be considered unequal, regardless of their values. This is probably not desirable. This introduces a strategy that allows a more lenient approach to hashing, which is most likely to be desirable, especially when comparing across DB types, and different schemas which might change the types at DB level for efficiency.
chadlwilson
added a commit
that referenced
this issue
Nov 29, 2021
chadlwilson
added a commit
that referenced
this issue
Nov 29, 2021
chadlwilson
added a commit
that referenced
this issue
Nov 29, 2021
chadlwilson
added a commit
that referenced
this issue
Nov 29, 2021
chadlwilson
added a commit
that referenced
this issue
Nov 29, 2021
chadlwilson
added a commit
that referenced
this issue
Nov 29, 2021
Allows us to start running real reconciliations against the two databases
chadlwilson
added a commit
that referenced
this issue
Nov 29, 2021
…column See r2dbc/r2dbc-mssql#235 - this should be removed with r2dbc-mssql `0.8.8` or `0.9`+
chadlwilson
added a commit
that referenced
this issue
Nov 29, 2021
…ypes Rather than running test/dummy connectivity queries with R2DBC, run actual reconciliations here
chadlwilson
added a commit
that referenced
this issue
Nov 29, 2021
chadlwilson
added a commit
that referenced
this issue
Nov 30, 2021
This is more flexible as we will likely need to define the schema programmatically and dynamically to make the tests super-flexible and easy to debug. Exposed is more of a compile-time thing, so likely not really what we need for this type of testing of data types.
chadlwilson
added a commit
that referenced
this issue
Nov 30, 2021
chadlwilson
added a commit
that referenced
this issue
Nov 30, 2021
Currently we only test with the types which can be declared with a common type alias across the four databases. Challenges * MSSQL/SQL server does not have a BOOL/BOOLEAN type * BIT type is handled different across R2DBC drivers. Some return a BitSet or Boolean, some a ByteBuffer * Comparing floating point numbers doesn't really make sense. They tend to differ and fail the test. Might need to recommend against trying to compare such types, or introduce a "warning" system that will help people debug these.
chadlwilson
added a commit
that referenced
this issue
Nov 30, 2021
chadlwilson
added a commit
that referenced
this issue
Nov 30, 2021
chadlwilson
added a commit
that referenced
this issue
Nov 30, 2021
chadlwilson
added a commit
that referenced
this issue
Nov 30, 2021
This avoids them hanging around longer than currently needed
chadlwilson
added a commit
that referenced
this issue
Nov 30, 2021
chadlwilson
added a commit
that referenced
this issue
Nov 30, 2021
chadlwilson
added a commit
that referenced
this issue
Nov 30, 2021
Use of Exposed was not really helping that much. For now, easier and more consistent to use Flyway everywhere, and move to something else that allows SQL generation later if necessary. One less thing for people to learn for now.
This is done now. As part of this
Things observed and still to consider
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context / Goal
Since the tool is designed to help you validate migration of data across different schema types and even (relational) database implementations, and primarily works based on hashed data representing a row in a dataset, we want to have a way to validate that it is actually working correctly for this purpose.
Since there are potentially differences in the way drivers handle things such as character encodings, number types, timestamp/data types we want to ensure that the hashed data representing one data type in one database is considered hash-identical to that of another. If there is not, there should be a way to ensure they are so using something simple in SQL, or we should probably change our implementation.
Expected Outcome
MultiDataSourceConnectivityIntegrationTest
from Configure integration test tooling to allow testing across DB types #28 to instead of just testing R2DBC connectivity via Micronaut, instead have a suite of simple scenarios that focus on real integration testing scenarios, focused on type differencesint
with value10
in one DB will likely not be considered equal to along
with value10
in another DB, and similar with other types. We will have to make some decisions about how this should work to canonicalize values, and how configurable it needs to be."10"
be considered equal to abigint
of10
?Out of Scope
Additional context / implementation notes
SELECT id as MigrationKey, test_type_column FROM testdata
, creating a single table with a single test data column per testCHAR/VARCHAR
,INT/INTEGER
,BIGINT
,NUMERIC/DECIMAL/REAL/FLOAT
,DATETIME/DATE/TIME/TIMESTAMP
etc)The text was updated successfully, but these errors were encountered: