tests/test-bad-extension.t
author Sandu Turcan <idlsoft@gmail.com>
Tue, 03 May 2022 21:44:30 -0400
branchstable
changeset 49241 6b10151b9621
parent 48410 0b2469bf1227
child 48874 af0b21d5a930
permissions -rw-r--r--
narrow_widen_acl: enforce narrowacl in narrow_widen (SEC) Reviewer note: this was sent by the author as a simple bugfix, but can be considered a security patch, since it allows users to access things outside of the ACL, hence the (SEC) prefix. However, this affects the `narrow` extention which is still marked as experimental and has relatively few users aside from large companies with their own security layers on top from what we can gather. We feel (Alphare: or at least, I feel) like pinging the packaging list is enough in this case.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44619
8cab8db59b6c tests: don't run couple of tests related to extensions loading with chg
Pulkit Goyal <7895pulkit@gmail.com>
parents: 43191
diff changeset
     1
#require no-chg
40996
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
     2
  $ filterlog () {
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
     3
  >   sed -e 's!^[0-9/]* [0-9:]* ([0-9]*)>!YYYY/MM/DD HH:MM:SS (PID)>!'
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
     4
  > }
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
     5
31957
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
     6
ensure that failing ui.atexit handlers report sensibly
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
     7
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
     8
  $ cat > $TESTTMP/bailatexit.py <<EOF
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
     9
  > from mercurial import util
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    10
  > def bail():
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    11
  >     raise RuntimeError('ui.atexit handler exception')
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    12
  > 
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    13
  > def extsetup(ui):
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    14
  >     ui.atexit(bail)
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    15
  > EOF
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    16
  $ hg -q --config extensions.bailatexit=$TESTTMP/bailatexit.py \
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    17
  >  help help
40346
943248e47864 commands: adjust metavariables as appropriate
Anton Shestakov <av6@dwimlabs.net>
parents: 40263
diff changeset
    18
  hg help [-eck] [-s PLATFORM] [TOPIC]
31957
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    19
  
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    20
  show help for a given topic or a help overview
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    21
  error in exit handlers:
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    22
  Traceback (most recent call last):
47843
fcd464e6a482 pyoxidized: adapt output of test-bad-extension.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44619
diff changeset
    23
    File "*/mercurial/dispatch.py", line *, in _runexithandlers (glob) (no-pyoxidizer !)
fcd464e6a482 pyoxidized: adapt output of test-bad-extension.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44619
diff changeset
    24
    File "mercurial.dispatch", line *, in _runexithandlers (glob) (pyoxidizer !)
31957
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    25
      func(*args, **kwargs)
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    26
    File "$TESTTMP/bailatexit.py", line *, in bail (glob)
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    27
      raise RuntimeError('ui.atexit handler exception')
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    28
  RuntimeError: ui.atexit handler exception
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    29
  [255]
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    30
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    31
  $ rm $TESTTMP/bailatexit.py
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    32
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    33
another bad extension
84f9eb9758c0 atexit: test failing handlers
Bryan O'Sullivan <bryano@fb.com>
parents: 30027
diff changeset
    34
11858
934c7e91c126 tests: unify test-bad-extension
Martin Geisler <mg@lazybytes.net>
parents: 6204
diff changeset
    35
  $ echo 'raise Exception("bit bucket overflow")' > badext.py
28083
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
    36
  $ abspathexc=`pwd`/badext.py
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
    37
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
    38
  $ cat >baddocext.py <<EOF
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
    39
  > """
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
    40
  > baddocext is bad
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
    41
  > """
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
    42
  > EOF
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
    43
  $ abspathdoc=`pwd`/baddocext.py
3014
01454af644b8 load extensions only after the ui object has been completely initialized
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    44
23172
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 14286
diff changeset
    45
  $ cat <<EOF >> $HGRCPATH
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 14286
diff changeset
    46
  > [extensions]
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 14286
diff changeset
    47
  > gpg =
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 14286
diff changeset
    48
  > hgext.gpg =
28083
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
    49
  > badext = $abspathexc
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
    50
  > baddocext = $abspathdoc
23172
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 14286
diff changeset
    51
  > badext2 =
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 14286
diff changeset
    52
  > EOF
3014
01454af644b8 load extensions only after the ui object has been completely initialized
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    53
26239
f39953663cc9 test-bad-extension: reduce dependencies on other things
timeless@mozdev.org
parents: 25364
diff changeset
    54
  $ hg -q help help 2>&1 |grep extension
48360
e4acdf5d94a2 extensions: highlight the name of the faulty extensions in the error message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47843
diff changeset
    55
  *** failed to import extension "badext" from $TESTTMP/badext.py: bit bucket overflow
48410
0b2469bf1227 python2-compat: fix extensions' tests on python2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
    56
  *** failed to import extension "badext2": No module named 'badext2' (py3 !)
0b2469bf1227 python2-compat: fix extensions' tests on python2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
    57
  *** failed to import extension "badext2": No module named badext2 (no-py3 !)
25364
de23a552fc23 extensions: show traceback on load failure if --traceback flag is set
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
    58
de23a552fc23 extensions: show traceback on load failure if --traceback flag is set
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
    59
show traceback
de23a552fc23 extensions: show traceback on load failure if --traceback flag is set
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
    60
40237
772c1145bcef tests: expand our coverage of errors in Python 3 for bad extensions
Augie Fackler <augie@google.com>
parents: 40236
diff changeset
    61
  $ hg -q help help --traceback 2>&1 | egrep ' extension|^Exception|Traceback|ImportError|ModuleNotFound'
48360
e4acdf5d94a2 extensions: highlight the name of the faulty extensions in the error message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47843
diff changeset
    62
  *** failed to import extension "badext" from $TESTTMP/badext.py: bit bucket overflow
25364
de23a552fc23 extensions: show traceback on load failure if --traceback flag is set
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
    63
  Traceback (most recent call last):
de23a552fc23 extensions: show traceback on load failure if --traceback flag is set
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
    64
  Exception: bit bucket overflow
48410
0b2469bf1227 python2-compat: fix extensions' tests on python2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
    65
  *** failed to import extension "badext2": No module named 'badext2' (py3 !)
0b2469bf1227 python2-compat: fix extensions' tests on python2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
    66
  *** failed to import extension "badext2": No module named badext2 (no-py3 !)
25364
de23a552fc23 extensions: show traceback on load failure if --traceback flag is set
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
    67
  Traceback (most recent call last):
40263
8cf459d8b111 py3: use py3 as the test tag, dropping the k
Martijn Pieters <mj@octobus.net>
parents: 40237
diff changeset
    68
  ImportError: No module named badext2 (no-py3 !)
43191
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
    69
  ImportError: No module named 'hgext.badext2' (py3 no-py36 !)
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
    70
  ModuleNotFoundError: No module named 'hgext.badext2' (py36 !)
40263
8cf459d8b111 py3: use py3 as the test tag, dropping the k
Martijn Pieters <mj@octobus.net>
parents: 40237
diff changeset
    71
  Traceback (most recent call last): (py3 !)
43191
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
    72
  ImportError: No module named 'hgext3rd.badext2' (py3 no-py36 !)
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
    73
  ModuleNotFoundError: No module named 'hgext3rd.badext2' (py36 !)
40263
8cf459d8b111 py3: use py3 as the test tag, dropping the k
Martijn Pieters <mj@octobus.net>
parents: 40237
diff changeset
    74
  Traceback (most recent call last): (py3 !)
43191
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
    75
  ImportError: No module named 'badext2' (py3 no-py36 !)
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
    76
  ModuleNotFoundError: No module named 'badext2' (py36 !)
25364
de23a552fc23 extensions: show traceback on load failure if --traceback flag is set
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
    77
28155
7f430b2ac7fd extensions: add notloaded method to return extensions failed to load
Jun Wu <quark@fb.com>
parents: 28083
diff changeset
    78
names of extensions failed to load can be accessed via extensions.notloaded()
7f430b2ac7fd extensions: add notloaded method to return extensions failed to load
Jun Wu <quark@fb.com>
parents: 28083
diff changeset
    79
7f430b2ac7fd extensions: add notloaded method to return extensions failed to load
Jun Wu <quark@fb.com>
parents: 28083
diff changeset
    80
  $ cat <<EOF > showbadexts.py
32337
46ba2cdda476 registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 31957
diff changeset
    81
  > from mercurial import commands, extensions, registrar
28155
7f430b2ac7fd extensions: add notloaded method to return extensions failed to load
Jun Wu <quark@fb.com>
parents: 28083
diff changeset
    82
  > cmdtable = {}
32337
46ba2cdda476 registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 31957
diff changeset
    83
  > command = registrar.command(cmdtable)
33097
fce4ed2912bb py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
    84
  > @command(b'showbadexts', norepo=True)
28155
7f430b2ac7fd extensions: add notloaded method to return extensions failed to load
Jun Wu <quark@fb.com>
parents: 28083
diff changeset
    85
  > def showbadexts(ui, *pats, **opts):
40186
9cbc2579f5be tests: fix up test-bad-extension.t's inline extension
Augie Fackler <augie@google.com>
parents: 39511
diff changeset
    86
  >     ui.write(b'BADEXTS: %s\n' % b' '.join(sorted(extensions.notloaded())))
28155
7f430b2ac7fd extensions: add notloaded method to return extensions failed to load
Jun Wu <quark@fb.com>
parents: 28083
diff changeset
    87
  > EOF
7f430b2ac7fd extensions: add notloaded method to return extensions failed to load
Jun Wu <quark@fb.com>
parents: 28083
diff changeset
    88
  $ hg --config extensions.badexts=showbadexts.py showbadexts 2>&1 | grep '^BADEXTS'
7f430b2ac7fd extensions: add notloaded method to return extensions failed to load
Jun Wu <quark@fb.com>
parents: 28083
diff changeset
    89
  BADEXTS: badext badext2
7f430b2ac7fd extensions: add notloaded method to return extensions failed to load
Jun Wu <quark@fb.com>
parents: 28083
diff changeset
    90
39112
f2e645dc6a67 tests: conditionalize extension tests for extra extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38798
diff changeset
    91
#if no-extraextensions
38727
fcb517ff9562 debug: move extensions debug behind a dedicated flag
Boris Feld <boris.feld@octobus.net>
parents: 38532
diff changeset
    92
show traceback for ImportError of hgext.name if devel.debug.extensions is set
25364
de23a552fc23 extensions: show traceback on load failure if --traceback flag is set
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
    93
38727
fcb517ff9562 debug: move extensions debug behind a dedicated flag
Boris Feld <boris.feld@octobus.net>
parents: 38532
diff changeset
    94
  $ (hg help help --traceback --debug --config devel.debug.extensions=yes 2>&1) \
26239
f39953663cc9 test-bad-extension: reduce dependencies on other things
timeless@mozdev.org
parents: 25364
diff changeset
    95
  > | grep -v '^ ' \
40996
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
    96
  > | filterlog \
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
    97
  > | egrep 'extension..[^p]|^Exception|Traceback|ImportError|^YYYY|not import|ModuleNotFound'
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
    98
  YYYY/MM/DD HH:MM:SS (PID)> loading extensions
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
    99
  YYYY/MM/DD HH:MM:SS (PID)> - processing 5 entries
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   100
  YYYY/MM/DD HH:MM:SS (PID)>   - loading extension: gpg
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   101
  YYYY/MM/DD HH:MM:SS (PID)>   > gpg extension loaded in * (glob)
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   102
  YYYY/MM/DD HH:MM:SS (PID)>     - validating extension tables: gpg
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   103
  YYYY/MM/DD HH:MM:SS (PID)>     - invoking registered callbacks: gpg
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   104
  YYYY/MM/DD HH:MM:SS (PID)>     > callbacks completed in * (glob)
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   105
  YYYY/MM/DD HH:MM:SS (PID)>   - loading extension: badext
48360
e4acdf5d94a2 extensions: highlight the name of the faulty extensions in the error message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47843
diff changeset
   106
  *** failed to import extension "badext" from $TESTTMP/badext.py: bit bucket overflow
25364
de23a552fc23 extensions: show traceback on load failure if --traceback flag is set
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
   107
  Traceback (most recent call last):
de23a552fc23 extensions: show traceback on load failure if --traceback flag is set
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
   108
  Exception: bit bucket overflow
40996
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   109
  YYYY/MM/DD HH:MM:SS (PID)>   - loading extension: baddocext
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   110
  YYYY/MM/DD HH:MM:SS (PID)>   > baddocext extension loaded in * (glob)
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   111
  YYYY/MM/DD HH:MM:SS (PID)>     - validating extension tables: baddocext
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   112
  YYYY/MM/DD HH:MM:SS (PID)>     - invoking registered callbacks: baddocext
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   113
  YYYY/MM/DD HH:MM:SS (PID)>     > callbacks completed in * (glob)
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   114
  YYYY/MM/DD HH:MM:SS (PID)>   - loading extension: badext2
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   115
  YYYY/MM/DD HH:MM:SS (PID)>     - could not import hgext.badext2 (No module named *badext2*): trying hgext3rd.badext2 (glob)
25364
de23a552fc23 extensions: show traceback on load failure if --traceback flag is set
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
   116
  Traceback (most recent call last):
40263
8cf459d8b111 py3: use py3 as the test tag, dropping the k
Martijn Pieters <mj@octobus.net>
parents: 40237
diff changeset
   117
  ImportError: No module named badext2 (no-py3 !)
43191
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
   118
  ImportError: No module named 'hgext.badext2' (py3 no-py36 !)
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
   119
  ModuleNotFoundError: No module named 'hgext.badext2' (py36 !)
40996
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   120
  YYYY/MM/DD HH:MM:SS (PID)>     - could not import hgext3rd.badext2 (No module named *badext2*): trying badext2 (glob)
28541
4b81487a01d4 extensions: also search for extension in the 'hgext3rd' package
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 28338
diff changeset
   121
  Traceback (most recent call last):
40263
8cf459d8b111 py3: use py3 as the test tag, dropping the k
Martijn Pieters <mj@octobus.net>
parents: 40237
diff changeset
   122
  ImportError: No module named badext2 (no-py3 !)
43191
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
   123
  ImportError: No module named 'hgext.badext2' (py3 no-py36 !)
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
   124
  ModuleNotFoundError: No module named 'hgext.badext2' (py36 !)
40263
8cf459d8b111 py3: use py3 as the test tag, dropping the k
Martijn Pieters <mj@octobus.net>
parents: 40237
diff changeset
   125
  Traceback (most recent call last): (py3 !)
43191
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
   126
  ImportError: No module named 'hgext3rd.badext2' (py3 no-py36 !)
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
   127
  ModuleNotFoundError: No module named 'hgext3rd.badext2' (py36 !)
48410
0b2469bf1227 python2-compat: fix extensions' tests on python2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
   128
  *** failed to import extension "badext2": No module named 'badext2' (py3 !)
0b2469bf1227 python2-compat: fix extensions' tests on python2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
   129
  *** failed to import extension "badext2": No module named badext2 (no-py3 !)
25364
de23a552fc23 extensions: show traceback on load failure if --traceback flag is set
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
   130
  Traceback (most recent call last):
43191
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
   131
  ImportError: No module named 'hgext.badext2' (py3 no-py36 !)
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
   132
  ModuleNotFoundError: No module named 'hgext.badext2' (py36 !)
40263
8cf459d8b111 py3: use py3 as the test tag, dropping the k
Martijn Pieters <mj@octobus.net>
parents: 40237
diff changeset
   133
  Traceback (most recent call last): (py3 !)
43191
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
   134
  ImportError: No module named 'hgext3rd.badext2' (py3 no-py36 !)
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
   135
  ModuleNotFoundError: No module named 'hgext3rd.badext2' (py36 !)
40263
8cf459d8b111 py3: use py3 as the test tag, dropping the k
Martijn Pieters <mj@octobus.net>
parents: 40237
diff changeset
   136
  Traceback (most recent call last): (py3 !)
43191
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
   137
  ModuleNotFoundError: No module named 'badext2' (py36 !)
5ed1abd0ea26 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk>
parents: 40996
diff changeset
   138
  ImportError: No module named 'badext2' (py3 no-py36 !)
40263
8cf459d8b111 py3: use py3 as the test tag, dropping the k
Martijn Pieters <mj@octobus.net>
parents: 40237
diff changeset
   139
  ImportError: No module named badext2 (no-py3 !)
40996
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   140
  YYYY/MM/DD HH:MM:SS (PID)> > loaded 2 extensions, total time * (glob)
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   141
  YYYY/MM/DD HH:MM:SS (PID)> - loading configtable attributes
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   142
  YYYY/MM/DD HH:MM:SS (PID)> - executing uisetup hooks
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   143
  YYYY/MM/DD HH:MM:SS (PID)>   - running uisetup for gpg
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   144
  YYYY/MM/DD HH:MM:SS (PID)>   > uisetup for gpg took * (glob)
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   145
  YYYY/MM/DD HH:MM:SS (PID)>   - running uisetup for baddocext
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   146
  YYYY/MM/DD HH:MM:SS (PID)>   > uisetup for baddocext took * (glob)
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   147
  YYYY/MM/DD HH:MM:SS (PID)> > all uisetup took * (glob)
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   148
  YYYY/MM/DD HH:MM:SS (PID)> - executing extsetup hooks
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   149
  YYYY/MM/DD HH:MM:SS (PID)>   - running extsetup for gpg
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   150
  YYYY/MM/DD HH:MM:SS (PID)>   > extsetup for gpg took * (glob)
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   151
  YYYY/MM/DD HH:MM:SS (PID)>   - running extsetup for baddocext
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   152
  YYYY/MM/DD HH:MM:SS (PID)>   > extsetup for baddocext took * (glob)
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   153
  YYYY/MM/DD HH:MM:SS (PID)> > all extsetup took * (glob)
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   154
  YYYY/MM/DD HH:MM:SS (PID)> - executing remaining aftercallbacks
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   155
  YYYY/MM/DD HH:MM:SS (PID)> > remaining aftercallbacks completed in * (glob)
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   156
  YYYY/MM/DD HH:MM:SS (PID)> - loading extension registration objects
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   157
  YYYY/MM/DD HH:MM:SS (PID)> > extension registration object loading took * (glob)
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   158
  YYYY/MM/DD HH:MM:SS (PID)> > extension baddocext take a total of * to load (glob)
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   159
  YYYY/MM/DD HH:MM:SS (PID)> > extension gpg take a total of * to load (glob)
6f2510b581a0 extensions: use ui.log() interface to provide detailed loading information
Yuya Nishihara <yuya@tcha.org>
parents: 40440
diff changeset
   160
  YYYY/MM/DD HH:MM:SS (PID)> extension loading complete
39112
f2e645dc6a67 tests: conditionalize extension tests for extra extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38798
diff changeset
   161
#endif
28083
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
   162
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
   163
confirm that there's no crash when an extension's documentation is bad
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
   164
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
   165
  $ hg help --keyword baddocext
48360
e4acdf5d94a2 extensions: highlight the name of the faulty extensions in the error message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47843
diff changeset
   166
  *** failed to import extension "badext" from $TESTTMP/badext.py: bit bucket overflow
48410
0b2469bf1227 python2-compat: fix extensions' tests on python2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
   167
  *** failed to import extension "badext2": No module named 'badext2' (py3 !)
0b2469bf1227 python2-compat: fix extensions' tests on python2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
   168
  *** failed to import extension "badext2": No module named badext2 (no-py3 !)
28083
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
   169
  Topics:
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
   170
  
550097d01ca3 tests: confirm that a badly documented extension doesn't cause a crash
Simon Farnsworth <simonfar@fb.com>
parents: 27538
diff changeset
   171
   extensions Using Additional Features