Mercurial > hg
view tests/test-directaccess.t @ 36037:8de90e006c78
run-tests: report tests that exception occurred in
We now record the test that an exception occurred in. We put this
information to use by aggregating the count of failures in each
test. For each exception, the exception report now prints the total
number of tests having that exception and the test with the least
number of exceptions exhibiting that failure. The exception list
is now sorted by (total count, tests impacted, count of failures
in least failing test).
This allows us to:
* Assess how widespread a failure is. Some exceptions occur a lot
in a few tests. Others occur over many tests.
* Easily run a test exhibiting an exception without having to find
a failure in test output.
* Find and fix low hanging fruit (e.g. exceptions that are the
only failure in a test).
Here's an example of the new output:
199 (4 tests) /home/gps/src/hg/hgext/blackbox.py:191: %b requires a bytes-like object, or an object that implements __bytes__, not 'str' (test-devel-warnings.t - 1 total)
142 (19 tests) /home/gps/src/hg/hgext/mq.py:655: list indices must be integers or slices, not bytes (test-hardlinks.t - 1 total)
140 (20 tests) /home/gps/src/hg/mercurial/patch.py:296: string argument expected, got 'bytes' (test-audit-subrepo.t - 1 total)
101 (15 tests) /home/gps/src/hg/hgext/convert/convcmd.py:60: encode() argument 1 must be str, not bytes (test-convert-clonebranches.t - 1 total)
90 (2 tests) /home/gps/src/hg/hgext/mq.py:456: can't concat str to bytes (test-mq-qqueue.t - 1 total)
87 (2 tests) /home/gps/src/hg/mercurial/branchmap.py:380: %b requires a bytes-like object, or an object that implements __bytes__, not 'FileNotFoundError' (test-branches.t - 2 total)
85 (22 tests) /home/gps/src/hg/mercurial/sshpeer.py:223: cannot convert 'UUID' object to bytes (test-bundle2-pushback.t - 1 total)
1 (1 tests) /home/gps/src/hg/mercurial/formatter.py:254: %b requires a bytes-like object, or an object that implements __bytes__, not 'str' (test-debugextensions.t - 2 total)
1 (1 tests) /home/gps/src/hg/hgext/convert/convcmd.py:420: startswith first arg must be str or a tuple of str, not bytes (test-convert-authormap.t - 2 total)
1 (1 tests) /home/gps/src/hg/mercurial/revlog.py:797: '>=' not supported between instances of 'NoneType' and 'int' (test-unionrepo.t - 1 total)
1 (1 tests) /home/gps/src/hg/hgext/show.py:129: %b requires a bytes-like object, or an object that implements __bytes__, not 'str' (test-show.t - 1 total)
Differential Revision: https://phab.mercurial-scm.org/D2138
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 11 Feb 2018 12:42:10 -0800 |
parents | a1a5c3842b6f |
children | 7f025c9b7865 |
line wrap: on
line source
Tests for access level on hidden commits by various commands on based of their type. Setting the required config to start this $ cat >> $HGRCPATH <<EOF > [experimental] > evolution=createmarkers, allowunstable > directaccess=True > directaccess.revnums=True > [extensions] > amend = > EOF $ hg init repo $ cd repo $ for ch in a b c; do touch $ch; echo "foo" >> $ch; hg ci -Aqm "Added "$ch; done $ hg log -G -T '{rev}:{node} {desc}' --hidden @ 2:28ad74487de9599d00d81085be739c61fc340652 Added c | o 1:29becc82797a4bc11ec8880b58eaecd2ab3e7760 Added b | o 0:18d04c59bb5d2d4090ad9a5b59bd6274adb63add Added a $ echo "bar" >> c $ hg amend $ hg log -G -T '{rev}:{node} {desc}' --hidden @ 3:2443a0e664694756d8b435d06b6ad84f941b6fc0 Added c | | x 2:28ad74487de9599d00d81085be739c61fc340652 Added c |/ o 1:29becc82797a4bc11ec8880b58eaecd2ab3e7760 Added b | o 0:18d04c59bb5d2d4090ad9a5b59bd6274adb63add Added a Testing read only commands on the hidden revision Testing with rev number $ hg exp 2 --config experimental.directaccess.revnums=False abort: hidden revision '2' was rewritten as: 2443a0e66469! (use --hidden to access hidden revisions) [255] $ hg exp 2 # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 28ad74487de9599d00d81085be739c61fc340652 # Parent 29becc82797a4bc11ec8880b58eaecd2ab3e7760 Added c diff -r 29becc82797a -r 28ad74487de9 c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +foo $ hg log -r 2 changeset: 2:28ad74487de9 user: test date: Thu Jan 01 00:00:00 1970 +0000 obsolete: rewritten using amend as 3:2443a0e66469 summary: Added c $ hg identify -r 2 28ad74487de9 $ hg status --change 2 A c $ hg status --change 2 --config experimental.directaccess.revnums=False abort: hidden revision '2' was rewritten as: 2443a0e66469! (use --hidden to access hidden revisions) [255] $ hg diff -c 2 diff -r 29becc82797a -r 28ad74487de9 c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +foo Testing with hash `hg export` $ hg exp 28ad74 # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 28ad74487de9599d00d81085be739c61fc340652 # Parent 29becc82797a4bc11ec8880b58eaecd2ab3e7760 Added c diff -r 29becc82797a -r 28ad74487de9 c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +foo `hg log` $ hg log -r 28ad74 changeset: 2:28ad74487de9 user: test date: Thu Jan 01 00:00:00 1970 +0000 obsolete: rewritten using amend as 3:2443a0e66469 summary: Added c `hg cat` $ hg cat -r 28ad74 c foo `hg diff` $ hg diff -c 28ad74 diff -r 29becc82797a -r 28ad74487de9 c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +foo `hg files` $ hg files -r 28ad74 a b c `hg identify` $ hg identify -r 28ad74 28ad74487de9 `hg annotate` $ hg annotate -r 28ad74 a 0: foo `hg status` $ hg status --change 28ad74 A c `hg archive` This should not throw error $ hg archive -r 28ad74 foo `hg update` $ hg up 28ad74 updating to a hidden changeset 28ad74487de9 (hidden revision '28ad74487de9' was rewritten as: 2443a0e66469) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg up 3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg up 0 files updated, 0 files merged, 0 files removed, 0 files unresolved `hg revert` $ hg revert -r 28ad74 --all reverting c $ hg diff diff -r 2443a0e66469 c --- a/c Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +1,1 @@ foo -bar Commands with undefined cmdtype should not work right now $ hg phase -r 28ad74 abort: hidden revision '28ad74' was rewritten as: 2443a0e66469! (use --hidden to access hidden revisions) [255] $ hg phase -r 2 abort: hidden revision '2' was rewritten as: 2443a0e66469! (use --hidden to access hidden revisions) [255] Setting a bookmark will make that changeset unhidden, so this should come in end $ hg bookmarks -r 28ad74 book bookmarking hidden changeset 28ad74487de9 (hidden revision '28ad74487de9' was rewritten as: 2443a0e66469) $ hg bookmarks book 2:28ad74487de9