realm-dart
realm-dart copied to clipboard
Fix flutter test path to realm_dart.dll
When running flutter tests on windows an error appears that realm_dart.dll can not be loaded. It is because executable path for flutter tests is not in the local app directory. The same problem exists also on Linux and MacOS.
This should not be needed. Lets investigate why is this happening.
The executable file for Flutter is: \realm-dart\flutter\realm_flutter\example\build\windows\runner\Debug\realm_example.exe and it is able to find the realm_dart.dll by name only. But when we run the flutter tests the executable file is: \flutter\bin\cache\artifacts\engine\windows-x64\flutter_tester.exe then realm_dart.dll can not be loaded by name only. We need to pass the whole path from the current folder. "./build/windows/runner/Debug/$binaryName.dll";
Why does this work on CI then? 🤔
Why does this work on CI then? 🤔 Command
dart test -r expanded -j 1
is not FlutterPlatform and the path that is returned is "binary/windows/realm_dart.dll". Commandflutter drive -d windows --target=test_driver/app.dart --suppress-analytics --dart-entrypoint-args=""
has executable path\realm-dart\flutter\realm_flutter\tests\build\windows\runner\Debug\tests.exe
and realm_dart.dll is in the same folder, that's why it is found only by name.
Windows:
MacOS:
Linux:
Linked to a task. Will be implemented in a new PR.