##// END OF EJS Templates
tests: conditionalize path output for in-memory pyoxidizer resources
Matt Harbison -
r50730:4836705a stable
parent child Browse files
Show More
@@ -1,107 +1,115
1 1 #if no-extraextensions
2 2 $ hg debugextensions
3 3 #endif
4 4
5 5 $ debugpath=`pwd`/extwithoutinfos.py
6 6
7 7 $ cat > extwithoutinfos.py <<EOF
8 8 > EOF
9 9 $ cat > extwithinfos.py <<EOF
10 10 > testedwith = b'3.0 3.1 3.2.1'
11 11 > buglink = b'https://example.org/bts'
12 12 > EOF
13 13
14 14 $ cat >> $HGRCPATH <<EOF
15 15 > [extensions]
16 16 > histedit=
17 17 > patchbomb=
18 18 > rebase=
19 19 > mq=
20 20 > ext1 = $debugpath
21 21 > ext2 = `pwd`/extwithinfos.py
22 22 > EOF
23 23
24 24 $ for extension in $HGTESTEXTRAEXTENSIONS; do
25 25 > echo "$extension=!" >> $HGRCPATH
26 26 > done
27 27
28 28 $ hg debugextensions
29 29 ext1 (untested!)
30 30 ext2 (3.2.1!)
31 31 histedit
32 32 mq
33 33 patchbomb
34 34 rebase
35 35
36 36 $ hg debugextensions -v
37 37 ext1
38 38 location: */extwithoutinfos.py* (glob)
39 39 bundled: no
40 40 ext2
41 41 location: */extwithinfos.py* (glob)
42 42 bundled: no
43 43 tested with: 3.0 3.1 3.2.1
44 44 bug reporting: https://example.org/bts
45 45 histedit
46 location: */hgext/histedit.py* (glob)
46 location: */hgext/histedit.py* (glob) (no-pyoxidizer-in-memory !)
47 location: */release/app/hg* (glob) (pyoxidizer-in-memory !)
47 48 bundled: yes
48 49 mq
49 location: */hgext/mq.py* (glob)
50 location: */hgext/mq.py* (glob) (no-pyoxidizer-in-memory !)
51 location: */release/app/hg* (glob) (pyoxidizer-in-memory !)
50 52 bundled: yes
51 53 patchbomb
52 location: */hgext/patchbomb.py* (glob)
54 location: */hgext/patchbomb.py* (glob) (no-pyoxidizer-in-memory !)
55 location: */release/app/hg* (glob) (pyoxidizer-in-memory !)
53 56 bundled: yes
54 57 rebase
55 location: */hgext/rebase.py* (glob)
58 location: */hgext/rebase.py* (glob) (no-pyoxidizer-in-memory !)
59 location: */release/app/hg* (glob) (pyoxidizer-in-memory !)
56 60 bundled: yes
57 61
58 62 $ hg debugextensions -Tjson | sed 's|\\\\|/|g'
59 63 [
60 64 {
61 65 "buglink": "",
62 66 "bundled": false,
63 67 "name": "ext1",
64 68 "source": "*/extwithoutinfos.py*", (glob)
65 69 "testedwith": []
66 70 },
67 71 {
68 72 "buglink": "https://example.org/bts",
69 73 "bundled": false,
70 74 "name": "ext2",
71 75 "source": "*/extwithinfos.py*", (glob)
72 76 "testedwith": ["3.0", "3.1", "3.2.1"]
73 77 },
74 78 {
75 79 "buglink": "",
76 80 "bundled": true,
77 81 "name": "histedit",
78 "source": "*/hgext/histedit.py*", (glob)
82 "source": "*/hgext/histedit.py*", (glob) (no-pyoxidizer-in-memory !)
83 "source": */release/app/hg* (glob) (pyoxidizer-in-memory !)
79 84 "testedwith": []
80 85 },
81 86 {
82 87 "buglink": "",
83 88 "bundled": true,
84 89 "name": "mq",
85 "source": "*/hgext/mq.py*", (glob)
90 "source": "*/hgext/mq.py*", (glob) (no-pyoxidizer-in-memory !)
91 "source": */release/app/hg* (glob) (pyoxidizer-in-memory !)
86 92 "testedwith": []
87 93 },
88 94 {
89 95 "buglink": "",
90 96 "bundled": true,
91 97 "name": "patchbomb",
92 "source": "*/hgext/patchbomb.py*", (glob)
98 "source": "*/hgext/patchbomb.py*", (glob) (no-pyoxidizer-in-memory !)
99 "source": */release/app/hg* (glob) (pyoxidizer-in-memory !)
93 100 "testedwith": []
94 101 },
95 102 {
96 103 "buglink": "",
97 104 "bundled": true,
98 105 "name": "rebase",
99 "source": "*/hgext/rebase.py*", (glob)
106 "source": "*/hgext/rebase.py*", (glob) (no-pyoxidizer-in-memory !)
107 "source": */release/app/hg* (glob) (pyoxidizer-in-memory !)
100 108 "testedwith": []
101 109 }
102 110 ]
103 111
104 112 $ hg debugextensions -T '{ifcontains("3.1", testedwith, "{name}\n")}'
105 113 ext2
106 114 $ hg debugextensions \
107 115 > -T '{ifcontains("3.2", testedwith, "no substring match: {name}\n")}'
@@ -1,274 +1,279
1 1 hg debuginstall
2 2 $ hg debuginstall
3 3 checking encoding (ascii)...
4 4 checking Python executable (*) (glob)
5 5 checking Python implementation (*) (glob)
6 6 checking Python version (3.*) (glob) (py3 !)
7 7 checking Python lib (.*[Ll]ib.*)... (re) (no-pyoxidizer !)
8 8 checking Python lib (.*pyoxidizer.*)... (re) (pyoxidizer !)
9 9 checking Python security support (*) (glob)
10 10 TLS 1.2 not supported by Python install; network connections lack modern security (?)
11 11 SNI not supported by Python install; may have connectivity issues with some servers (?)
12 12 checking Rust extensions \((installed|missing)\) (re)
13 13 checking Mercurial version (*) (glob)
14 14 checking Mercurial custom build (*) (glob)
15 15 checking module policy (*) (glob)
16 checking installed modules (*mercurial)... (glob)
16 checking installed modules (*mercurial)... (glob) (no-pyoxidizer-in-memory !)
17 checking installed modules (*/release/app/hg*)... (glob) (pyoxidizer-in-memory !)
17 18 checking registered compression engines (*zlib*) (glob)
18 19 checking available compression engines (*zlib*) (glob)
19 20 checking available compression engines for wire protocol (*zlib*) (glob)
20 21 checking "re2" regexp engine \((available|missing)\) (re)
21 22 checking templates (*mercurial?templates)... (glob) (no-pyoxidizer !)
22 23 checking templates (*app?templates)... (glob) (pyoxidizer !)
23 24 checking default template (*mercurial?templates?map-cmdline.default) (glob) (no-pyoxidizer !)
24 25 checking default template (*app?templates?map-cmdline.default) (glob) (pyoxidizer !)
25 26 checking commit editor... (*) (glob)
26 27 checking username (test)
27 28 no problems detected
28 29
29 30 hg debuginstall JSON
30 31 $ hg debuginstall -Tjson | sed 's|\\\\|\\|g'
31 32 [
32 33 {
33 34 "compengines": ["bz2", "bz2truncated", "none", "zlib"*], (glob)
34 35 "compenginesavail": ["bz2", "bz2truncated", "none", "zlib"*], (glob)
35 36 "compenginesserver": [*"zlib"*], (glob)
36 37 "defaulttemplate": "*mercurial?templates?map-cmdline.default", (glob) (no-pyoxidizer !)
37 38 "defaulttemplate": "*app?templates?map-cmdline.default", (glob) (pyoxidizer !)
38 39 "defaulttemplateerror": null,
39 40 "defaulttemplatenotfound": "default",
40 41 "editor": "*", (glob)
41 42 "editornotfound": false,
42 43 "encoding": "ascii",
43 44 "encodingerror": null,
44 45 "extensionserror": null, (no-pure !)
45 46 "hgmodulepolicy": "*", (glob)
46 "hgmodules": "*mercurial", (glob)
47 "hgmodules": "*mercurial", (glob) (no-pyoxidizer-in-memory !)
48 "hgmodules": "*/release/app/hg*", (glob) (pyoxidizer-in-memory !)
47 49 "hgver": "*", (glob)
48 50 "hgverextra": "*", (glob)
49 51 "problems": 0,
50 52 "pythonexe": "*", (glob)
51 53 "pythonimplementation": "*", (glob)
52 54 "pythonlib": "*", (glob)
53 55 "pythonsecurity": [*], (glob)
54 56 "pythonver": "*.*.*", (glob)
55 57 "re2": (true|false), (re)
56 58 "templatedirs": "*mercurial?templates", (glob) (no-pyoxidizer !)
57 59 "templatedirs": "*app?templates", (glob) (pyoxidizer !)
58 60 "username": "test",
59 61 "usernameerror": null,
60 62 "vinotfound": false
61 63 }
62 64 ]
63 65
64 66 hg debuginstall with no username
65 67 $ HGUSER= hg debuginstall
66 68 checking encoding (ascii)...
67 69 checking Python executable (*) (glob)
68 70 checking Python implementation (*) (glob)
69 71 checking Python version (3.*) (glob) (py3 !)
70 72 checking Python lib (.*[Ll]ib.*)... (re) (no-pyoxidizer !)
71 73 checking Python lib (.*pyoxidizer.*)... (re) (pyoxidizer !)
72 74 checking Python security support (*) (glob)
73 75 TLS 1.2 not supported by Python install; network connections lack modern security (?)
74 76 SNI not supported by Python install; may have connectivity issues with some servers (?)
75 77 checking Rust extensions \((installed|missing)\) (re)
76 78 checking Mercurial version (*) (glob)
77 79 checking Mercurial custom build (*) (glob)
78 80 checking module policy (*) (glob)
79 checking installed modules (*mercurial)... (glob)
81 checking installed modules (*mercurial)... (glob) (no-pyoxidizer-in-memory !)
82 checking installed modules (*/release/app/hg*)... (glob) (pyoxidizer-in-memory !)
80 83 checking registered compression engines (*zlib*) (glob)
81 84 checking available compression engines (*zlib*) (glob)
82 85 checking available compression engines for wire protocol (*zlib*) (glob)
83 86 checking "re2" regexp engine \((available|missing)\) (re)
84 87 checking templates (*mercurial?templates)... (glob) (no-pyoxidizer !)
85 88 checking templates (*app?templates)... (glob) (pyoxidizer !)
86 89 checking default template (*mercurial?templates?map-cmdline.default) (glob) (no-pyoxidizer !)
87 90 checking default template (*app?templates?map-cmdline.default) (glob) (pyoxidizer !)
88 91 checking commit editor... (*) (glob)
89 92 checking username...
90 93 no username supplied
91 94 (specify a username in your configuration file)
92 95 1 problems detected, please check your install!
93 96 [1]
94 97
95 98 hg debuginstall with invalid encoding
96 99 $ HGENCODING=invalidenc hg debuginstall | grep encoding
97 100 checking encoding (invalidenc)...
98 101 unknown encoding: invalidenc
99 102
100 103 exception message in JSON
101 104
102 105 $ HGENCODING=invalidenc HGUSER= hg debuginstall -Tjson | grep error
103 106 "defaulttemplateerror": null,
104 107 "encodingerror": "unknown encoding: invalidenc",
105 108 "extensionserror": null, (no-pure !)
106 109 "usernameerror": "no username supplied",
107 110
108 111 path variables are expanded (~ is the same as $TESTTMP)
109 112 $ mkdir tools
110 113 $ touch tools/testeditor.exe
111 114 #if execbit
112 115 $ chmod 755 tools/testeditor.exe
113 116 #endif
114 117 $ HGEDITOR="~/tools/testeditor.exe" hg debuginstall
115 118 checking encoding (ascii)...
116 119 checking Python executable (*) (glob)
117 120 checking Python implementation (*) (glob)
118 121 checking Python version (3.*) (glob) (py3 !)
119 122 checking Python lib (.*[Ll]ib.*)... (re) (no-pyoxidizer !)
120 123 checking Python lib (.*pyoxidizer.*)... (re) (pyoxidizer !)
121 124 checking Python security support (*) (glob)
122 125 TLS 1.2 not supported by Python install; network connections lack modern security (?)
123 126 SNI not supported by Python install; may have connectivity issues with some servers (?)
124 127 checking Rust extensions \((installed|missing)\) (re)
125 128 checking Mercurial version (*) (glob)
126 129 checking Mercurial custom build (*) (glob)
127 130 checking module policy (*) (glob)
128 checking installed modules (*mercurial)... (glob)
131 checking installed modules (*mercurial)... (glob) (no-pyoxidizer-in-memory !)
132 checking installed modules (*/release/app/hg*)... (glob) (pyoxidizer-in-memory !)
129 133 checking registered compression engines (*zlib*) (glob)
130 134 checking available compression engines (*zlib*) (glob)
131 135 checking available compression engines for wire protocol (*zlib*) (glob)
132 136 checking "re2" regexp engine \((available|missing)\) (re)
133 137 checking templates (*mercurial?templates)... (glob) (no-pyoxidizer !)
134 138 checking templates (*app?templates)... (glob) (pyoxidizer !)
135 139 checking default template (*mercurial?templates?map-cmdline.default) (glob) (no-pyoxidizer !)
136 140 checking default template (*app?templates?map-cmdline.default) (glob) (pyoxidizer !)
137 141 checking commit editor... ($TESTTMP/tools/testeditor.exe)
138 142 checking username (test)
139 143 no problems detected
140 144
141 145 print out the binary post-shlexsplit in the error message when commit editor is
142 146 not found (this is intentionally using backslashes to mimic a windows usecase).
143 147 $ HGEDITOR="c:\foo\bar\baz.exe -y -z" hg debuginstall
144 148 checking encoding (ascii)...
145 149 checking Python executable (*) (glob)
146 150 checking Python implementation (*) (glob)
147 151 checking Python version (3.*) (glob) (py3 !)
148 152 checking Python lib (.*[Ll]ib.*)... (re) (no-pyoxidizer !)
149 153 checking Python lib (.*pyoxidizer.*)... (re) (pyoxidizer !)
150 154 checking Python security support (*) (glob)
151 155 TLS 1.2 not supported by Python install; network connections lack modern security (?)
152 156 SNI not supported by Python install; may have connectivity issues with some servers (?)
153 157 checking Rust extensions \((installed|missing)\) (re)
154 158 checking Mercurial version (*) (glob)
155 159 checking Mercurial custom build (*) (glob)
156 160 checking module policy (*) (glob)
157 checking installed modules (*mercurial)... (glob)
161 checking installed modules (*mercurial)... (glob) (no-pyoxidizer-in-memory !)
162 checking installed modules (*/release/app/hg*)... (glob) (pyoxidizer-in-memory !)
158 163 checking registered compression engines (*zlib*) (glob)
159 164 checking available compression engines (*zlib*) (glob)
160 165 checking available compression engines for wire protocol (*zlib*) (glob)
161 166 checking "re2" regexp engine \((available|missing)\) (re)
162 167 checking templates (*mercurial?templates)... (glob) (no-pyoxidizer !)
163 168 checking templates (*app?templates)... (glob) (pyoxidizer !)
164 169 checking default template (*mercurial?templates?map-cmdline.default) (glob) (no-pyoxidizer !)
165 170 checking default template (*app?templates?map-cmdline.default) (glob) (pyoxidizer !)
166 171 checking commit editor... (c:\foo\bar\baz.exe) (windows !)
167 172 Can't find editor 'c:\foo\bar\baz.exe' in PATH (windows !)
168 173 checking commit editor... (c:foobarbaz.exe) (no-windows !)
169 174 Can't find editor 'c:foobarbaz.exe' in PATH (no-windows !)
170 175 (specify a commit editor in your configuration file)
171 176 checking username (test)
172 177 1 problems detected, please check your install!
173 178 [1]
174 179
175 180 debuginstall extension support
176 181 $ hg debuginstall --config extensions.fsmonitor= --config fsmonitor.watchman_exe=false | grep atchman
177 182 fsmonitor checking for watchman binary... (false)
178 183 watchman binary missing or broken: warning: Watchman unavailable: watchman exited with code 1
179 184 Verify the json works too:
180 185 $ hg debuginstall --config extensions.fsmonitor= --config fsmonitor.watchman_exe=false -Tjson | grep atchman
181 186 "fsmonitor-watchman": "false",
182 187 "fsmonitor-watchman-error": "warning: Watchman unavailable: watchman exited with code 1",
183 188
184 189 Verify that Mercurial is installable with pip. Note that this MUST be
185 190 the last test in this file, because we do some nasty things to the
186 191 shell environment in order to make the virtualenv work reliably.
187 192
188 193 On Python 3, we use the venv module, which is part of the standard library.
189 194 But some Linux distros strip out this module's functionality involving pip,
190 195 so we have to look for the ensurepip module, which these distros strip out
191 196 completely.
192 197 On Python 2, we use the 3rd party virtualenv module, if available.
193 198
194 199 $ cd $TESTTMP
195 200 $ unset PYTHONPATH
196 201
197 202 #if py3 ensurepip network-io no-pyoxidizer
198 203 $ "$PYTHON" -m venv installenv >> pip.log
199 204
200 205 Hack: Debian does something a bit different in ensurepip.bootstrap. This makes
201 206 it so that pip thinks the 'wheel' wheel is installed so it can build wheels;
202 207 when it goes to try, however, it shells out to run `python3 -u <setup.py>`,
203 208 that *doesn't* get the 'wheel' wheel, and it fails with an invalid command
204 209 'bdist_wheel'. To fix this, we just delete the wheel from where Debian put it in
205 210 our virtual env. Then pip doesn't think it's installed and doesn't try to build.
206 211 $ rm installenv/share/python-wheels/wheel-*.whl >/dev/null 2>&1 || true
207 212
208 213 Note: we use this weird path to run pip and hg to avoid platform differences,
209 214 since it's bin on most platforms but Scripts on Windows.
210 215 $ ./installenv/*/pip install $TESTDIR/.. >> pip.log
211 216 Failed building wheel for mercurial (?)
212 217 WARNING: You are using pip version *; however, version * is available. (glob) (?)
213 218 You should consider upgrading via the '$TESTTMP/installenv/bin/python* -m pip install --upgrade pip' command. (glob) (?)
214 219 $ ./installenv/*/hg debuginstall || cat pip.log
215 220 checking encoding (ascii)...
216 221 checking Python executable (*) (glob)
217 222 checking Python implementation (*) (glob)
218 223 checking Python version (3.*) (glob)
219 224 checking Python lib (*)... (glob)
220 225 checking Python security support (*) (glob)
221 226 checking Rust extensions \((installed|missing)\) (re)
222 227 checking Mercurial version (*) (glob)
223 228 checking Mercurial custom build (*) (glob)
224 229 checking module policy (*) (glob)
225 230 checking installed modules (*/mercurial)... (glob)
226 231 checking registered compression engines (*) (glob)
227 232 checking available compression engines (*) (glob)
228 233 checking available compression engines for wire protocol (*) (glob)
229 234 checking "re2" regexp engine \((available|missing)\) (re)
230 235 checking templates ($TESTTMP/installenv/*/site-packages/mercurial/templates)... (glob)
231 236 checking default template ($TESTTMP/installenv/*/site-packages/mercurial/templates/map-cmdline.default) (glob)
232 237 checking commit editor... (*) (glob)
233 238 checking username (test)
234 239 no problems detected
235 240 #endif
236 241
237 242 #if virtualenv no-py3 network-io no-pyoxidizer
238 243
239 244 Note: --no-site-packages is the default for all versions enabled by hghave
240 245
241 246 $ "$PYTHON" -m virtualenv installenv >> pip.log
242 247 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. (?)
243 248 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. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support (?)
244 249
245 250 Note: we use this weird path to run pip and hg to avoid platform differences,
246 251 since it's bin on most platforms but Scripts on Windows.
247 252 $ ./installenv/*/pip install $TESTDIR/.. >> pip.log
248 253 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. (?)
249 254 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. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support (?)
250 255 DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. (?)
251 256 $ ./installenv/*/hg debuginstall || cat pip.log
252 257 checking encoding (ascii)...
253 258 checking Python executable (*) (glob)
254 259 checking Python implementation (*) (glob)
255 260 checking Python version (2.*) (glob)
256 261 checking Python lib (*)... (glob)
257 262 checking Python security support (*) (glob)
258 263 TLS 1.2 not supported by Python install; network connections lack modern security (?)
259 264 SNI not supported by Python install; may have connectivity issues with some servers (?)
260 265 checking Rust extensions \((installed|missing)\) (re)
261 266 checking Mercurial version (*) (glob)
262 267 checking Mercurial custom build (*) (glob)
263 268 checking module policy (*) (glob)
264 269 checking installed modules (*/mercurial)... (glob)
265 270 checking registered compression engines (*) (glob)
266 271 checking available compression engines (*) (glob)
267 272 checking available compression engines for wire protocol (*) (glob)
268 273 checking "re2" regexp engine \((available|missing)\) (re)
269 274 checking templates ($TESTTMP/installenv/*/site-packages/mercurial/templates)... (glob)
270 275 checking default template ($TESTTMP/installenv/*/site-packages/mercurial/templates/map-cmdline.default) (glob)
271 276 checking commit editor... (*) (glob)
272 277 checking username (test)
273 278 no problems detected
274 279 #endif
General Comments 0
You need to be logged in to leave comments. Login now