sapling/eden/mononoke/tests/integration/test-lfs-server-error-formatting.t
Thomas Orozco 70007f049e mononoke/lfs_server: add a test for error formatting
Summary:
I'm going to send a diff to get rid of failure chains, and the LFS Server
actually uses that quite a bit. Let's make sure we don't affect the error
rendering there.

Reviewed By: StanislavGlebik

Differential Revision: D21383032

fbshipit-source-id: e0ec9c88760e7fd48d39fa1570efd1870a9ef532
2020-05-05 05:44:52 -07:00

30 lines
940 B
Perl

# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License found in the LICENSE file in the root
# directory of this source tree.
$ . "${TEST_FIXTURES}/library.sh"
# Create a repository
$ setup_mononoke_config
$ REPOID=1 setup_mononoke_repo_config repo1
# Start an LFS server for this repository
$ LFS_URI="$(lfs_server)/repo1"
# Query it and cause an error
$ curl --silent "$LFS_URI/download/foo" | jq -S .
{
"message": "Could not parse Content ID: invalid blake2 input: need exactly 64 hex digits",
"request_id": "*" (glob)
}
$ curl --silent "$LFS_URI/download/1111111111111111111111111111111111111111111111111111111111111111" | jq -S .
{
"message": "Object does not exist: Canonical(ContentId(Blake2(1111111111111111111111111111111111111111111111111111111111111111)))",
"request_id": "*" (glob)
}