Restore and fix flavors_test_macos (#139841)

Partially resolves[^1] https://github.com/flutter/flutter/issues/139774.

Effectively reverts https://github.com/flutter/flutter/pull/125581.

The main change here is that I deleted and recreated the macos Xcode project for this integration test (hence the large diff). I tried fixing the existing project first, but it was set up quite differently, and—for whatever reason—the integration test would get stuck trying to load `dev/integration_tests/flavors/integration_test/integration_test.dart`.

I verified that this works locally, but I don't know if it's possible to run this on the devicelab try pool to verify that it works on devicelab hardware.

[^1]: I would not close the issue until 1) this PR lands, 2) the integration test consistently passes on CI, and 3) macOS support for flavors is publicly documented.
This commit is contained in:
Andrew Kolos
2023-12-18 00:52:22 -08:00
committed by GitHub
parent 79bc6ded40
commit f8b9748661
16 changed files with 522 additions and 371 deletions

View File

@@ -17,22 +17,27 @@ Future<void> main() async {
final TaskResult installTestsResult = await inDirectory(
'${flutterDirectory.path}/dev/integration_tests/flavors',
() async {
final StringBuffer stderr = StringBuffer();
await evalFlutter(
await flutter(
'install',
options: <String>['--flavor', 'paid', '-d', 'macos'],
);
await flutter(
'install',
options: <String>['--flavor', 'paid', '--uninstall-only', '-d', 'macos'],
);
final StringBuffer stderr = StringBuffer();
await evalFlutter(
'build',
canFail: true,
stderr: stderr,
options: <String>[
'--d', 'macos',
'--flavor', 'free'
],
options: <String>['macos', '--flavor', 'bogus'],
);
final String stderrString = stderr.toString();
if (!stderrString.contains('Host and target are the same. Nothing to install.')) {
print(stderrString);
if (!stderrString.contains('The Xcode project defines schemes:')) {
print(stderrString);
return TaskResult.failure('Installing a macOS app on macOS should no-op');
return TaskResult.failure('Should not succeed with bogus flavor');
}
return TaskResult.success(null);