Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: test/cache/repair/handles_failure_test.dart

Issue 1664563002: Refactor test servers to make them less global. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/cache/repair/reinstalls_hosted_packages_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | test/cache/repair/reinstalls_hosted_packages_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698