-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[flutter_plugin_tests] Split analyze out of xctest #4161
Conversation
'version': '13.0', | ||
'isAvailable': true, | ||
'name': 'iOS 13.0' | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This testing of finding the best device among many is now part of xcode_test.dart
, so what's left here is just one valid device for the test to find.
group('iOS', () { | ||
test('skip if iOS is not supported', () async { | ||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[ | ||
'example/test', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opportunistic cleanup; this extraFiles
was copy/pasted from some initial test into lots of other tests that don't actually need it, and I've been cleaning it up as I notice.
kPlatformIos: PlatformSupport.inline | ||
}); | ||
|
||
final Directory pluginExampleDirectory = | ||
pluginDirectory.childDirectory('example'); | ||
|
||
processRunner.processToReturn = MockProcess.succeeding(); | ||
processRunner.resultStdout = | ||
'{"project":{"targets":["bar_scheme", "foo_scheme"]}}'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opportunistic cleanup; I'm assuming that this is from an earlier version of xctest_command
, because nothing currently uses this output.
|
||
final List<String> output = await runCapturingPrint(runner, | ||
<String>['xctest', '--macos', _kDestination, 'foo_destination']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opportunistic cleanup; I accidentally left the targets when initially copy/pasting iOS tests for macOS.
@@ -56,9 +59,6 @@ class XCTestCommand extends PackageLoopingCommand { | |||
'Runs the xctests in the iOS and/or macOS example apps.\n\n' | |||
'This command requires "flutter" and "xcrun" to be in your path.'; | |||
|
|||
@override | |||
String get failureListHeader => 'The following packages are failing XCTests:'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opportunistic cleanup; I left this when doing the initial migration to the new base command to minimize test diff, but there's no reason we need a custom summary header for this command.
Both types of tests will run on the same build artifacts, so it should be faster to run them at the same time. It's a fine feature to add, just keep it in mind if you intend to split them into separate CI tests. |
final List<String> findSimulatorsArguments = <String>[ | ||
'simctl', | ||
'list', | ||
'--json' | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you just copied this, but if you add devices available
final List<String> findSimulatorsArguments = <String>[ | |
'simctl', | |
'list', | |
'--json' | |
]; | |
final List<String> findSimulatorsArguments = <String>[ | |
'simctl', | |
'list', | |
'devices', | |
'available', | |
'--json' | |
]; |
The availabilityError
/isAvailable
check below can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done! (I had to add 'runtimes' as well since it's parsing those too.)
])) { | ||
failures.add('iOS'); | ||
} | ||
if (testMacos && !await _analyzePlugin(package, 'macOS')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to worry about this now, but when CI starts using Xcode 13 next year we may need a macOS -destination
option.
flutter/flutter#86590
Yes, I had tested that at the same time I tested splitting out |
d909b95
to
be1596a
Compare
To prep for making a combined command to run native tests across different platforms, rework `xctest`: - Split analyze out into a new `xcode-analyze` command: - Since the analyze step runs a new build over everything with different flags, this is only a small amount slower than the combined version - This makes the logic easier to follow - This allows us to meaningfully report skips, to better notice missing tests. - Add the ability to target specific test bundles (RunnerTests or RunnerUITests) To share code between the commands, this extracts a new `Xcode` helper class. Part of flutter/flutter#84392 and flutter/flutter#86489
To prep for making a combined command to run native tests across different platforms, rework `xctest`: - Split analyze out into a new `xcode-analyze` command: - Since the analyze step runs a new build over everything with different flags, this is only a small amount slower than the combined version - This makes the logic easier to follow - This allows us to meaningfully report skips, to better notice missing tests. - Add the ability to target specific test bundles (RunnerTests or RunnerUITests) To share code between the commands, this extracts a new `Xcode` helper class. Part of flutter/flutter#84392 and flutter/flutter#86489
To prep for making a combined command to run native tests across different platforms, rework
xctest
:xcode-analyze
command:To share code between the commands, this extracts a new
Xcode
helper class.Part of flutter/flutter#84392 and flutter/flutter#86489
Pre-launch Checklist
dart format
.)[shared_preferences]
///
).