From 740c46001c2cc505a6b33fb565a76a1d7789bc4d Mon Sep 17 00:00:00 2001 From: Jun Wu Date: Wed, 13 Oct 2021 13:25:05 -0700 Subject: [PATCH] test-edenapi-server-commit-location-to-hash: switch to debugapi Summary: See previous diffs for context. This makes the test shorter and will eventually allow us to remove some bloated code in edenapi. Reviewed By: yancouto Differential Revision: D31465818 fbshipit-source-id: 7885d7204d01a5ae7a0e835eeb9e51cedcc6281d --- ...t-edenapi-server-commit-location-to-hash.t | 82 +++++-------------- 1 file changed, 21 insertions(+), 61 deletions(-) diff --git a/eden/mononoke/tests/integration/test-edenapi-server-commit-location-to-hash.t b/eden/mononoke/tests/integration/test-edenapi-server-commit-location-to-hash.t index 3d85b586c0..a3485ae33c 100644 --- a/eden/mononoke/tests/integration/test-edenapi-server-commit-location-to-hash.t +++ b/eden/mononoke/tests/integration/test-edenapi-server-commit-location-to-hash.t @@ -61,67 +61,27 @@ Start up EdenAPI server. $ mononoke $ wait_for_mononoke -Create and send file data request. - $ edenapi_make_req commit-location-to-hash > req.cbor < { - > "requests": [{ - > "location": { - > "descendant": "$COMMIT_B1", - > "distance": 1 - > }, - > "count": 2 - > }, { - > "location": { - > "descendant": "$COMMIT_B1", - > "distance": 2 - > }, - > "count": 1 - > }, { - > "location": { - > "descendant": "$COMMIT_M1", - > "distance": 1 - > }, - > "count": 1 - > } - > ] - > } +Prepare request. + $ cat > req < [ + > ("$COMMIT_B1", 1, 2), + > ("$COMMIT_B1", 2, 1), + > ("$COMMIT_M1", 1, 1), + > ] > EOF - Reading from stdin - Generated request: WireCommitLocationToHashRequestBatch { - requests: [ - WireCommitLocationToHashRequest { - location: WireCommitLocation { - descendant: WireHgId("45a08a9d95ee1053cf34273c8a427973d4ffd11a"), - distance: 1, - }, - count: 2, - }, - WireCommitLocationToHashRequest { - location: WireCommitLocation { - descendant: WireHgId("45a08a9d95ee1053cf34273c8a427973d4ffd11a"), - distance: 2, - }, - count: 1, - }, - WireCommitLocationToHashRequest { - location: WireCommitLocation { - descendant: WireHgId("b5bc5249412595662f15a1aca5ae50fec4a93628"), - distance: 1, - }, - count: 1, - }, - ], - } - - $ sslcurl -s "https://localhost:$MONONOKE_SOCKET/edenapi/repo/commit/location_to_hash" --data-binary @req.cbor > res.cbor Check files in response. - $ edenapi_read_res commit-location-to-hash res.cbor - Reading from file: "res.cbor" - LocationToHashRequest(known=45a08a9d95ee1053cf34273c8a427973d4ffd11a, dist=1, count=2) - c7dcf24fab3a8ab956273fa40d5cc44bc26ec655 - e83645968c8f2954b97a3c79ce5a6b90a464c54d - LocationToHashRequest(known=45a08a9d95ee1053cf34273c8a427973d4ffd11a, dist=2, count=1) - e83645968c8f2954b97a3c79ce5a6b90a464c54d - LocationToHashRequest(known=b5bc5249412595662f15a1aca5ae50fec4a93628, dist=1, count=1) - ce33edd793793f108fbe78aa90f3fedbeae09082 + $ hgedenapi debugapi -e commitlocationtohash -f req + [{"count": 2, + "hgids": [bin("c7dcf24fab3a8ab956273fa40d5cc44bc26ec655"), + bin("e83645968c8f2954b97a3c79ce5a6b90a464c54d")], + "location": {"distance": 1, + "descendant": bin("45a08a9d95ee1053cf34273c8a427973d4ffd11a")}}, + {"count": 1, + "hgids": [bin("e83645968c8f2954b97a3c79ce5a6b90a464c54d")], + "location": {"distance": 2, + "descendant": bin("45a08a9d95ee1053cf34273c8a427973d4ffd11a")}}, + {"count": 1, + "hgids": [bin("ce33edd793793f108fbe78aa90f3fedbeae09082")], + "location": {"distance": 1, + "descendant": bin("b5bc5249412595662f15a1aca5ae50fec4a93628")}}]