-
Notifications
You must be signed in to change notification settings - Fork 154
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
Patrol does't run tests (Total: 0) even with a minimal setup #2489
Comments
Hi @dthuesen , thanks for detailed report.
If the steps above do not help please also attach |
Hi @zoskar, thank you for your very fast reply. 1.) I initially tried to use the MainActivity as it was already set up in my project: css bash css 2.) I almost always wiped the emulators. 3.) I tried several emulators, but all of them were using API 35. Maybe trying different APIs will help. After testing it out, I'll come back and let you know the result. Thank you! |
@dthuesen Please also double check path and content of Patrol does not generate |
@zoskar Thank you for the hint with API 35. That was the main problem. After I set up an emulator with API 34 the test got attached to the app. Solution summary:
Future<String?> initApp() async {
/// application initialization
} Widget buildRootApp(String? deviceLocale) {
/// constructing the root widget with ProviderScope, EasyLocalization, and BetterFeedback
} void main() async {
final logger = Logger();
await runZonedGuarded(() async {
WidgetsFlutterBinding.ensureInitialized();
final deviceLocale = await initApp();
runApp(
buildRootApp(deviceLocale),
);
}, (e, s) {
logger.error('Flutter ASYNCHRONOUS ERROR', error: e, stackTrace: s);
});
}
class App extends ConsumerStatefulWidget {
const App({super.key});
@override
ConsumerState<App> createState() => _AppState();
}
class _AppState extends ConsumerState<App> {
/// the app root and so on
} Hope this helps others, too. Thank you @zoskar, again, for your really fast reply. |
...and to be clear: for me, the problem is solved and Patrol is a great tool. |
This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue. |
Steps to reproduce
No device specified, using the first one (emulator-5554)
• Building apk with entrypoint test_bundle.dart...
✓ Completed building apk with entrypoint test_bundle.dart (30.3s)
• Executing tests of apk with entrypoint test_bundle.dart on emulator-5554...
Hot Restart: logs connected
[WARN] Hot Restart: not attached to the app yet
✓ App shut down on request (13.4s)
Actual results
Environment
In
AndroidManifest.xml
, I set:<activity android:name="software.iva.ivaapp.MainActivity" ... />
And in
MainActivityTest.java (automatically generated by Patrol)
, I have:The app itself launches fine with flutter run. But when running patrol test (or patrol develop), Patrol consistently reports:
Or
[WARN] Hot Restart: not attached to the app yet!
in develop mode.What I've tried
main.dart
No special initializations, no plugins.
flutter clean
, wiping emulator data, adbuninstall <package>
, etc.4. Matching Patrol versions
No matter what, Patrol always shows “0 tests” discovered after the APK is built and installed.
Expected behavior
Patrol should at least detect 1 test and run it successfully.
Actual behavior
Questions
Thanks for any help! I’d be happy to provide logs or additional info if needed.
Logs
Logs verbose test
Patrol version
patrol: ^3.13.2
CLI Version: patrol_cli v3.4.1
Patrol Doctor output
Patrol Doctor output
Flutter Doctor output
Flutter Doctor output
The text was updated successfully, but these errors were encountered: