@@ -995,6 +995,57 @@ void main() {
995
995
]));
996
996
expect (processRunner.pushTagsArgs, isEmpty);
997
997
});
998
+
999
+ test ('Do not release flutter_plugin_tools' , () async {
1000
+ const Map <String , dynamic > httpResponsePlugin1 = < String , dynamic > {
1001
+ 'name' : 'flutter_plugin_tools' ,
1002
+ 'versions' : < String > [],
1003
+ };
1004
+
1005
+ final MockClient mockClient = MockClient ((http.Request request) async {
1006
+ if (request.url.pathSegments.last == 'flutter_plugin_tools.json' ) {
1007
+ return http.Response (json.encode (httpResponsePlugin1), 200 );
1008
+ }
1009
+ return http.Response ('' , 500 );
1010
+ });
1011
+ final PublishPluginCommand command = PublishPluginCommand (packagesDir,
1012
+ processRunner: processRunner,
1013
+ print: (Object ? message) => printedMessages.add (message.toString ()),
1014
+ stdinput: mockStdin,
1015
+ httpClient: mockClient,
1016
+ gitDir: gitDir);
1017
+
1018
+ commandRunner = CommandRunner <void >(
1019
+ 'publish_check_command' ,
1020
+ 'Test for publish-check command.' ,
1021
+ );
1022
+ commandRunner.addCommand (command);
1023
+
1024
+ final Directory flutterPluginTools =
1025
+ createFakePlugin ('flutter_plugin_tools' , packagesDir);
1026
+ await gitDir.runCommand (< String > ['add' , '-A' ]);
1027
+ await gitDir.runCommand (< String > ['commit' , '-m' , 'Add plugins' ]);
1028
+ // Immediately return 0 when running `pub publish`.
1029
+ processRunner.mockPublishCompleteCode = 0 ;
1030
+ mockStdin.readLineOutput = 'y' ;
1031
+ await commandRunner
1032
+ .run (< String > ['publish-plugin' , '--all-changed' , '--base-sha=HEAD~' ]);
1033
+ expect (
1034
+ printedMessages,
1035
+ containsAllInOrder (< String > [
1036
+ 'Checking local repo...' ,
1037
+ 'Local repo is ready!' ,
1038
+ 'Done!'
1039
+ ]));
1040
+ expect (
1041
+ printedMessages.contains (
1042
+ 'Running `pub publish ` in ${flutterPluginTools .path }...\n ' ,
1043
+ ),
1044
+ isFalse);
1045
+ expect (processRunner.pushTagsArgs, isEmpty);
1046
+ processRunner.pushTagsArgs.clear ();
1047
+ printedMessages.clear ();
1048
+ });
998
1049
});
999
1050
}
1000
1051
0 commit comments