##// END OF EJS Templates
tests: add optional Python 2.7 deprecation output...
Gregory Szorc -
r41672:14983ac4 default
parent child Browse files
Show More
@@ -1,266 +1,267
1 1 hg debuginstall
2 2 $ hg debuginstall
3 3 checking encoding (ascii)...
4 4 checking Python executable (*) (glob)
5 5 checking Python version (2.*) (glob) (no-py3 !)
6 6 checking Python version (3.*) (glob) (py3 !)
7 7 checking Python lib (.*[Ll]ib.*)... (re)
8 8 checking Python security support (*) (glob)
9 9 TLS 1.2 not supported by Python install; network connections lack modern security (?)
10 10 SNI not supported by Python install; may have connectivity issues with some servers (?)
11 11 checking Mercurial version (*) (glob)
12 12 checking Mercurial custom build (*) (glob)
13 13 checking module policy (*) (glob)
14 14 checking installed modules (*mercurial)... (glob)
15 15 checking registered compression engines (*zlib*) (glob)
16 16 checking available compression engines (*zlib*) (glob)
17 17 checking available compression engines for wire protocol (*zlib*) (glob)
18 18 checking "re2" regexp engine \((available|missing)\) (re)
19 19 checking templates (*mercurial?templates)... (glob)
20 20 checking default template (*mercurial?templates?map-cmdline.default) (glob)
21 21 checking commit editor... (*) (glob)
22 22 checking username (test)
23 23 no problems detected
24 24
25 25 hg debuginstall JSON
26 26 $ hg debuginstall -Tjson | sed 's|\\\\|\\|g'
27 27 [
28 28 {
29 29 "compengines": ["bz2", "bz2truncated", "none", "zlib"*], (glob)
30 30 "compenginesavail": ["bz2", "bz2truncated", "none", "zlib"*], (glob)
31 31 "compenginesserver": [*"zlib"*], (glob)
32 32 "defaulttemplate": "*mercurial?templates?map-cmdline.default", (glob)
33 33 "defaulttemplateerror": null,
34 34 "defaulttemplatenotfound": "default",
35 35 "editor": "*", (glob)
36 36 "editornotfound": false,
37 37 "encoding": "ascii",
38 38 "encodingerror": null,
39 39 "extensionserror": null, (no-pure !)
40 40 "hgmodulepolicy": "*", (glob)
41 41 "hgmodules": "*mercurial", (glob)
42 42 "hgver": "*", (glob)
43 43 "hgverextra": "*", (glob)
44 44 "problems": 0,
45 45 "pythonexe": "*", (glob)
46 46 "pythonlib": "*", (glob)
47 47 "pythonsecurity": [*], (glob)
48 48 "pythonver": "*.*.*", (glob)
49 49 "re2": (true|false), (re)
50 50 "templatedirs": "*mercurial?templates", (glob)
51 51 "username": "test",
52 52 "usernameerror": null,
53 53 "vinotfound": false
54 54 }
55 55 ]
56 56
57 57 hg debuginstall with no username
58 58 $ HGUSER= hg debuginstall
59 59 checking encoding (ascii)...
60 60 checking Python executable (*) (glob)
61 61 checking Python version (2.*) (glob) (no-py3 !)
62 62 checking Python version (3.*) (glob) (py3 !)
63 63 checking Python lib (.*[Ll]ib.*)... (re)
64 64 checking Python security support (*) (glob)
65 65 TLS 1.2 not supported by Python install; network connections lack modern security (?)
66 66 SNI not supported by Python install; may have connectivity issues with some servers (?)
67 67 checking Mercurial version (*) (glob)
68 68 checking Mercurial custom build (*) (glob)
69 69 checking module policy (*) (glob)
70 70 checking installed modules (*mercurial)... (glob)
71 71 checking registered compression engines (*zlib*) (glob)
72 72 checking available compression engines (*zlib*) (glob)
73 73 checking available compression engines for wire protocol (*zlib*) (glob)
74 74 checking "re2" regexp engine \((available|missing)\) (re)
75 75 checking templates (*mercurial?templates)... (glob)
76 76 checking default template (*mercurial?templates?map-cmdline.default) (glob)
77 77 checking commit editor... (*) (glob)
78 78 checking username...
79 79 no username supplied
80 80 (specify a username in your configuration file)
81 81 1 problems detected, please check your install!
82 82 [1]
83 83
84 84 hg debuginstall with invalid encoding
85 85 $ HGENCODING=invalidenc hg debuginstall | grep encoding
86 86 checking encoding (invalidenc)...
87 87 unknown encoding: invalidenc
88 88
89 89 exception message in JSON
90 90
91 91 $ HGENCODING=invalidenc HGUSER= hg debuginstall -Tjson | grep error
92 92 "defaulttemplateerror": null,
93 93 "encodingerror": "unknown encoding: invalidenc",
94 94 "extensionserror": null, (no-pure !)
95 95 "usernameerror": "no username supplied",
96 96
97 97 path variables are expanded (~ is the same as $TESTTMP)
98 98 $ mkdir tools
99 99 $ touch tools/testeditor.exe
100 100 #if execbit
101 101 $ chmod 755 tools/testeditor.exe
102 102 #endif
103 103 $ HGEDITOR="~/tools/testeditor.exe" hg debuginstall
104 104 checking encoding (ascii)...
105 105 checking Python executable (*) (glob)
106 106 checking Python version (2.*) (glob) (no-py3 !)
107 107 checking Python version (3.*) (glob) (py3 !)
108 108 checking Python lib (.*[Ll]ib.*)... (re)
109 109 checking Python security support (*) (glob)
110 110 TLS 1.2 not supported by Python install; network connections lack modern security (?)
111 111 SNI not supported by Python install; may have connectivity issues with some servers (?)
112 112 checking Mercurial version (*) (glob)
113 113 checking Mercurial custom build (*) (glob)
114 114 checking module policy (*) (glob)
115 115 checking installed modules (*mercurial)... (glob)
116 116 checking registered compression engines (*zlib*) (glob)
117 117 checking available compression engines (*zlib*) (glob)
118 118 checking available compression engines for wire protocol (*zlib*) (glob)
119 119 checking "re2" regexp engine \((available|missing)\) (re)
120 120 checking templates (*mercurial?templates)... (glob)
121 121 checking default template (*mercurial?templates?map-cmdline.default) (glob)
122 122 checking commit editor... ($TESTTMP/tools/testeditor.exe)
123 123 checking username (test)
124 124 no problems detected
125 125
126 126 print out the binary post-shlexsplit in the error message when commit editor is
127 127 not found (this is intentionally using backslashes to mimic a windows usecase).
128 128 $ HGEDITOR="c:\foo\bar\baz.exe -y -z" hg debuginstall
129 129 checking encoding (ascii)...
130 130 checking Python executable (*) (glob)
131 131 checking Python version (2.*) (glob) (no-py3 !)
132 132 checking Python version (3.*) (glob) (py3 !)
133 133 checking Python lib (.*[Ll]ib.*)... (re)
134 134 checking Python security support (*) (glob)
135 135 TLS 1.2 not supported by Python install; network connections lack modern security (?)
136 136 SNI not supported by Python install; may have connectivity issues with some servers (?)
137 137 checking Mercurial version (*) (glob)
138 138 checking Mercurial custom build (*) (glob)
139 139 checking module policy (*) (glob)
140 140 checking installed modules (*mercurial)... (glob)
141 141 checking registered compression engines (*zlib*) (glob)
142 142 checking available compression engines (*zlib*) (glob)
143 143 checking available compression engines for wire protocol (*zlib*) (glob)
144 144 checking "re2" regexp engine \((available|missing)\) (re)
145 145 checking templates (*mercurial?templates)... (glob)
146 146 checking default template (*mercurial?templates?map-cmdline.default) (glob)
147 147 checking commit editor... (c:\foo\bar\baz.exe) (windows !)
148 148 Can't find editor 'c:\foo\bar\baz.exe' in PATH (windows !)
149 149 checking commit editor... (c:foobarbaz.exe) (no-windows !)
150 150 Can't find editor 'c:foobarbaz.exe' in PATH (no-windows !)
151 151 (specify a commit editor in your configuration file)
152 152 checking username (test)
153 153 1 problems detected, please check your install!
154 154 [1]
155 155
156 156 #if test-repo
157 157 $ . "$TESTDIR/helpers-testrepo.sh"
158 158
159 159 $ cat >> wixxml.py << EOF
160 160 > import os
161 161 > import subprocess
162 162 > import sys
163 163 > import xml.etree.ElementTree as ET
164 164 > from mercurial import pycompat
165 165 >
166 166 > # MSYS mangles the path if it expands $TESTDIR
167 167 > testdir = os.environ['TESTDIR']
168 168 > ns = {'wix' : 'http://schemas.microsoft.com/wix/2006/wi'}
169 169 >
170 170 > def directory(node, relpath):
171 171 > '''generator of files in the xml node, rooted at relpath'''
172 172 > dirs = node.findall('./{%(wix)s}Directory' % ns)
173 173 >
174 174 > for d in dirs:
175 175 > for subfile in directory(d, relpath + d.attrib['Name'] + '/'):
176 176 > yield subfile
177 177 >
178 178 > files = node.findall('./{%(wix)s}Component/{%(wix)s}File' % ns)
179 179 >
180 180 > for f in files:
181 181 > yield pycompat.sysbytes(relpath + f.attrib['Name'])
182 182 >
183 183 > def hgdirectory(relpath):
184 184 > '''generator of tracked files, rooted at relpath'''
185 185 > hgdir = "%s/../mercurial" % (testdir)
186 186 > args = ['hg', '--cwd', hgdir, 'files', relpath]
187 187 > proc = subprocess.Popen(args, stdout=subprocess.PIPE,
188 188 > stderr=subprocess.PIPE)
189 189 > output = proc.communicate()[0]
190 190 >
191 191 > for line in output.splitlines():
192 192 > if os.name == 'nt':
193 193 > yield line.replace(pycompat.sysbytes(os.sep), b'/')
194 194 > else:
195 195 > yield line
196 196 >
197 197 > tracked = [f for f in hgdirectory(sys.argv[1])]
198 198 >
199 199 > xml = ET.parse("%s/../contrib/wix/%s.wxs" % (testdir, sys.argv[1]))
200 200 > root = xml.getroot()
201 201 > dir = root.find('.//{%(wix)s}DirectoryRef' % ns)
202 202 >
203 203 > installed = [f for f in directory(dir, '')]
204 204 >
205 205 > print('Not installed:')
206 206 > for f in sorted(set(tracked) - set(installed)):
207 207 > print(' %s' % pycompat.sysstr(f))
208 208 >
209 209 > print('Not tracked:')
210 210 > for f in sorted(set(installed) - set(tracked)):
211 211 > print(' %s' % pycompat.sysstr(f))
212 212 > EOF
213 213
214 214 $ ( testrepohgenv; "$PYTHON" wixxml.py help )
215 215 Not installed:
216 216 help/common.txt
217 217 help/hg-ssh.8.txt
218 218 help/hg.1.txt
219 219 help/hgignore.5.txt
220 220 help/hgrc.5.txt
221 221 Not tracked:
222 222
223 223 $ ( testrepohgenv; "$PYTHON" wixxml.py templates )
224 224 Not installed:
225 225 Not tracked:
226 226
227 227 #endif
228 228
229 229 #if virtualenv
230 230
231 231 Verify that Mercurial is installable with pip. Note that this MUST be
232 232 the last test in this file, because we do some nasty things to the
233 233 shell environment in order to make the virtualenv work reliably.
234 234
235 235 $ cd $TESTTMP
236 236 Note: --no-site-packages is deprecated, but some places have an
237 237 ancient virtualenv from their linux distro or similar and it's not yet
238 238 the default for them.
239 239 $ unset PYTHONPATH
240 240 $ "$PYTHON" -m virtualenv --no-site-packages --never-download installenv >> pip.log
241 DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. (?)
241 242 Note: we use this weird path to run pip and hg to avoid platform differences,
242 243 since it's bin on most platforms but Scripts on Windows.
243 244 $ ./installenv/*/pip install --no-index $TESTDIR/.. >> pip.log
244 245 $ ./installenv/*/hg debuginstall || cat pip.log
245 246 checking encoding (ascii)...
246 247 checking Python executable (*) (glob)
247 248 checking Python version (2.*) (glob) (no-py3 !)
248 249 checking Python version (3.*) (glob) (py3 !)
249 250 checking Python lib (*)... (glob)
250 251 checking Python security support (*) (glob)
251 252 TLS 1.2 not supported by Python install; network connections lack modern security (?)
252 253 SNI not supported by Python install; may have connectivity issues with some servers (?)
253 254 checking Mercurial version (*) (glob)
254 255 checking Mercurial custom build (*) (glob)
255 256 checking module policy (*) (glob)
256 257 checking installed modules (*/mercurial)... (glob)
257 258 checking registered compression engines (*) (glob)
258 259 checking available compression engines (*) (glob)
259 260 checking available compression engines for wire protocol (*) (glob)
260 261 checking "re2" regexp engine \((available|missing)\) (re)
261 262 checking templates ($TESTTMP/installenv/*/site-packages/mercurial/templates)... (glob)
262 263 checking default template ($TESTTMP/installenv/*/site-packages/mercurial/templates/map-cmdline.default) (glob)
263 264 checking commit editor... (*) (glob)
264 265 checking username (test)
265 266 no problems detected
266 267 #endif
General Comments 0
You need to be logged in to leave comments. Login now