##// END OF EJS Templates
tests: automatically glob the discovery timing information...
marmoute -
r51290:59fda851 default
parent child Browse files
Show More
@@ -1,211 +1,216
1 1 # common patterns in test at can safely be replaced
2 2
3 3 import os
4 4
5 5 substitutions = [
6 6 # list of possible compressions
7 7 (br'(zstd,)?zlib,none,bzip2', br'$USUAL_COMPRESSIONS$'),
8 8 (br'=(zstd,)?zlib', br'=$BUNDLE2_COMPRESSIONS$'),
9 9 # capabilities sent through http
10 10 (
11 11 br'bundlecaps=HG20%2Cbundle2%3DHG20%250A'
12 12 br'bookmarks%250A'
13 13 br'changegroup%253D01%252C02%252C03%250A'
14 14 br'checkheads%253Drelated%250A'
15 15 br'digests%253Dmd5%252Csha1%252Csha512%250A'
16 16 br'error%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250A'
17 17 br'hgtagsfnodes%250A'
18 18 br'listkeys%250A'
19 19 br'phases%253Dheads%250A'
20 20 br'pushkey%250A'
21 21 br'remote-changegroup%253Dhttp%252Chttps%250A'
22 22 br'stream%253Dv2',
23 23 # (the replacement patterns)
24 24 br'$USUAL_BUNDLE_CAPS$',
25 25 ),
26 26 (
27 27 br'bundlecaps=HG20%2Cbundle2%3DHG20%250A'
28 28 br'bookmarks%250A'
29 29 br'changegroup%253D01%252C02%252C03%250A'
30 30 br'checkheads%3Drelated%0A'
31 31 br'digests%253Dmd5%252Csha1%252Csha512%250A'
32 32 br'error%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250A'
33 33 br'hgtagsfnodes%250A'
34 34 br'listkeys%250A'
35 35 br'phases%253Dheads%250A'
36 36 br'pushkey%250A'
37 37 br'remote-changegroup%253Dhttp%252Chttps',
38 38 # (the replacement patterns)
39 39 br'$USUAL_BUNDLE_CAPS_SERVER$',
40 40 ),
41 41 # bundle2 capabilities sent through ssh
42 42 (
43 43 br'bundle2=HG20%0A'
44 44 br'bookmarks%0A'
45 45 br'changegroup%3D01%2C02%2C03%0A'
46 46 br'checkheads%3Drelated%0A'
47 47 br'digests%3Dmd5%2Csha1%2Csha512%0A'
48 48 br'error%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0A'
49 49 br'hgtagsfnodes%0A'
50 50 br'listkeys%0A'
51 51 br'phases%3Dheads%0A'
52 52 br'pushkey%0A'
53 53 br'remote-changegroup%3Dhttp%2Chttps%0A'
54 54 br'stream%3Dv2',
55 55 # (replacement patterns)
56 56 br'$USUAL_BUNDLE2_CAPS$',
57 57 ),
58 58 # bundle2 capabilities advertised by the server
59 59 (
60 60 br'bundle2=HG20%0A'
61 61 br'bookmarks%0A'
62 62 br'changegroup%3D01%2C02%2C03%0A'
63 63 br'checkheads%3Drelated%0A'
64 64 br'digests%3Dmd5%2Csha1%2Csha512%0A'
65 65 br'error%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0A'
66 66 br'hgtagsfnodes%0A'
67 67 br'listkeys%0A'
68 68 br'phases%3Dheads%0A'
69 69 br'pushkey%0A'
70 70 br'remote-changegroup%3Dhttp%2Chttps',
71 71 # (replacement patterns)
72 72 br'$USUAL_BUNDLE2_CAPS_SERVER$',
73 73 ),
74 74 (
75 75 br'bundle2=HG20%0A'
76 76 br'bookmarks%0A'
77 77 br'changegroup%3D01%2C02%2C03%0A'
78 78 br'digests%3Dmd5%2Csha1%2Csha512%0A'
79 79 br'error%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0A'
80 80 br'hgtagsfnodes%0A'
81 81 br'listkeys%0A'
82 82 br'pushkey%0A'
83 83 br'remote-changegroup%3Dhttp%2Chttps%0A'
84 84 br'stream%3Dv2',
85 85 # (replacement patterns)
86 86 br'$USUAL_BUNDLE2_CAPS_NO_PHASES$',
87 87 ),
88 88 # HTTP access log dates
89 89 (
90 90 br' - - \[\d\d/.../2\d\d\d \d\d:\d\d:\d\d] "(GET|PUT|POST)',
91 91 lambda m: br' - - [$LOGDATE$] "' + m.group(1),
92 92 ),
93 93 # HTTP error log dates
94 94 (
95 95 br' - - \[\d\d/.../2\d\d\d \d\d:\d\d:\d\d] (HG error:|Exception)',
96 96 lambda m: br' - - [$ERRDATE$] ' + m.group(1),
97 97 ),
98 98 # HTTP header dates- RFC 1123
99 99 (
100 100 br'([Dd]ate): [A-Za-z]{3}, \d\d [A-Za-z]{3} \d{4} \d\d:\d\d:\d\d GMT',
101 101 lambda m: br'%s: $HTTP_DATE$' % m.group(1),
102 102 ),
103 103 # LFS expiration value
104 104 (
105 105 br'"expires_at": "\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ"',
106 106 br'"expires_at": "$ISO_8601_DATE_TIME$"',
107 107 ),
108 108 # Windows has an extra '/' in the following lines that get globbed away:
109 109 # pushing to file:/*/$TESTTMP/r2 (glob)
110 110 # comparing with file:/*/$TESTTMP/r2 (glob)
111 111 # sub/maybelarge.dat: largefile 34..9c not available from
112 112 # file:/*/$TESTTMP/largefiles-repo (glob)
113 113 (
114 114 br'(.*file:/)/?(/\$TESTTMP.*)',
115 115 lambda m: m.group(1) + b'*' + m.group(2) + b' (glob)',
116 116 ),
117 117 # `hg clone --stream` output
118 118 (
119 119 br'transferred (\S+?) KB in \S+? seconds \(.+?/sec\)(?: \(glob\))?(.*)',
120 120 lambda m: (
121 121 br'transferred %s KB in * seconds (* */sec) (glob)%s'
122 122 % (m.group(1), m.group(2))
123 123 ),
124 124 ),
125 # `discovery debug output
126 (
127 br'\b(\d+) total queries in \d.\d\d\d\ds\b',
128 lambda m: (br'%s total queries in *.????s (glob)' % m.group(1)),
129 ),
125 130 ]
126 131
127 132 # Various platform error strings, keyed on a common replacement string
128 133 _errors = {
129 134 br'$ENOENT$': (
130 135 # IOError in Python does not have the same error message
131 136 # than in Rust, and automatic conversion is not possible
132 137 # because of module member privacy.
133 138 br'No such file or directory \(os error 2\)',
134 139 # strerror()
135 140 br'No such file or directory',
136 141 # FormatMessage(ERROR_FILE_NOT_FOUND)
137 142 br'The system cannot find the file specified',
138 143 ),
139 144 br'$EACCES$': (
140 145 br'Permission denied \(os error 13\)',
141 146 # strerror
142 147 br'Permission denied',
143 148 ),
144 149 br'$ENOTDIR$': (
145 150 # strerror()
146 151 br'Not a directory',
147 152 # FormatMessage(ERROR_PATH_NOT_FOUND)
148 153 br'The system cannot find the path specified',
149 154 ),
150 155 br'$ECONNRESET$': (
151 156 # strerror()
152 157 br'Connection reset by peer',
153 158 # FormatMessage(WSAECONNRESET)
154 159 br'An existing connection was forcibly closed by the remote host',
155 160 ),
156 161 br'$EADDRINUSE$': (
157 162 # strerror()
158 163 br'Address already in use',
159 164 # FormatMessage(WSAEADDRINUSE)
160 165 br'Only one usage of each socket address'
161 166 br' \(protocol/network address/port\) is normally permitted',
162 167 ),
163 168 br'$EADDRNOTAVAIL$': (
164 169 # strerror()
165 170 br'Cannot assign requested address',
166 171 br'Can\'t assign requested address',
167 172 # FormatMessage(WSAEADDRNOTAVAIL)
168 173 ),
169 174 }
170 175
171 176 for replace, msgs in _errors.items():
172 177 substitutions.extend((m, replace) for m in msgs)
173 178
174 179 # Output lines on Windows that can be autocorrected for '\' vs '/' path
175 180 # differences.
176 181 _winpathfixes = [
177 182 # cloning subrepo s\ss from $TESTTMP/t/s/ss
178 183 # cloning subrepo foo\bar from http://localhost:$HGPORT/foo/bar
179 184 br'(?m)^cloning subrepo \S+\\.*',
180 185 # pulling from $TESTTMP\issue1852a
181 186 br'(?m)^pulling from \$TESTTMP\\.*',
182 187 # pushing to $TESTTMP\a
183 188 br'(?m)^pushing to \$TESTTMP\\.*',
184 189 # pushing subrepo s\ss to $TESTTMP/t/s/ss
185 190 br'(?m)^pushing subrepo \S+\\\S+ to.*',
186 191 # moving d1\d11\a1 to d3/d11/a1
187 192 br'(?m)^moving \S+\\.*',
188 193 # d1\a: not recording move - dummy does not exist
189 194 br'\S+\\\S+: not recording move .+',
190 195 # reverting s\a
191 196 br'(?m)^reverting (?!subrepo ).*\\.*',
192 197 # saved backup bundle to
193 198 # $TESTTMP\test\.hg\strip-backup/443431ffac4f-2fc5398a-backup.hg
194 199 br'(?m)^saved backup bundle to \$TESTTMP.*\.hg',
195 200 # no changes made to subrepo s\ss since last push to ../tcc/s/ss
196 201 br'(?m)^no changes made to subrepo \S+\\\S+ since.*',
197 202 # changeset 5:9cc5aa7204f0: stuff/maybelarge.dat references missing
198 203 # $TESTTMP\largefiles-repo-hg\.hg\largefiles\76..38
199 204 br'(?m)^changeset .* references (corrupted|missing) \$TESTTMP\\.*',
200 205 # stuff/maybelarge.dat: largefile 76..38 not available from
201 206 # file:/*/$TESTTMP\largefiles-repo (glob)
202 207 br'.*: largefile \S+ not available from file:/\*/.+',
203 208 ]
204 209
205 210 if os.name == 'nt':
206 211 substitutions.extend(
207 212 [
208 213 (s, lambda match: match.group().replace(b'\\', b'/'))
209 214 for s in _winpathfixes
210 215 ]
211 216 )
General Comments 0
You need to be logged in to leave comments. Login now