Skip to content

Commit

Permalink
Revert "fix install checks in flavors devicelab tests" (#133894)
Browse files Browse the repository at this point in the history
Reverts flutter/flutter#133719

`Windows_android flavors_test_win` failed twice in a row in the tree
  • Loading branch information
vashworth authored Sep 1, 2023
1 parent b1f691c commit 5649161
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 81 deletions.
54 changes: 24 additions & 30 deletions dev/devicelab/bin/tasks/flavors_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,31 @@ Future<void> main() async {
await task(() async {
await createFlavorsTest().call();
await createIntegrationTestFlavorsTest().call();
// test install and uninstall of flavors app
await inDirectory('${flutterDirectory.path}/dev/integration_tests/flavors', () async {
await flutter(
'install',
options: <String>['--debug', '--flavor', 'paid'],
);
await flutter(
'install',
options: <String>['--debug', '--flavor', 'paid', '--uninstall-only'],
);
final StringBuffer stderr = StringBuffer();
await evalFlutter(
'install',
canFail: true,
stderr: stderr,
options: <String>['--flavor', 'bogus'],
);

final TaskResult installTestsResult = await inDirectory(
'${flutterDirectory.path}/dev/integration_tests/flavors',
() async {
await flutter(
'install',
options: <String>['--debug', '--flavor', 'paid'],
);
await flutter(
'install',
options: <String>['--debug', '--flavor', 'paid', '--uninstall-only'],
);
final String stderrString = stderr.toString();
if (!stderrString.contains('The Xcode project defines schemes: free, paid')) {
print(stderrString);
return TaskResult.failure('Should not succeed with bogus flavor');
}
});

final StringBuffer stderr = StringBuffer();
await evalFlutter(
'install',
canFail: true,
stderr: stderr,
options: <String>['--flavor', 'bogus'],
);

final String stderrString = stderr.toString();
if (!stderrString.contains('"build/app/outputs/flutter-apk/app-bogus-release.apk" does not exist.')) {
print(stderrString);
return TaskResult.failure('Should not succeed with bogus flavor');
}

return TaskResult.success(null);
},
);

return installTestsResult;
return TaskResult.success(null);
});
}
51 changes: 23 additions & 28 deletions dev/devicelab/bin/tasks/flavors_test_ios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,30 @@ Future<void> main() async {
await createFlavorsTest().call();
await createIntegrationTestFlavorsTest().call();
// test install and uninstall of flavors app
final TaskResult installTestsResult = await inDirectory(
'${flutterDirectory.path}/dev/integration_tests/flavors',
() async {
await flutter(
'install',
options: <String>['--flavor', 'paid'],
);
await flutter(
'install',
options: <String>['--flavor', 'paid', '--uninstall-only'],
);
final StringBuffer stderr = StringBuffer();
await evalFlutter(
'install',
canFail: true,
stderr: stderr,
options: <String>['--flavor', 'bogus'],
);
await inDirectory('${flutterDirectory.path}/dev/integration_tests/flavors', () async {
await flutter(
'install',
options: <String>['--flavor', 'paid'],
);
await flutter(
'install',
options: <String>['--flavor', 'paid', '--uninstall-only'],
);
final StringBuffer stderr = StringBuffer();
await evalFlutter(
'install',
canFail: true,
stderr: stderr,
options: <String>['--flavor', 'bogus'],
);

final String stderrString = stderr.toString();
if (!stderrString.contains('The Xcode project defines schemes: free, paid')) {
print(stderrString);
return TaskResult.failure('Should not succeed with bogus flavor');
}
final String stderrString = stderr.toString();
if (!stderrString.contains('install failed, bogus flavor not found')) {
print(stderrString);
return TaskResult.failure('Should not succeed with bogus flavor');
}
});

return TaskResult.success(null);
},
);

return installTestsResult;
return TaskResult.success(null);
});
}
41 changes: 18 additions & 23 deletions dev/devicelab/bin/tasks/flavors_test_macos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,26 @@ Future<void> main() async {
await createFlavorsTest().call();
await createIntegrationTestFlavorsTest().call();

final TaskResult installTestsResult = await inDirectory(
'${flutterDirectory.path}/dev/integration_tests/flavors',
() async {
final StringBuffer stderr = StringBuffer();
await inDirectory('${flutterDirectory.path}/dev/integration_tests/flavors', () async {
final StringBuffer stderr = StringBuffer();

await evalFlutter(
'install',
canFail: true,
stderr: stderr,
options: <String>[
'--d', 'macos',
'--flavor', 'free'
],
);
await evalFlutter(
'install',
canFail: true,
stderr: stderr,
options: <String>[
'--d', 'macos',
'--flavor', 'free'
],
);

final String stderrString = stderr.toString();
if (!stderrString.contains('Host and target are the same. Nothing to install.')) {
print(stderrString);
return TaskResult.failure('Installing a macOS app on macOS should no-op');
}
final String stderrString = stderr.toString();
if (!stderrString.contains('Host and target are the same. Nothing to install.')) {
print(stderrString);
return TaskResult.failure('Installing a macOS app on macOS should no-op');
}
});

return TaskResult.success(null);
},
);

return installTestsResult;
return TaskResult.success(null);
});
}

0 comments on commit 5649161

Please sign in to comment.