| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'package:pub/src/exit_codes.dart' as exit_codes; | 5 import 'package:pub/src/exit_codes.dart' as exit_codes; |
| 6 import 'package:scheduled_test/scheduled_test.dart'; | 6 import 'package:scheduled_test/scheduled_test.dart'; |
| 7 | 7 |
| 8 import '../../descriptor.dart' as d; | 8 import '../../descriptor.dart' as d; |
| 9 import '../../test_pub.dart'; | 9 import '../../test_pub.dart'; |
| 10 | 10 |
| 11 main() { | 11 main() { |
| 12 integration('handles failure to reinstall some packages', () { | 12 integration('handles failure to reinstall some packages', () { |
| 13 // Only serve two packages so repairing will have a failure. | 13 // Only serve two packages so repairing will have a failure. |
| 14 servePackages((builder) { | 14 servePackages((builder) { |
| 15 builder.serve("foo", "1.2.3"); | 15 builder.serve("foo", "1.2.3"); |
| 16 builder.serve("foo", "1.2.5"); | 16 builder.serve("foo", "1.2.5"); |
| 17 }); | 17 }); |
| 18 | 18 |
| 19 // Set up a cache with some packages. | 19 // Set up a cache with some packages. |
| 20 d.dir(cachePath, [ | 20 d.dir(cachePath, [ |
| 21 d.dir('hosted', [ | 21 d.dir('hosted', [ |
| 22 d.async(port.then((p) => d.dir('localhost%58$p', [ | 22 d.async(globalServer.port.then((p) => d.dir('localhost%58$p', [ |
| 23 d.dir("foo-1.2.3", [ | 23 d.dir("foo-1.2.3", [ |
| 24 d.libPubspec("foo", "1.2.3"), | 24 d.libPubspec("foo", "1.2.3"), |
| 25 d.file("broken.txt") | 25 d.file("broken.txt") |
| 26 ]), | 26 ]), |
| 27 d.dir("foo-1.2.4", [ | 27 d.dir("foo-1.2.4", [ |
| 28 d.libPubspec("foo", "1.2.4"), | 28 d.libPubspec("foo", "1.2.4"), |
| 29 d.file("broken.txt") | 29 d.file("broken.txt") |
| 30 ]), | 30 ]), |
| 31 d.dir("foo-1.2.5", [ | 31 d.dir("foo-1.2.5", [ |
| 32 d.libPubspec("foo", "1.2.5"), | 32 d.libPubspec("foo", "1.2.5"), |
| (...skipping 13 matching lines...) Expand all Loading... |
| 46 pub.stderr.expect(startsWith("Failed to repair foo 1.2.4. Error:")); | 46 pub.stderr.expect(startsWith("Failed to repair foo 1.2.4. Error:")); |
| 47 pub.stderr.expect("HTTP error 404: Not Found"); | 47 pub.stderr.expect("HTTP error 404: Not Found"); |
| 48 | 48 |
| 49 pub.stdout.expect("Reinstalled 2 packages."); | 49 pub.stdout.expect("Reinstalled 2 packages."); |
| 50 pub.stdout.expect("Failed to reinstall 1 package:"); | 50 pub.stdout.expect("Failed to reinstall 1 package:"); |
| 51 pub.stdout.expect("- foo 1.2.4"); | 51 pub.stdout.expect("- foo 1.2.4"); |
| 52 | 52 |
| 53 pub.shouldExit(exit_codes.UNAVAILABLE); | 53 pub.shouldExit(exit_codes.UNAVAILABLE); |
| 54 }); | 54 }); |
| 55 } | 55 } |
| OLD | NEW |