Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ targets:
]

- name: Windows repo_tools_tests
bringup: true # https://github.com/flutter/flutter/issues/126750
recipe: packages/packages
timeout: 30
properties:
Expand Down
22 changes: 8 additions & 14 deletions script/tool/test/publish_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@ import 'package:flutter_plugin_tools/src/publish_command.dart';
import 'package:http/http.dart' as http;
import 'package:http/testing.dart';
import 'package:mockito/mockito.dart';
import 'package:platform/platform.dart';
import 'package:test/test.dart';

import 'common/package_command_test.mocks.dart';
import 'mocks.dart';
import 'util.dart';

void main() {
final String flutterCommand = getFlutterCommand(const LocalPlatform());

late MockPlatform platform;
late Directory packagesDir;
late MockGitDir gitDir;
Expand Down Expand Up @@ -149,8 +146,7 @@ void main() {
createFakePlugin('plugin1', packagesDir, examples: <String>[]);
createFakePlugin('plugin2', packagesDir, examples: <String>[]);

processRunner.mockProcessesForExecutable[flutterCommand] =
<FakeProcessInfo>[
processRunner.mockProcessesForExecutable['flutter'] = <FakeProcessInfo>[
FakeProcessInfo(
MockProcess(
stdout: 'Foo',
Expand Down Expand Up @@ -206,7 +202,7 @@ void main() {
expect(
processRunner.recordedCalls,
contains(ProcessCall(
flutterCommand,
'flutter',
const <String>['pub', 'publish', '--dry-run', '--server=bar'],
plugin.path)));
});
Expand All @@ -229,7 +225,7 @@ void main() {
expect(
processRunner.recordedCalls,
contains(ProcessCall(
flutterCommand,
'flutter',
const <String>['pub', 'publish', '--server=bar', '--force'],
plugin.path)));
});
Expand All @@ -253,11 +249,11 @@ void main() {
processRunner.recordedCalls,
containsAllInOrder(<ProcessCall>[
ProcessCall(
flutterCommand,
'flutter',
const <String>['pub', 'publish', '--server=bar', '--force'],
plugin1.path),
ProcessCall(
flutterCommand,
'flutter',
const <String>['pub', 'publish', '--server=bar', '--force'],
plugin2.path),
]));
Expand Down Expand Up @@ -285,8 +281,7 @@ void main() {
test('throws if pub publish fails', () async {
createFakePlugin('foo', packagesDir, examples: <String>[]);

processRunner.mockProcessesForExecutable[flutterCommand] =
<FakeProcessInfo>[
processRunner.mockProcessesForExecutable['flutter'] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(exitCode: 128), <String>['pub', 'publish'])
];

Expand Down Expand Up @@ -371,8 +366,7 @@ void main() {
test('only if publishing succeeded', () async {
createFakePlugin('foo', packagesDir, examples: <String>[]);

processRunner.mockProcessesForExecutable[flutterCommand] =
<FakeProcessInfo>[
processRunner.mockProcessesForExecutable['flutter'] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(exitCode: 128), <String>['pub', 'publish']),
];

Expand Down Expand Up @@ -954,7 +948,7 @@ class TestProcessRunner extends RecordingProcessRunner {
{Directory? workingDirectory}) async {
final io.Process process =
await super.start(executable, args, workingDirectory: workingDirectory);
if (executable == getFlutterCommand(const LocalPlatform()) &&
if (executable == 'flutter' &&
args.isNotEmpty &&
args[0] == 'pub' &&
args[1] == 'publish') {
Expand Down