Skip to content

Commit

Permalink
CLI - add support for prebuilt iOS artifacts (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Oct 19, 2022
1 parent 95bbb6c commit 60f0bee
Show file tree
Hide file tree
Showing 13 changed files with 918 additions and 183 deletions.
1 change: 0 additions & 1 deletion packages/patrol/example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
Expand Down
1 change: 1 addition & 0 deletions packages/patrol/example/integration_test/example_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ void main() {
'counter state is the same after going to Home and switching apps',
config: patrolConfig,
nativeAutomation: true,
binding: Binding.integrationTest,
($) async {
await $.pumpWidgetAndSettle(ExampleApp());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ Future<void> main() async {
'counter state is the same after switching apps',
config: patrolConfig,
nativeAutomation: true,
binding: Binding.integrationTest,
($) async {
await $.pumpWidgetAndSettle(ExampleApp());

expect($(#counterText).text, '0');
await $(FloatingActionButton).tap();

await $(FloatingActionButton).tap();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ void main() {
'grants various permissions',
config: patrolConfig,
nativeAutomation: true,
binding: Binding.integrationTest,
($) async {
await $.pumpWidgetAndSettle(ExampleApp());

Expand Down
10 changes: 10 additions & 0 deletions packages/patrol/example/test/widget_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import 'package:example/main.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
testWidgets('is displayed', (tester) async {
await tester.pumpWidget(ExampleApp());

expect(find.text('Add'), findsWidgets);
});
}
14 changes: 10 additions & 4 deletions packages/patrol_cli/lib/src/command_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ class PatrolCommandRunner extends CommandRunner<int> {
logger: _logger,
),
);
addCommand(UpdateCommand(pubUpdater: _pubUpdater, logger: _logger));
addCommand(
UpdateCommand(
pubUpdater: _pubUpdater,
artifactsRepository: _artifactsRepository,
logger: _logger,
),
);

argParser
..addFlag(
Expand Down Expand Up @@ -220,7 +226,7 @@ class PatrolCommandRunner extends CommandRunner<int> {

final int? exitCode;
if (topLevelResults['version'] == true) {
_logger.info('patrol_cli v$version');
_logger.info('patrol_cli v$globalVersion');
exitCode = 0;
} else {
exitCode = await super.runCommand(topLevelResults);
Expand Down Expand Up @@ -248,7 +254,7 @@ class PatrolCommandRunner extends CommandRunner<int> {
}

final latestVersion = await _pubUpdater.getLatestVersion(patrolCliPackage);
final isUpToDate = version == latestVersion;
final isUpToDate = globalVersion == latestVersion;

if (isUpToDate) {
return;
Expand All @@ -258,7 +264,7 @@ class PatrolCommandRunner extends CommandRunner<int> {
..info('')
..info(
'''
${lightYellow.wrap('Update available!')} ${lightCyan.wrap(version)} \u2192 ${lightCyan.wrap(latestVersion)}
${lightYellow.wrap('Update available!')} ${lightCyan.wrap(globalVersion)} \u2192 ${lightCyan.wrap(latestVersion)}
Run ${lightCyan.wrap('patrol update')} to update''',
)
..info('');
Expand Down
Loading

0 comments on commit 60f0bee

Please sign in to comment.