comparison tests/phabricator/phabsend-create-alpha.json @ 39651:a641fd1a1196

tests: add some basic tests of phabricator interactions This uses the vcr library to avoid hitting phabricator on every test execution. In order to generate new recordings (vcr calls them cassettes) just remove the appropriate json file, and the test will regenerate it. It's not my favorite way to test things, but it'll let us have test coverage on the phabricator extension that'll make it resilient to refactors in core and let us move it to hgext. In the future, it'd probably be better to have a docker container we can spin up for creating the vcr recordings, but for now this is enough better than nothing I'm going to declare victory. Coverage reports about 73% of the extension is now covered. Differential Revision: https://phab.mercurial-scm.org/D4601
author Augie Fackler <raf@durin42.com>
date Sat, 15 Sep 2018 00:50:21 -0400
parents
children c340a8ac7ef3
comparison
equal deleted inserted replaced
39650:d8f07b16abfc 39651:a641fd1a1196
1 {
2 "version": 1,
3 "interactions": [
4 {
5 "response": {
6 "status": {
7 "message": "OK",
8 "code": 200
9 },
10 "body": {
11 "string": "{\"result\":{\"data\":[{\"id\":2,\"type\":\"REPO\",\"phid\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"fields\":{\"name\":\"Mercurial\",\"vcs\":\"hg\",\"callsign\":\"HG\",\"shortName\":null,\"status\":\"active\",\"isImporting\":false,\"spacePHID\":null,\"dateCreated\":1498761653,\"dateModified\":1500403184,\"policy\":{\"view\":\"public\",\"edit\":\"admin\",\"diffusion.push\":\"users\"}},\"attachments\":{}}],\"maps\":{},\"query\":{\"queryKey\":null},\"cursor\":{\"limit\":100,\"after\":null,\"before\":null,\"order\":null}},\"error_code\":null,\"error_info\":null}"
12 },
13 "headers": {
14 "x-xss-protection": [
15 "1; mode=block"
16 ],
17 "expires": [
18 "Sat, 01 Jan 2000 00:00:00 GMT"
19 ],
20 "set-cookie": [
21 "phsid=A%2F4wycgjx3wajuukr7ggfpqedpe7czucr7mvmaems3; expires=Thu, 14-Sep-2023 04:47:40 GMT; Max-Age=157680000; path=/; domain=phab.mercurial-scm.org; secure; httponly"
22 ],
23 "x-frame-options": [
24 "Deny"
25 ],
26 "x-content-type-options": [
27 "nosniff"
28 ],
29 "strict-transport-security": [
30 "max-age=0; includeSubdomains; preload"
31 ],
32 "server": [
33 "Apache/2.4.10 (Debian)"
34 ],
35 "date": [
36 "Sat, 15 Sep 2018 04:47:40 GMT"
37 ],
38 "content-type": [
39 "application/json"
40 ],
41 "cache-control": [
42 "no-store"
43 ]
44 }
45 },
46 "request": {
47 "method": "POST",
48 "uri": "https://phab.mercurial-scm.org//api/diffusion.repository.search",
49 "body": "constraints%5Bcallsigns%5D%5B0%5D=HG&api.token=cli-hahayouwish",
50 "headers": {
51 "accept": [
52 "application/mercurial-0.1"
53 ],
54 "content-type": [
55 "application/x-www-form-urlencoded"
56 ],
57 "host": [
58 "phab.mercurial-scm.org"
59 ],
60 "content-length": [
61 "79"
62 ],
63 "user-agent": [
64 "mercurial/proto-1.0 (Mercurial 4.7.1+866-5f07496726a1+20180915)"
65 ]
66 }
67 }
68 },
69 {
70 "response": {
71 "status": {
72 "message": "OK",
73 "code": 200
74 },
75 "body": {
76 "string": "{\"result\":{\"id\":11072,\"phid\":\"PHID-DIFF-xm6cw76uivc6g56xiuv2\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/differential\\/diff\\/11072\\/\"},\"error_code\":null,\"error_info\":null}"
77 },
78 "headers": {
79 "x-xss-protection": [
80 "1; mode=block"
81 ],
82 "expires": [
83 "Sat, 01 Jan 2000 00:00:00 GMT"
84 ],
85 "set-cookie": [
86 "phsid=A%2Fll65pt562b6d7ifhjva4jwqqzxh2oopj4tuc6lfa; expires=Thu, 14-Sep-2023 04:47:40 GMT; Max-Age=157680000; path=/; domain=phab.mercurial-scm.org; secure; httponly"
87 ],
88 "x-frame-options": [
89 "Deny"
90 ],
91 "x-content-type-options": [
92 "nosniff"
93 ],
94 "strict-transport-security": [
95 "max-age=0; includeSubdomains; preload"
96 ],
97 "server": [
98 "Apache/2.4.10 (Debian)"
99 ],
100 "date": [
101 "Sat, 15 Sep 2018 04:47:40 GMT"
102 ],
103 "content-type": [
104 "application/json"
105 ],
106 "cache-control": [
107 "no-store"
108 ]
109 }
110 },
111 "request": {
112 "method": "POST",
113 "uri": "https://phab.mercurial-scm.org//api/differential.createrawdiff",
114 "body": "repositoryPHID=PHID-REPO-bvunnehri4u2isyr7bc3&diff=diff+--git+a%2Falpha+b%2Falpha%0Anew+file+mode+100644%0A---+%2Fdev%2Fnull%0A%2B%2B%2B+b%2Falpha%0A%40%40+-0%2C0+%2B1%2C1+%40%40%0A%2Balpha%0A&api.token=cli-hahayouwish",
115 "headers": {
116 "accept": [
117 "application/mercurial-0.1"
118 ],
119 "content-type": [
120 "application/x-www-form-urlencoded"
121 ],
122 "host": [
123 "phab.mercurial-scm.org"
124 ],
125 "content-length": [
126 "235"
127 ],
128 "user-agent": [
129 "mercurial/proto-1.0 (Mercurial 4.7.1+866-5f07496726a1+20180915)"
130 ]
131 }
132 }
133 },
134 {
135 "response": {
136 "status": {
137 "message": "OK",
138 "code": 200
139 },
140 "body": {
141 "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}"
142 },
143 "headers": {
144 "x-xss-protection": [
145 "1; mode=block"
146 ],
147 "expires": [
148 "Sat, 01 Jan 2000 00:00:00 GMT"
149 ],
150 "set-cookie": [
151 "phsid=A%2F5ivszbehkvbetlnks7omsqmbsu7r5by3p3yqw3ep; expires=Thu, 14-Sep-2023 04:47:41 GMT; Max-Age=157680000; path=/; domain=phab.mercurial-scm.org; secure; httponly"
152 ],
153 "x-frame-options": [
154 "Deny"
155 ],
156 "x-content-type-options": [
157 "nosniff"
158 ],
159 "strict-transport-security": [
160 "max-age=0; includeSubdomains; preload"
161 ],
162 "server": [
163 "Apache/2.4.10 (Debian)"
164 ],
165 "date": [
166 "Sat, 15 Sep 2018 04:47:41 GMT"
167 ],
168 "content-type": [
169 "application/json"
170 ],
171 "cache-control": [
172 "no-store"
173 ]
174 }
175 },
176 "request": {
177 "method": "POST",
178 "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty",
179 "body": "data=%7B%22date%22%3A+%220+0%22%2C+%22node%22%3A+%225206a4fa1e6cd7dbc027640267c109e05a9d2341%22%2C+%22user%22%3A+%22test%22%2C+%22parent%22%3A+%220000000000000000000000000000000000000000%22%7D&name=hg%3Ameta&diff_id=11072&api.token=cli-hahayouwish",
180 "headers": {
181 "accept": [
182 "application/mercurial-0.1"
183 ],
184 "content-type": [
185 "application/x-www-form-urlencoded"
186 ],
187 "host": [
188 "phab.mercurial-scm.org"
189 ],
190 "content-length": [
191 "264"
192 ],
193 "user-agent": [
194 "mercurial/proto-1.0 (Mercurial 4.7.1+866-5f07496726a1+20180915)"
195 ]
196 }
197 }
198 },
199 {
200 "response": {
201 "status": {
202 "message": "OK",
203 "code": 200
204 },
205 "body": {
206 "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}"
207 },
208 "headers": {
209 "x-xss-protection": [
210 "1; mode=block"
211 ],
212 "expires": [
213 "Sat, 01 Jan 2000 00:00:00 GMT"
214 ],
215 "set-cookie": [
216 "phsid=A%2Fxvwxxrmwpjntx6dlohrstyox7yjssdbzufiwygcg; expires=Thu, 14-Sep-2023 04:47:41 GMT; Max-Age=157680000; path=/; domain=phab.mercurial-scm.org; secure; httponly"
217 ],
218 "x-frame-options": [
219 "Deny"
220 ],
221 "x-content-type-options": [
222 "nosniff"
223 ],
224 "strict-transport-security": [
225 "max-age=0; includeSubdomains; preload"
226 ],
227 "server": [
228 "Apache/2.4.10 (Debian)"
229 ],
230 "date": [
231 "Sat, 15 Sep 2018 04:47:41 GMT"
232 ],
233 "content-type": [
234 "application/json"
235 ],
236 "cache-control": [
237 "no-store"
238 ]
239 }
240 },
241 "request": {
242 "method": "POST",
243 "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty",
244 "body": "data=%7B%225206a4fa1e6cd7dbc027640267c109e05a9d2341%22%3A+%7B%22time%22%3A+0.0%2C+%22author%22%3A+%22test%22%2C+%22authorEmail%22%3A+%22test%22%7D%7D&name=local%3Acommits&diff_id=11072&api.token=cli-hahayouwish",
245 "headers": {
246 "accept": [
247 "application/mercurial-0.1"
248 ],
249 "content-type": [
250 "application/x-www-form-urlencoded"
251 ],
252 "host": [
253 "phab.mercurial-scm.org"
254 ],
255 "content-length": [
256 "227"
257 ],
258 "user-agent": [
259 "mercurial/proto-1.0 (Mercurial 4.7.1+866-5f07496726a1+20180915)"
260 ]
261 }
262 }
263 },
264 {
265 "response": {
266 "status": {
267 "message": "OK",
268 "code": 200
269 },
270 "body": {
271 "string": "{\"result\":{\"errors\":[],\"fields\":{\"title\":\"create alpha for phabricator test\"},\"revisionIDFieldInfo\":{\"value\":null,\"validDomain\":\"https:\\/\\/phab.mercurial-scm.org\"}},\"error_code\":null,\"error_info\":null}"
272 },
273 "headers": {
274 "x-xss-protection": [
275 "1; mode=block"
276 ],
277 "expires": [
278 "Sat, 01 Jan 2000 00:00:00 GMT"
279 ],
280 "set-cookie": [
281 "phsid=A%2Fy3s5iysh6h2javfdo2u7myspyjypv4mvojegqr6j; expires=Thu, 14-Sep-2023 04:47:42 GMT; Max-Age=157680000; path=/; domain=phab.mercurial-scm.org; secure; httponly"
282 ],
283 "x-frame-options": [
284 "Deny"
285 ],
286 "x-content-type-options": [
287 "nosniff"
288 ],
289 "strict-transport-security": [
290 "max-age=0; includeSubdomains; preload"
291 ],
292 "server": [
293 "Apache/2.4.10 (Debian)"
294 ],
295 "date": [
296 "Sat, 15 Sep 2018 04:47:42 GMT"
297 ],
298 "content-type": [
299 "application/json"
300 ],
301 "cache-control": [
302 "no-store"
303 ]
304 }
305 },
306 "request": {
307 "method": "POST",
308 "uri": "https://phab.mercurial-scm.org//api/differential.parsecommitmessage",
309 "body": "corpus=create+alpha+for+phabricator+test&api.token=cli-hahayouwish",
310 "headers": {
311 "accept": [
312 "application/mercurial-0.1"
313 ],
314 "content-type": [
315 "application/x-www-form-urlencoded"
316 ],
317 "host": [
318 "phab.mercurial-scm.org"
319 ],
320 "content-length": [
321 "83"
322 ],
323 "user-agent": [
324 "mercurial/proto-1.0 (Mercurial 4.7.1+866-5f07496726a1+20180915)"
325 ]
326 }
327 }
328 },
329 {
330 "response": {
331 "status": {
332 "message": "OK",
333 "code": 200
334 },
335 "body": {
336 "string": "{\"result\":{\"object\":{\"id\":4596,\"phid\":\"PHID-DREV-bntcdwe74cw3vwkzt6nq\"},\"transactions\":[{\"phid\":\"PHID-XACT-DREV-mnqxquobbhdgttd\"},{\"phid\":\"PHID-XACT-DREV-nd34pqrjamxbhop\"},{\"phid\":\"PHID-XACT-DREV-4ka4rghn6b7xooc\"},{\"phid\":\"PHID-XACT-DREV-mfuvfyiijdqwpyg\"},{\"phid\":\"PHID-XACT-DREV-ckar54h6yenx24s\"}]},\"error_code\":null,\"error_info\":null}"
337 },
338 "headers": {
339 "x-xss-protection": [
340 "1; mode=block"
341 ],
342 "expires": [
343 "Sat, 01 Jan 2000 00:00:00 GMT"
344 ],
345 "set-cookie": [
346 "phsid=A%2Foe7kd7hhldo25tzbegntkyfxm6wnztgdfmsfubo2; expires=Thu, 14-Sep-2023 04:47:42 GMT; Max-Age=157680000; path=/; domain=phab.mercurial-scm.org; secure; httponly"
347 ],
348 "x-frame-options": [
349 "Deny"
350 ],
351 "x-content-type-options": [
352 "nosniff"
353 ],
354 "strict-transport-security": [
355 "max-age=0; includeSubdomains; preload"
356 ],
357 "server": [
358 "Apache/2.4.10 (Debian)"
359 ],
360 "date": [
361 "Sat, 15 Sep 2018 04:47:42 GMT"
362 ],
363 "content-type": [
364 "application/json"
365 ],
366 "cache-control": [
367 "no-store"
368 ]
369 }
370 },
371 "request": {
372 "method": "POST",
373 "uri": "https://phab.mercurial-scm.org//api/differential.revision.edit",
374 "body": "transactions%5B0%5D%5Bvalue%5D=PHID-DIFF-xm6cw76uivc6g56xiuv2&transactions%5B0%5D%5Btype%5D=update&transactions%5B1%5D%5Bvalue%5D=create+alpha+for+phabricator+test&transactions%5B1%5D%5Btype%5D=title&api.token=cli-hahayouwish",
375 "headers": {
376 "accept": [
377 "application/mercurial-0.1"
378 ],
379 "content-type": [
380 "application/x-www-form-urlencoded"
381 ],
382 "host": [
383 "phab.mercurial-scm.org"
384 ],
385 "content-length": [
386 "242"
387 ],
388 "user-agent": [
389 "mercurial/proto-1.0 (Mercurial 4.7.1+866-5f07496726a1+20180915)"
390 ]
391 }
392 }
393 },
394 {
395 "response": {
396 "status": {
397 "message": "OK",
398 "code": 200
399 },
400 "body": {
401 "string": "{\"result\":[{\"id\":\"4596\",\"phid\":\"PHID-DREV-bntcdwe74cw3vwkzt6nq\",\"title\":\"create alpha for phabricator test\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D4596\",\"dateCreated\":\"1536986862\",\"dateModified\":\"1536986862\",\"authorPHID\":\"PHID-USER-cgcdlc6c3gpxapbmkwa2\",\"status\":\"0\",\"statusName\":\"Needs Review\",\"properties\":[],\"branch\":null,\"summary\":\"\",\"testPlan\":\"\",\"lineCount\":\"1\",\"activeDiffPHID\":\"PHID-DIFF-xm6cw76uivc6g56xiuv2\",\"diffs\":[\"11072\"],\"commits\":[],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\"},\"ccs\":[\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"sourcePath\":null}],\"error_code\":null,\"error_info\":null}"
402 },
403 "headers": {
404 "x-xss-protection": [
405 "1; mode=block"
406 ],
407 "expires": [
408 "Sat, 01 Jan 2000 00:00:00 GMT"
409 ],
410 "set-cookie": [
411 "phsid=A%2F5d2bgafhoqhg5thqxeu6y4fngq7lqezf5h6eo5pd; expires=Thu, 14-Sep-2023 04:47:43 GMT; Max-Age=157680000; path=/; domain=phab.mercurial-scm.org; secure; httponly"
412 ],
413 "x-frame-options": [
414 "Deny"
415 ],
416 "x-content-type-options": [
417 "nosniff"
418 ],
419 "strict-transport-security": [
420 "max-age=0; includeSubdomains; preload"
421 ],
422 "server": [
423 "Apache/2.4.10 (Debian)"
424 ],
425 "date": [
426 "Sat, 15 Sep 2018 04:47:43 GMT"
427 ],
428 "content-type": [
429 "application/json"
430 ],
431 "cache-control": [
432 "no-store"
433 ]
434 }
435 },
436 "request": {
437 "method": "POST",
438 "uri": "https://phab.mercurial-scm.org//api/differential.query",
439 "body": "api.token=cli-hahayouwish&ids%5B0%5D=4596",
440 "headers": {
441 "accept": [
442 "application/mercurial-0.1"
443 ],
444 "content-type": [
445 "application/x-www-form-urlencoded"
446 ],
447 "host": [
448 "phab.mercurial-scm.org"
449 ],
450 "content-length": [
451 "58"
452 ],
453 "user-agent": [
454 "mercurial/proto-1.0 (Mercurial 4.7.1+866-5f07496726a1+20180915)"
455 ]
456 }
457 }
458 },
459 {
460 "response": {
461 "status": {
462 "message": "OK",
463 "code": 200
464 },
465 "body": {
466 "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}"
467 },
468 "headers": {
469 "x-xss-protection": [
470 "1; mode=block"
471 ],
472 "expires": [
473 "Sat, 01 Jan 2000 00:00:00 GMT"
474 ],
475 "set-cookie": [
476 "phsid=A%2F2cewrqifmvko6evm2sy2nvksvcvhk6hpsj36lcv2; expires=Thu, 14-Sep-2023 04:47:43 GMT; Max-Age=157680000; path=/; domain=phab.mercurial-scm.org; secure; httponly"
477 ],
478 "x-frame-options": [
479 "Deny"
480 ],
481 "x-content-type-options": [
482 "nosniff"
483 ],
484 "strict-transport-security": [
485 "max-age=0; includeSubdomains; preload"
486 ],
487 "server": [
488 "Apache/2.4.10 (Debian)"
489 ],
490 "date": [
491 "Sat, 15 Sep 2018 04:47:43 GMT"
492 ],
493 "content-type": [
494 "application/json"
495 ],
496 "cache-control": [
497 "no-store"
498 ]
499 }
500 },
501 "request": {
502 "method": "POST",
503 "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty",
504 "body": "data=%7B%22date%22%3A+%220+0%22%2C+%22node%22%3A+%22d8f232f7d799e1064d3da179df41a2b5d04334e9%22%2C+%22user%22%3A+%22test%22%2C+%22parent%22%3A+%220000000000000000000000000000000000000000%22%7D&name=hg%3Ameta&diff_id=11072&api.token=cli-hahayouwish",
505 "headers": {
506 "accept": [
507 "application/mercurial-0.1"
508 ],
509 "content-type": [
510 "application/x-www-form-urlencoded"
511 ],
512 "host": [
513 "phab.mercurial-scm.org"
514 ],
515 "content-length": [
516 "264"
517 ],
518 "user-agent": [
519 "mercurial/proto-1.0 (Mercurial 4.7.1+866-5f07496726a1+20180915)"
520 ]
521 }
522 }
523 },
524 {
525 "response": {
526 "status": {
527 "message": "OK",
528 "code": 200
529 },
530 "body": {
531 "string": "{\"result\":null,\"error_code\":null,\"error_info\":null}"
532 },
533 "headers": {
534 "x-xss-protection": [
535 "1; mode=block"
536 ],
537 "expires": [
538 "Sat, 01 Jan 2000 00:00:00 GMT"
539 ],
540 "set-cookie": [
541 "phsid=A%2Fped6v7jlldydnkfolkdmecyyjrkciqhkr7opvbt2; expires=Thu, 14-Sep-2023 04:47:44 GMT; Max-Age=157680000; path=/; domain=phab.mercurial-scm.org; secure; httponly"
542 ],
543 "x-frame-options": [
544 "Deny"
545 ],
546 "x-content-type-options": [
547 "nosniff"
548 ],
549 "strict-transport-security": [
550 "max-age=0; includeSubdomains; preload"
551 ],
552 "server": [
553 "Apache/2.4.10 (Debian)"
554 ],
555 "date": [
556 "Sat, 15 Sep 2018 04:47:44 GMT"
557 ],
558 "content-type": [
559 "application/json"
560 ],
561 "cache-control": [
562 "no-store"
563 ]
564 }
565 },
566 "request": {
567 "method": "POST",
568 "uri": "https://phab.mercurial-scm.org//api/differential.setdiffproperty",
569 "body": "data=%7B%22d8f232f7d799e1064d3da179df41a2b5d04334e9%22%3A+%7B%22time%22%3A+0.0%2C+%22author%22%3A+%22test%22%2C+%22authorEmail%22%3A+%22test%22%7D%7D&name=local%3Acommits&diff_id=11072&api.token=cli-hahayouwish",
570 "headers": {
571 "accept": [
572 "application/mercurial-0.1"
573 ],
574 "content-type": [
575 "application/x-www-form-urlencoded"
576 ],
577 "host": [
578 "phab.mercurial-scm.org"
579 ],
580 "content-length": [
581 "227"
582 ],
583 "user-agent": [
584 "mercurial/proto-1.0 (Mercurial 4.7.1+866-5f07496726a1+20180915)"
585 ]
586 }
587 }
588 }
589 ]
590 }