realm-dart icon indicating copy to clipboard operation
realm-dart copied to clipboard

Fix flutter test path to realm_dart.dll

Open desistefanova opened this issue 2 years ago • 4 comments

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.

desistefanova avatar Jun 08 '22 13:06 desistefanova

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";

desistefanova avatar Jun 08 '22 15:06 desistefanova

Why does this work on CI then? 🤔

nirinchev avatar Jun 08 '22 16:06 nirinchev

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". Command flutter 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.

desistefanova avatar Jun 08 '22 17:06 desistefanova

Windows: image

MacOS: image

Linux: image

desistefanova avatar Jun 09 '22 11:06 desistefanova

Linked to a task. Will be implemented in a new PR.

desistefanova avatar Aug 18 '22 09:08 desistefanova