tests: move blackbox testing of tags to test-tags.t
authorGregory Szorc <gregory.szorc@gmail.com>
Mon, 13 Apr 2015 13:28:37 -0400
changeset 24706 5150b2b5b345
parent 24705 0ead0a07ed9c
child 24707 57f58f96f850
tests: move blackbox testing of tags to test-tags.t We're going to refactor tags cache shortly. It is easier to test the blackbox logging if these tests are in test-tags.t.
tests/test-blackbox.t
tests/test-tags.t
--- a/tests/test-blackbox.t	Mon Apr 13 09:36:33 2015 -0400
+++ b/tests/test-blackbox.t	Mon Apr 13 13:28:37 2015 -0400
@@ -112,18 +112,6 @@
   1970/01/01 00:00:00 bob> wrote base branch cache with 1 labels and 2 nodes
   1970/01/01 00:00:00 bob> strip tip exited 0 after * seconds (glob)
 
-tags cache gets logged
-  $ hg up tip
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ hg tag -m 'create test tag' test-tag
-  $ hg tags
-  tip                                3:5b5562c08298
-  test-tag                           2:d02f48003e62
-  $ hg blackbox -l 3
-  1970/01/01 00:00:00 bob> resolved 1 tags cache entries from 1 manifests in ?.???? seconds (glob)
-  1970/01/01 00:00:00 bob> writing tags cache file with 2 heads and 1 tags
-  1970/01/01 00:00:00 bob> tags exited 0 after ?.?? seconds (glob)
-
 extension and python hooks - use the eol extension for a pythonhook
 
   $ echo '[extensions]' >> .hg/hgrc
@@ -132,9 +120,10 @@
   $ echo 'update = echo hooked' >> .hg/hgrc
   $ hg update
   hooked
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ hg blackbox -l 4
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg blackbox -l 5
   1970/01/01 00:00:00 bob> update
+  1970/01/01 00:00:00 bob> writing tags cache file with 2 heads and 0 tags
   1970/01/01 00:00:00 bob> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob)
   1970/01/01 00:00:00 bob> exthook-update: echo hooked finished in * seconds (glob)
   1970/01/01 00:00:00 bob> update exited 0 after * seconds (glob)
@@ -148,7 +137,7 @@
   $ hg status
   $ hg status
   $ hg tip -q
-  3:5b5562c08298
+  2:d02f48003e62
   $ ls .hg/blackbox.log*
   .hg/blackbox.log
   .hg/blackbox.log.1
--- a/tests/test-tags.t	Mon Apr 13 09:36:33 2015 -0400
+++ b/tests/test-tags.t	Mon Apr 13 13:28:37 2015 -0400
@@ -1,3 +1,11 @@
+setup
+
+  $ cat >> $HGRCPATH << EOF
+  > [extensions]
+  > blackbox=
+  > mock=$TESTDIR/mockblackbox.py
+  > EOF
+
 Helper functions:
 
   $ cacheexists() {
@@ -82,6 +90,18 @@
   $ chmod 755 .hg
 #endif
 
+Tag cache debug info written to blackbox log
+
+  $ rm -f .hg/cache/tags
+  $ hg identify
+  b9154636be93 tip
+  $ hg blackbox -l 4
+  1970/01/01 00:00:00 bob> identify
+  1970/01/01 00:00:00 bob> resolved 1 tags cache entries from 1 manifests in ?.???? seconds (glob)
+  1970/01/01 00:00:00 bob> writing tags cache file with 1 heads and 1 tags
+  1970/01/01 00:00:00 bob> identify exited 0 after ?.?? seconds (glob)
+
+
 Create a branch:
 
   $ echo bb > a