Chromium Code Reviews

Unified Diff: sdk/lib/_internal/pub/test/get/git/doesnt_fetch_if_nothing_changes_test.dart

Issue 221383002: Don't fetch git repository unnecessarily when running "pub get". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: missing docs Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: sdk/lib/_internal/pub/test/get/git/doesnt_fetch_if_nothing_changes_test.dart
diff --git a/sdk/lib/_internal/pub/test/upgrade/git/upgrade_to_nonexistent_pubspec_test.dart b/sdk/lib/_internal/pub/test/get/git/doesnt_fetch_if_nothing_changes_test.dart
similarity index 57%
copy from sdk/lib/_internal/pub/test/upgrade/git/upgrade_to_nonexistent_pubspec_test.dart
copy to sdk/lib/_internal/pub/test/get/git/doesnt_fetch_if_nothing_changes_test.dart
index b9bd476b83a0f1e502dc681eac184f7cffc71564..54cd98c62e249139c31d33629878c382d0868699 100644
--- a/sdk/lib/_internal/pub/test/upgrade/git/upgrade_to_nonexistent_pubspec_test.dart
+++ b/sdk/lib/_internal/pub/test/get/git/doesnt_fetch_if_nothing_changes_test.dart
@@ -1,15 +1,19 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
library pub_tests;
+import 'package:path/path.dart' as p;
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../../../lib/src/io.dart';
import '../../descriptor.dart' as d;
import '../../test_pub.dart';
main() {
initConfig();
- integration("upgrades Git packages to a nonexistent pubspec", () {
+ integration("doesn't re-fetch a repository if nothing changes", () {
ensureGit();
var repo = d.git('foo.git', [
@@ -18,7 +22,9 @@ main() {
]);
repo.create();
- d.appDir({"foo": {"git": "../foo.git"}}).create();
+ d.appDir({
+ "foo": {"git": {"url": "../foo.git"}}
+ }).create();
pubGet();
@@ -28,11 +34,11 @@ main() {
])
]).validate();
- repo.runGit(['rm', 'pubspec.yaml']);
- repo.runGit(['commit', '-m', 'delete']);
+ // Delete the repo. This will cause "pub get" to fail if it tries to
+ // re-fetch.
+ schedule(() => deleteEntry(p.join(sandboxDir, 'foo.git')));
- pubUpgrade(error: new RegExp(r'Could not find a file named "pubspec.yaml" '
- r'in "[^\n]*"\.'));
+ pubGet();
d.dir(packagesPath, [
d.dir('foo', [
« sdk/lib/_internal/pub/lib/src/git.dart ('K') | « sdk/lib/_internal/pub/lib/src/source/git.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine