realm-dart
realm-dart copied to clipboard
Support unit tests with realm in Flutter projects
- Avoid opening plugin lib when running
flutter test
- Allow running
dart run realm install
in flutter project to install realm lib for unit tests - Use new --flavor flag
Fixes #791, fixes #870
This PR allows you to run:
dart run realm install
or
fluter pub run realm install
in a flutter project to install the dynamic lib needed to run unit tests with dart test
or flutter test
correctly.
Pull Request Test Coverage Report for Build 3910871991
- 0 of 24 (0.0%) changed or added relevant lines in 1 file are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage remained the same at 89.173%
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
---|---|---|---|
lib/src/native/realm_core.dart | 0 | 24 | 0.0% |
<!-- | Total: | 0 | 24 |
Totals | |
---|---|
Change from base Build 3891760475: | 0% |
Covered Lines: | 2825 |
Relevant Lines: | 3168 |
💛 - Coveralls
Is there any simple steps that I can try this on my machine?
You can make a flutter project with tests that use realm. When running flutter test
you will get a dlopen error. Then run flutter pub run realm install
, which will download the desktop lib, and last re-run flutter test
. Second time around it should work.. or at least it should load the lib correctly 😄
@nielsenko Is it possible to have commands like these:
dart run realm_dart install
and flutter pub run realm install
instead of
dart realm install --flavor dart
or flutter pub run realm install --flavor dart
.
It's quite confusing to select flavor dart when you are installing flutter.
It will be better if we can ship this fix without any changes at the existing commands, just allowing the new command flutter pub run realm install
to be run, because we don't have a way to test these commands before to release.
@nielsenko Is it possible to have commands like these:
dart run realm_dart install
andflutter pub run realm install
instead ofdart realm install --flavor dart
orflutter pub run realm install --flavor dart
. It's quite confusing to select flavor dart when you are installing flutter. It will be better if we can ship this fix without any changes at the existing commands, just allowing the new commandflutter pub run realm install
to be run, because we don't have a way to test these commands before to release.
As a user you don't have to add the flavor flag. Both of the commands you mention should suffice, as the default does the right thing.