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