Commit Graph

9 Commits

Author SHA1 Message Date
Adam Simpkins
33b2fbc0bc fbconduit: fix error handling in gitnode() revset
Summary:
Don't let errors propagate out of the gitnode() revset.  Always report errors
in gitnode() as a translation failure, rather than letting exceptions propagate
up and crash mercurial.  The code was previously only catching internally
generated ConduitError exceptions, but it can also throw HttpError exceptions,
and the underlying httplib code can throw its own exceptions as well as
socket.error exceptions.

This also fixes the test code to use an ephemeral TCP port rather than assuming
port 8543 will always be available.  Using a fixed TCP port in test code is a
very common way to cause bogus failures if the tests are run in parallel.
(For instance, testing multiple repositories in parallel on the same build
host.)

Test Plan:
Added unit tests that check the behavior when the server returns a 500 error,
and when the server refuses the connection entirely.

Reviewers: quark, durham, rmcelroy

Reviewed By: rmcelroy

Subscribers: net-systems-diffs@fb.com, yogeshwer, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4556871

Signature: t1:4556871:1487062142:b58d770d46c975d44933bec08cfce8acb25ff16b
2017-02-15 12:35:06 -08:00
Martijn Pieters
14dc38a7ba testing: adjust for new home for cmdutil.service
Summary: See rd9d8d78e in the hg repository; cmdutil.service moved to server.runservice

Test Plan: Run test-fbconduit.t and observe it passing once more.

Reviewers: simonfar, rmcelroy, quark

Reviewed By: quark

Subscribers: mjpieters, #mercurial

Differential Revision: https://phabricator.intern.facebook.com/D4244268

Signature: t1:4244268:1480432981:8e06beadba912294e6d1a01d93b13848cb16a096
2016-11-29 07:51:16 -08:00
Jun Wu
c11cddecf5 test-check: backport test-check-execute from core hg
Test Plan: `arc unit`

Reviewers: #sourcecontrol, stash

Reviewed By: stash

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4037205

Signature: t1:4037205:1476876512:e7659ce8add7fabacb50bb5fb3fe1f1d1744c304
2016-10-18 17:58:45 +01:00
Durham Goode
ff15a890ad tests: undo lint fix for conduithttp and replace with a suppression 2016-08-01 11:56:48 -07:00
Durham Goode
cee701f980 tests: fix checkcode and simple test failures 2016-08-01 11:54:13 -07:00
Mateusz Kwapich
b4ec1447c3 fbconduit: the deamon-postexec is a list now
Summary: upstream change broke tests

Test Plan: tests are fixed now

Reviewers: #sourcecontrol, quark, ttung, durham

Reviewed By: durham

Subscribers: mjpieters

Differential Revision: https://phabricator.fb.com/D3122221

Signature: t1:3122221:1459455094:a52eef1692b0bbf1acf8070760c3bfdc68d9c697
2016-03-31 13:34:21 -07:00
Ryan McElroy
1d8ca1bad6 fbconduit: fix test http service
Summary: 1e42206a9778 in core hg broke this.

Test Plan: run the test and it doesn't fail

Reviewers: #sourcecontrol, ttung, durham

Reviewed By: durham

Subscribers: durham, mjpieters

Differential Revision: https://phabricator.fb.com/D3012325

Tasks: 10299400

Signature: t1:3012325:1457118454:6b551be9d826d17ecff18f271b31d9dc0218f461
2016-03-07 02:49:58 -08:00
Tony Tung
6fdff081b8 fix breakages due to fbconduit api changes regarding missing revs
Summary:
FBConduit used to throw a conduit error when a rev didn't map.
Now, it just returns an empty string for the mapping.  This updates the
fbconduit extension so that it matches the server behavior.

Test Plan: passed unit tests.

Reviewers: mitrandir, ericsumner, durham

Reviewed By: ericsumner

Subscribers: mitrandir

Differential Revision: https://phabricator.fb.com/D2331464

Tasks: 7970302

Signature: t1:2331464:1439500203:cbf79e9b9c54aebdf33bbad82c1982b5a69e8bc9
2015-08-10 21:22:21 -07:00
Tony Tung
1e6d65e9dc mock fbconduit server
Summary:
Built a http server that serves as a mock fbconduit server.  It
answers the normal requests that fbconduit makes, as well as:

PUT /from_repo/from_scm/to_repo/to_scm/from_hash/to_hash
DELETE /from_repo/from_scm/to_repo/to_scm/from_hash/to_hash

Test Plan: used in later diffs

Reviewers: lcharignon, rmcelroy, durham, ericsumner

Reviewed By: ericsumner

Subscribers: mitrandir

Differential Revision: https://phabricator.fb.com/D2244917

Signature: t1:2244917:1436982657:bde0c04ea21299970dfb782b43ed13ab1f3e17b0
2015-07-14 21:20:31 -07:00