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

To solve the wait for {app_id) to idle, we should remove the "FLUTTER_TARGET" Flag, how to avoid this? #2517

Open
radyhaggag opened this issue Feb 2, 2025 · 2 comments
Assignees

Comments

@radyhaggag
Copy link

radyhaggag commented Feb 2, 2025

Now, i have 4 flavors, each flavors has a seperate main_{flavor}.dart file, so if i removed this flag FLUTTER_TARGET How can i set the correct target?

If i run the following command flutter build ios --config-only i should pass the flavor like flutter build ios --config-only --flavor uitest

but this will make all the targets is the same target, and this wrong.

So how can i solve this problem?

@piotruela
Copy link
Collaborator

piotruela commented Feb 6, 2025

Hi @radyhaggag. When running Patrol tests, actual entry point/target of the app is test_bundle.dart. This is a generated wrapper that handles all the Patrol-specific operations before and after running your tests.
Setting the FLUTTER_TARGET variable for a given flavor causes tests run on that flavor to start from the specified FLUTTER_TARGET instead of test_bundle.dart. This results in the process hanging during test execution.
If you want to run test on uitest flavor, what you have to do is pass --flavor uitests (or set it in pubspec.yaml patrol section) and use at the beginning of your test, use "flavor specific" startup method to run the app.

@zoskar zoskar self-assigned this Feb 7, 2025
@radyhaggag
Copy link
Author

Hi @radyhaggag. When running Patrol tests, actual entry point/target of the app is test_bundle.dart. This is a generated wrapper that handles all the Patrol-specific operations before and after running your tests. Setting the FLUTTER_TARGET variable for a given flavor causes tests run on that flavor to start from the specified FLUTTER_TARGET instead of test_bundle.dart. This results in the process hanging during test execution. If you want to run test on uitest flavor, what you have to do is pass --flavor uitests (or set it in pubspec.yaml patrol section) and use at the beginning of your test, use "flavor specific" startup method to run the app.

Yes i know that, i specify the flavor and everything run fine, but the problem that i want to set the target to a specific main file to run in ci/cd like upload to app-store connect and so on.

Currently i solved the problem from my side, when i run the tests in ci cd, i created a dart script to remove the Flutter target from the project in the workflow.

But i think if you can find a better solution to help the developers to deal with this problem faster will be good point.

And thanks for your efforts and thanks for patrol developers this is a great tool to use.

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

No branches or pull requests

3 participants