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

crypto migration tests #7645

Merged
merged 3 commits into from Dec 13, 2022
Merged

crypto migration tests #7645

merged 3 commits into from Dec 13, 2022

Conversation

BillCarsonFr
Copy link
Member

Type of change

  • Technical

Content

Added test to ensure that crypto database migration is done

Motivation and context

Screenshots / GIFs

Tests

  • Step 1
  • Step 2
  • Step ...

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

Copy link
Member

@bmarty bmarty left a 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
Copy link
Member

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

Copy link
Member

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 Show resolved Hide resolved
docs/database_migration_test.md Outdated Show resolved Hide resolved

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- crypto_store.real for crypto
- crypto_store.realm for crypto

docs/database_migration_test.md Outdated Show resolved Hide resolved
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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

@ElementBot
Copy link

Warnings
⚠️ Please add a reviewer to your PR.

Generated by 🚫 dangerJS against dcbdb54

@ElementBot
Copy link

Warnings
⚠️ Please add a reviewer to your PR.

Generated by 🚫 dangerJS against ac5cf99

@bmarty
Copy link
Member

bmarty commented Dec 7, 2022

Please "Squash and merge" this PR, to avoid saving the big realm file to the git history.

@sonarcloud
Copy link

sonarcloud bot commented Dec 9, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@bmarty bmarty merged commit d05e10e into develop Dec 13, 2022
@bmarty bmarty deleted the feature/bca/crypto_migration_test branch December 13, 2022 10:38
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.

None yet

3 participants