-
Notifications
You must be signed in to change notification settings - Fork 760
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
crypto migration tests #7645
crypto migration tests #7645
Conversation
38c3dc6
to
45dd05a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Can you check the LFS issue please?
@@ -1 +1,2 @@ | |||
**/snapshots/**/*.png filter=lfs diff=lfs merge=lfs -text | |||
**/src/androidTest/assets/*.realm filter=lfs diff=lfs merge=lfs -text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the db file has been added without using git LFS, because the script validate_lfs.sh
is complaining. Can you check please?
@@ -0,0 +1,47 @@ | |||
## Testing database migration | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the doc!
Not a big deal, but for consistency, it could be great to have a table of content.
Just manually add these 2 lines here:
<!--- TOC -->
<!--- END -->
and run ./gradlew knit
to generate it.
docs/database_migration_test.md
Outdated
|
||
Go to `data/data/im.vector.app.debug/files/<hash>/` | ||
Pick the database you want to test (name can be found in SessionRealmConfigurationFactory): | ||
- crypto_store.real for crypto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- crypto_store.real for crypto | |
- crypto_store.realm for crypto |
docs/database_migration_test.md
Outdated
see `CryptoSanityMigrationTest` or `RealmSessionStoreMigration43Test` for sample tests. | ||
|
||
There are already some databases in the assets folder. | ||
The existing test will properly detect schema changes, and fail with such errors: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing test will properly detect schema changes, and fail with such errors: | |
The existing test will properly detect schema changes, and fail with such errors if a migration is missing: |
...d/src/androidTest/java/org/matrix/android/sdk/internal/database/CryptoSanityMigrationTest.kt
Outdated
Show resolved
Hide resolved
Please "Squash and merge" this PR, to avoid saving the big realm file to the git history. |
Kudos, SonarCloud Quality Gate passed!
|
Type of change
Content
Added test to ensure that crypto database migration is done
Motivation and context
Screenshots / GIFs
Tests
Tested devices
Checklist