Skip to content

Commit

Permalink
Merge branch 'leancodepl:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
scottandrewzip authored Feb 8, 2024
2 parents ebe2a11 + 4357bbf commit 985a4c4
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 16 deletions.
4 changes: 4 additions & 0 deletions docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ title: Getting started

# Getting started

Check out our video version of this tutorial on YouTube!

<YouTube id="zwQB8LfnTN8" />

<Info>
If you want to use Patrol finders in your existing widget or golden
tests, go to [Using Patrol finders in widget tests].
Expand Down
8 changes: 8 additions & 0 deletions packages/patrol_cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 2.6.4

- Fix compatibility_checker getting stuck (#2091).

## 2.6.3

- Fix invalid JSON output of version check command (#2087).

## 2.6.2

- Print link to devtools regardless of open-devtools flag (#2076).
Expand Down
10 changes: 9 additions & 1 deletion packages/patrol_cli/lib/src/analytics/analytics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,16 @@ FlutterVersion _getFlutterVersion() {
runInShell: true,
);

final versionData = jsonDecode(result.stdOut) as Map<String, dynamic>;
final versionData =
jsonDecode(cleanJsonResult(result)) as Map<String, dynamic>;
final frameworkVersion = versionData['frameworkVersion'] as String;
final channel = versionData['channel'] as String;
return FlutterVersion(frameworkVersion, channel);
}

// Workaround for https://github.com/flutter/flutter/issues/122814
String cleanJsonResult(io.ProcessResult result) {
final parts = result.stdOut.split('}')..removeLast();
final cleanedString = parts.join('}');
return '$cleanedString}';
}
2 changes: 1 addition & 1 deletion packages/patrol_cli/lib/src/base/constants.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/// Version of Patrol CLI. Must be kept in sync with pubspec.yaml.
/// If you update this, make sure that compatibility-table.mdx is updated (if needed)
const version = '2.6.2';
const version = '2.6.4';
29 changes: 16 additions & 13 deletions packages/patrol_cli/lib/src/compatibility_checker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,27 @@ class CompatibilityChecker {
)
..disposedBy(scope);

process.listenStdOut((line) async {
if (line.startsWith('- patrol ')) {
packageCompleter.complete(line.split(' ').last);
}
}).disposedBy(scope);
process.listenStdOut(
(line) async {
if (line.startsWith('- patrol ')) {
packageCompleter.complete(line.split(' ').last);
}
},
onDone: () {
if (!packageCompleter.isCompleted) {
throwToolExit(
'Failed to read patrol version. Make sure you have patrol '
'dependency in your pubspec.yaml file',
);
}
},
).disposedBy(scope);
});

packageVersion = await packageCompleter.future;

if (packageVersion == null) {
throwToolExit(
'Failed to read patrol version. Make sure you have patrol '
'dependency in your pubspec.yaml file',
);
}

final cliVersion = Version.parse(constants.version);
final patrolVersion = Version.parse(packageVersion);
final patrolVersion = Version.parse(packageVersion!);

final isCompatible = cliVersion.isCompatibleWith(patrolVersion);

Expand Down
2 changes: 1 addition & 1 deletion packages/patrol_cli/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: patrol_cli
description: >
Command-line tool for Patrol, a powerful Flutter-native UI testing framework.
version: 2.6.2 # Must be kept in sync with constants.dart
version: 2.6.4 # Must be kept in sync with constants.dart
homepage: https://patrol.leancode.co
repository: https://github.com/leancodepl/patrol/tree/master/packages/patrol_cli
issue_tracker: https://github.com/leancodepl/patrol/issues?q=is%3Aopen+is%3Aissue+label%3A%22package%3A+patrol_cli%22
Expand Down

0 comments on commit 985a4c4

Please sign in to comment.