Hide default bundle id error when xcresult detects an error (#101993)

This commit is contained in:
Chris Yang
2022-04-15 11:44:08 -07:00
committed by GitHub
parent 1756ccc541
commit a8da7ced35
2 changed files with 45 additions and 12 deletions

View File

@@ -480,7 +480,7 @@ void main() {
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('Display xcresult issues with default bundle identifier.', () async {
testUsingContext('Default bundle identifier error should be hidden if there is another xcresult issue.', () async {
final BuildCommand command = BuildCommand();
_createMinimalMockProjectFiles();
@@ -492,7 +492,7 @@ void main() {
expect(testLogger.errorText, contains("Use of undeclared identifier 'asdas'"));
expect(testLogger.errorText, contains('/Users/m/Projects/test_create/ios/Runner/AppDelegate.m:7:56'));
expect(testLogger.errorText, contains('It appears that your application still contains the default signing identifier.'));
expect(testLogger.errorText, isNot(contains('It appears that your application still contains the default signing identifier.')));
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
@@ -508,6 +508,33 @@ void main() {
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(productBundleIdentifier: 'com.example'),
});
testUsingContext('Show default bundle identifier error if there are no other errors.', () async {
final BuildCommand command = BuildCommand();
_createMinimalMockProjectFiles();
await expectLater(
createTestCommandRunner(command).run(const <String>['build', 'ios', '--no-pub']),
throwsToolExit(),
);
expect(testLogger.errorText, contains('It appears that your application still contains the default signing identifier.'));
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
xattrCommand,
_setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
}),
_setUpXCResultCommand(stdout: kSampleResultJsonNoIssues),
_setUpRsyncCommand(),
]),
Platform: () => macosPlatform,
EnvironmentType: () => EnvironmentType.physical,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(productBundleIdentifier: 'com.example'),
});
testUsingContext('Display xcresult issues with no provisioning profile.', () async {
final BuildCommand command = BuildCommand();