Page MenuHomePhabricator

phabricator: add custom vcr matcher to match request bodies
ClosedPublic

Authored by Kwan on May 6 2019, 2:17 PM.

Details

Summary

Currently when the phabricator extension's conduit output changes the tests
don't notice since the default vcr matcher only matches on 'method' and 'uri',
not the body.

Add a custom matcher that checks the same params are in the body (ignoring
ordering).

vcr's in-built body matcher can't be used since it fails under py3 with a
"UnicodeEncodeError" on the "€ in commit message" tests.

The DREV ids have decreased since the recordings were generated against a
different phabricator instance to avoid spamming mercurial-devel.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Kwan created this revision.May 6 2019, 2:17 PM
martinvonz added inline comments.
hgext/phabricator.py
135–144

Can this be written simply return set(r1params) == set(r2params)?

Kwan added inline comments.May 10 2019, 11:49 AM
hgext/phabricator.py
135–144

Ha! Yes, of course it can. Sorry, I keep forgetting one can do that.

Kwan marked 2 inline comments as done.May 10 2019, 11:50 AM
Kwan updated this revision to Diff 15046.

Switch to comparing sets.

This revision was automatically updated to reflect the committed changes.