Update flutter_tools/bin/*.(dart|sh) to provide, if set, --local-engine-host. (#132336)

Partial work towards https://github.com/flutter/flutter/issues/132245.

Other than updating error messages, and passing `$LOCAL_ENGINE_HOST`
downwards, this PR should not change the behavior of any existing
workflows or code (i.e. it's purely additive).
This commit is contained in:
Matan Lurey
2023-08-10 15:25:57 -07:00
committed by GitHub
parent 7dff527be5
commit b4d5c8f425
4 changed files with 61 additions and 4 deletions

View File

@@ -70,4 +70,25 @@ void main() {
),
);
});
testWithoutContext('tool_backend.dart exits if local engine host does not match build mode', () async {
final ProcessResult result = await processManager.run(<String>[
dart,
toolBackend,
'linux-x64',
'debug',
], environment: <String, String>{
'PROJECT_DIR': examplePath,
'LOCAL_ENGINE': 'debug_foo_bar', // OK
'LOCAL_ENGINE_HOST': 'release_foo_bar', // Does not contain "debug",
});
expect(
result,
const ProcessResultMatcher(
exitCode: 1,
stderrPattern: "ERROR: Requested build with Flutter local engine host at 'release_foo_bar'",
),
);
});
}