mirror of
https://github.com/flutter/packages.git
synced 2025-06-08 12:47:00 +08:00
[flutter_plugin_tool] Add more failure test coverage (#4132)
Many commands had insufficient failure testing. This adds new tests that ensure that for every Process call, at least one test fails if a failure from that process were ignored (with the exception of calls in the `publish` command, which has a custom process mocking system, so was out of scope here; it already has more coverage than most tests did though.) For a few existing failure tests, adds output checks to ensure that they are testing for the *right* failures. Other changes: - Adds convenience constructors to MockProcess for the common cases of a mock process that just exits with a 0 or 1 status, to reduce test verbosity. - Fixes a few bugs that were found by the new tests. - Minor test cleanup, especially cases where a mock process was being set up just to make all calls succeed, which is the default as of recent changes.
This commit is contained in:
@ -135,13 +135,13 @@ class FirebaseTestLabCommand extends PackageLoopingCommand {
|
||||
|
||||
// Ensures that gradle wrapper exists
|
||||
if (!await _ensureGradleWrapperExists(androidDirectory)) {
|
||||
PackageResult.fail(<String>['Unable to build example apk']);
|
||||
return PackageResult.fail(<String>['Unable to build example apk']);
|
||||
}
|
||||
|
||||
await _configureFirebaseProject();
|
||||
|
||||
if (!await _runGradle(androidDirectory, 'app:assembleAndroidTest')) {
|
||||
PackageResult.fail(<String>['Unable to assemble androidTest']);
|
||||
return PackageResult.fail(<String>['Unable to assemble androidTest']);
|
||||
}
|
||||
|
||||
final List<String> errors = <String>[];
|
||||
@ -236,7 +236,7 @@ class FirebaseTestLabCommand extends PackageLoopingCommand {
|
||||
: null;
|
||||
|
||||
final int exitCode = await processRunner.runAndStream(
|
||||
p.join(directory.path, _gradleWrapper),
|
||||
directory.childFile(_gradleWrapper).path,
|
||||
<String>[
|
||||
target,
|
||||
'-Pverbose=true',
|
||||
|
Reference in New Issue
Block a user