Skip to content

Commit 2b38236

Browse files
[ci] Re-enable Windows repo tool tests (#4007)
Fixes publish test to always expect the command being run to be 'flutter', since it uses a mock platform that reports as Linux. Fixes flutter/flutter#126750
1 parent eabaacc commit 2b38236

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

.ci.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ targets:
334334
]
335335
336336
- name: Windows repo_tools_tests
337-
bringup: true # https://github.com/flutter/flutter/issues/126750
338337
recipe: packages/packages
339338
timeout: 30
340339
properties:

script/tool/test/publish_command_test.dart

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@ import 'package:flutter_plugin_tools/src/publish_command.dart';
1414
import 'package:http/http.dart' as http;
1515
import 'package:http/testing.dart';
1616
import 'package:mockito/mockito.dart';
17-
import 'package:platform/platform.dart';
1817
import 'package:test/test.dart';
1918

2019
import 'common/package_command_test.mocks.dart';
2120
import 'mocks.dart';
2221
import 'util.dart';
2322

2423
void main() {
25-
final String flutterCommand = getFlutterCommand(const LocalPlatform());
26-
2724
late MockPlatform platform;
2825
late Directory packagesDir;
2926
late MockGitDir gitDir;
@@ -149,8 +146,7 @@ void main() {
149146
createFakePlugin('plugin1', packagesDir, examples: <String>[]);
150147
createFakePlugin('plugin2', packagesDir, examples: <String>[]);
151148

152-
processRunner.mockProcessesForExecutable[flutterCommand] =
153-
<FakeProcessInfo>[
149+
processRunner.mockProcessesForExecutable['flutter'] = <FakeProcessInfo>[
154150
FakeProcessInfo(
155151
MockProcess(
156152
stdout: 'Foo',
@@ -206,7 +202,7 @@ void main() {
206202
expect(
207203
processRunner.recordedCalls,
208204
contains(ProcessCall(
209-
flutterCommand,
205+
'flutter',
210206
const <String>['pub', 'publish', '--dry-run', '--server=bar'],
211207
plugin.path)));
212208
});
@@ -229,7 +225,7 @@ void main() {
229225
expect(
230226
processRunner.recordedCalls,
231227
contains(ProcessCall(
232-
flutterCommand,
228+
'flutter',
233229
const <String>['pub', 'publish', '--server=bar', '--force'],
234230
plugin.path)));
235231
});
@@ -253,11 +249,11 @@ void main() {
253249
processRunner.recordedCalls,
254250
containsAllInOrder(<ProcessCall>[
255251
ProcessCall(
256-
flutterCommand,
252+
'flutter',
257253
const <String>['pub', 'publish', '--server=bar', '--force'],
258254
plugin1.path),
259255
ProcessCall(
260-
flutterCommand,
256+
'flutter',
261257
const <String>['pub', 'publish', '--server=bar', '--force'],
262258
plugin2.path),
263259
]));
@@ -285,8 +281,7 @@ void main() {
285281
test('throws if pub publish fails', () async {
286282
createFakePlugin('foo', packagesDir, examples: <String>[]);
287283

288-
processRunner.mockProcessesForExecutable[flutterCommand] =
289-
<FakeProcessInfo>[
284+
processRunner.mockProcessesForExecutable['flutter'] = <FakeProcessInfo>[
290285
FakeProcessInfo(MockProcess(exitCode: 128), <String>['pub', 'publish'])
291286
];
292287

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

374-
processRunner.mockProcessesForExecutable[flutterCommand] =
375-
<FakeProcessInfo>[
369+
processRunner.mockProcessesForExecutable['flutter'] = <FakeProcessInfo>[
376370
FakeProcessInfo(MockProcess(exitCode: 128), <String>['pub', 'publish']),
377371
];
378372

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

0 commit comments

Comments
 (0)