annotate tests/test-editor-filename.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 4bf1889456f3
children f802a75da585
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
34029
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
1 Test temp file used with an editor has the expected suffix.
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
2
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
3 $ hg init
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
4
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
5 Create an editor that writes its arguments to stdout and set it to $HGEDITOR.
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
6
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
7 $ cat > editor.sh << EOF
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
8 > echo "\$@"
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
9 > exit 1
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
10 > EOF
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
11 $ hg add editor.sh
34058
4bf1889456f3 test-editor-filename: fix portability of fake editor command
Yuya Nishihara <yuya@tcha.org>
parents: 34054
diff changeset
12 $ HGEDITOR="sh $TESTTMP/editor.sh"
34029
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
13 $ export HGEDITOR
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
14
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
15 Verify that the path for a commit editor has the expected suffix.
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
16
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
17 $ hg commit
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
18 *.commit.hg.txt (glob)
34058
4bf1889456f3 test-editor-filename: fix portability of fake editor command
Yuya Nishihara <yuya@tcha.org>
parents: 34054
diff changeset
19 abort: edit failed: sh exited with status 1
34029
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
20 [255]
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
21
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
22 Verify that the path for a histedit editor has the expected suffix.
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
23
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
24 $ cat >> $HGRCPATH <<EOF
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
25 > [extensions]
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
26 > rebase=
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
27 > histedit=
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
28 > EOF
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
29 $ hg commit --message 'At least one commit for histedit.'
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
30 $ hg histedit
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
31 *.histedit.hg.txt (glob)
34058
4bf1889456f3 test-editor-filename: fix portability of fake editor command
Yuya Nishihara <yuya@tcha.org>
parents: 34054
diff changeset
32 abort: edit failed: sh exited with status 1
34029
6e6452bc441d editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff changeset
33 [255]
34054
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
34
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
35 Verify that when performing an action that has the side-effect of creating an
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
36 editor for a diff, the file ends in .diff.
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
37
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
38 $ echo 1 > one
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
39 $ echo 2 > two
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
40 $ hg add
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
41 adding one
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
42 adding two
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
43 $ hg commit --interactive --config ui.interactive=true --config ui.interface=text << EOF
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
44 > y
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
45 > e
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
46 > q
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
47 > EOF
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
48 diff --git a/one b/one
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
49 new file mode 100644
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
50 examine changes to 'one'? [Ynesfdaq?] y
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
51
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
52 @@ -0,0 +1,1 @@
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
53 +1
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
54 record change 1/2 to 'one'? [Ynesfdaq?] e
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
55
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
56 *.diff (glob)
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
57 editor exited with exit code 1
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
58 record change 1/2 to 'one'? [Ynesfdaq?] q
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
59
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
60 abort: user quit
3c82b14d2838 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com>
parents: 34029
diff changeset
61 [255]