mirror of
https://github.com/flutter/packages.git
synced 2025-07-01 23:51:55 +08:00
[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 https://github.com/flutter/flutter/issues/126750
This commit is contained in:
1
.ci.yaml
1
.ci.yaml
@ -334,7 +334,6 @@ targets:
|
|||||||
]
|
]
|
||||||
|
|
||||||
- name: Windows repo_tools_tests
|
- name: Windows repo_tools_tests
|
||||||
bringup: true # https://github.com/flutter/flutter/issues/126750
|
|
||||||
recipe: packages/packages
|
recipe: packages/packages
|
||||||
timeout: 30
|
timeout: 30
|
||||||
properties:
|
properties:
|
||||||
|
@ -14,7 +14,6 @@ import 'package:flutter_plugin_tools/src/publish_command.dart';
|
|||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:http/testing.dart';
|
import 'package:http/testing.dart';
|
||||||
import 'package:mockito/mockito.dart';
|
import 'package:mockito/mockito.dart';
|
||||||
import 'package:platform/platform.dart';
|
|
||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
|
|
||||||
import 'common/package_command_test.mocks.dart';
|
import 'common/package_command_test.mocks.dart';
|
||||||
@ -22,8 +21,6 @@ import 'mocks.dart';
|
|||||||
import 'util.dart';
|
import 'util.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
final String flutterCommand = getFlutterCommand(const LocalPlatform());
|
|
||||||
|
|
||||||
late MockPlatform platform;
|
late MockPlatform platform;
|
||||||
late Directory packagesDir;
|
late Directory packagesDir;
|
||||||
late MockGitDir gitDir;
|
late MockGitDir gitDir;
|
||||||
@ -149,8 +146,7 @@ void main() {
|
|||||||
createFakePlugin('plugin1', packagesDir, examples: <String>[]);
|
createFakePlugin('plugin1', packagesDir, examples: <String>[]);
|
||||||
createFakePlugin('plugin2', packagesDir, examples: <String>[]);
|
createFakePlugin('plugin2', packagesDir, examples: <String>[]);
|
||||||
|
|
||||||
processRunner.mockProcessesForExecutable[flutterCommand] =
|
processRunner.mockProcessesForExecutable['flutter'] = <FakeProcessInfo>[
|
||||||
<FakeProcessInfo>[
|
|
||||||
FakeProcessInfo(
|
FakeProcessInfo(
|
||||||
MockProcess(
|
MockProcess(
|
||||||
stdout: 'Foo',
|
stdout: 'Foo',
|
||||||
@ -206,7 +202,7 @@ void main() {
|
|||||||
expect(
|
expect(
|
||||||
processRunner.recordedCalls,
|
processRunner.recordedCalls,
|
||||||
contains(ProcessCall(
|
contains(ProcessCall(
|
||||||
flutterCommand,
|
'flutter',
|
||||||
const <String>['pub', 'publish', '--dry-run', '--server=bar'],
|
const <String>['pub', 'publish', '--dry-run', '--server=bar'],
|
||||||
plugin.path)));
|
plugin.path)));
|
||||||
});
|
});
|
||||||
@ -229,7 +225,7 @@ void main() {
|
|||||||
expect(
|
expect(
|
||||||
processRunner.recordedCalls,
|
processRunner.recordedCalls,
|
||||||
contains(ProcessCall(
|
contains(ProcessCall(
|
||||||
flutterCommand,
|
'flutter',
|
||||||
const <String>['pub', 'publish', '--server=bar', '--force'],
|
const <String>['pub', 'publish', '--server=bar', '--force'],
|
||||||
plugin.path)));
|
plugin.path)));
|
||||||
});
|
});
|
||||||
@ -253,11 +249,11 @@ void main() {
|
|||||||
processRunner.recordedCalls,
|
processRunner.recordedCalls,
|
||||||
containsAllInOrder(<ProcessCall>[
|
containsAllInOrder(<ProcessCall>[
|
||||||
ProcessCall(
|
ProcessCall(
|
||||||
flutterCommand,
|
'flutter',
|
||||||
const <String>['pub', 'publish', '--server=bar', '--force'],
|
const <String>['pub', 'publish', '--server=bar', '--force'],
|
||||||
plugin1.path),
|
plugin1.path),
|
||||||
ProcessCall(
|
ProcessCall(
|
||||||
flutterCommand,
|
'flutter',
|
||||||
const <String>['pub', 'publish', '--server=bar', '--force'],
|
const <String>['pub', 'publish', '--server=bar', '--force'],
|
||||||
plugin2.path),
|
plugin2.path),
|
||||||
]));
|
]));
|
||||||
@ -285,8 +281,7 @@ void main() {
|
|||||||
test('throws if pub publish fails', () async {
|
test('throws if pub publish fails', () async {
|
||||||
createFakePlugin('foo', packagesDir, examples: <String>[]);
|
createFakePlugin('foo', packagesDir, examples: <String>[]);
|
||||||
|
|
||||||
processRunner.mockProcessesForExecutable[flutterCommand] =
|
processRunner.mockProcessesForExecutable['flutter'] = <FakeProcessInfo>[
|
||||||
<FakeProcessInfo>[
|
|
||||||
FakeProcessInfo(MockProcess(exitCode: 128), <String>['pub', 'publish'])
|
FakeProcessInfo(MockProcess(exitCode: 128), <String>['pub', 'publish'])
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -371,8 +366,7 @@ void main() {
|
|||||||
test('only if publishing succeeded', () async {
|
test('only if publishing succeeded', () async {
|
||||||
createFakePlugin('foo', packagesDir, examples: <String>[]);
|
createFakePlugin('foo', packagesDir, examples: <String>[]);
|
||||||
|
|
||||||
processRunner.mockProcessesForExecutable[flutterCommand] =
|
processRunner.mockProcessesForExecutable['flutter'] = <FakeProcessInfo>[
|
||||||
<FakeProcessInfo>[
|
|
||||||
FakeProcessInfo(MockProcess(exitCode: 128), <String>['pub', 'publish']),
|
FakeProcessInfo(MockProcess(exitCode: 128), <String>['pub', 'publish']),
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -954,7 +948,7 @@ class TestProcessRunner extends RecordingProcessRunner {
|
|||||||
{Directory? workingDirectory}) async {
|
{Directory? workingDirectory}) async {
|
||||||
final io.Process process =
|
final io.Process process =
|
||||||
await super.start(executable, args, workingDirectory: workingDirectory);
|
await super.start(executable, args, workingDirectory: workingDirectory);
|
||||||
if (executable == getFlutterCommand(const LocalPlatform()) &&
|
if (executable == 'flutter' &&
|
||||||
args.isNotEmpty &&
|
args.isNotEmpty &&
|
||||||
args[0] == 'pub' &&
|
args[0] == 'pub' &&
|
||||||
args[1] == 'publish') {
|
args[1] == 'publish') {
|
||||||
|
Reference in New Issue
Block a user