[PATCH 3 of 4 stable v2] largefiles: test coverage of error handling from putlfile

Mads Kiilerich mads at kiilerich.com
Fri Oct 23 14:27:57 CDT 2015


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1445628449 -7200
#      Fri Oct 23 21:27:29 2015 +0200
# Branch stable
# Node ID b8280810816ec6d2512681c249f825a48af0b0bc
# Parent  4b974ff528d704a503e8b22f00126935cabb80a2
largefiles: test coverage of error handling from putlfile

This reveals a wrong and unhelpful 'unexpected putlfile response'.

diff --git a/tests/test-largefiles-cache.t b/tests/test-largefiles-cache.t
--- a/tests/test-largefiles-cache.t
+++ b/tests/test-largefiles-cache.t
@@ -200,3 +200,34 @@ Inject corruption into the largefiles st
   ! large
   ? z
   $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
+
+#if serve
+
+Test coverage of error handling from putlfile:
+
+  $ mkdir $TESTTMP/mirrorcache
+  $ hg serve -R ../mirror -d -p $HGPORT1 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache
+  $ cat hg.pid >> $DAEMON_PIDS
+
+(the following push fails but doesn't show why)
+  $ hg push http://localhost:$HGPORT1 -f --config files.usercache=nocache
+  pushing to http://localhost:$HGPORT1/
+  searching for changes
+  unexpected putlfile response: None
+  abort: remotestore: could not put $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 to remote store http://localhost:$HGPORT1/
+  [255]
+
+  $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
+
+Test coverage of 'missing from store':
+
+  $ hg serve -R ../mirror -d -p $HGPORT2 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache --config "web.allow_push=*" --config web.push_ssl=no
+  $ cat hg.pid >> $DAEMON_PIDS
+
+  $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache
+  pushing to http://localhost:$HGPORT2/
+  searching for changes
+  abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded)
+  [255]
+
+#endif


More information about the Mercurial-devel mailing list