Skip to content
Snippets Groups Projects
Commit 2abe60aad309 authored by Georges Racinet's avatar Georges Racinet
Browse files

Fixed comparison tests to match errors in Gitaly 16.8

Nothing serious, no change to main code. All explanations
in comments.
parent 12ca59b8b847
No related branches found
No related tags found
1 merge request!238Fixed comparison tests to match errors in Gitaly 16.8
Pipeline #78129 passed with warnings
...@@ -132,7 +132,14 @@ ...@@ -132,7 +132,14 @@
# case when revision does not exist # case when revision does not exist
for path in (b'', b'foo'): for path in (b'', b'foo'):
assert_compare_errors(revision=b'be0123ef' * 5, path=path) # as of Gitaly 16.8, the Gitaly details are
# 'panic: runtime error: invalid memory address or \
# nil pointer dereference'
# (used to be exit code 128, clearly rewritten from subprocess
# into native Golang. However it would be over-ridiculous to
# mimic that one.
assert_compare_errors(revision=b'be0123ef' * 5, path=path,
same_details=False)
# case when file does not exist or does not match # case when file does not exist or does not match
assert_compare(revision=b'branch/default', path=b'no-such-file') assert_compare(revision=b'branch/default', path=b'no-such-file')
......
...@@ -159,12 +159,10 @@ ...@@ -159,12 +159,10 @@
do_rpc('git', rel_path, storage='cargoship') do_rpc('git', rel_path, storage='cargoship')
assert exc_info_hg.value.code() == exc_info_git.value.code() assert exc_info_hg.value.code() == exc_info_git.value.code()
# test with a broken symlink (which points to itself) # As of 16.8, the broken symlink (pointing to itself) is an INTERNAL
# it used to be an error for both, with Gitaly complaining # error in Gitaly (too many levels of symbolic links),
# that the file exists (but would not raise an error for # but the more interesting ordinary case
# an existing proper Git repo). As of 14.6, Gitaly refuses # of existing directory is still a ALREADY_EXISTS error, so let us
# all existing files, including broken symlinks # test that.
# As a consequence of the added early check, we don't have repo_name = "existing_dir"
# any case of `hg init` itself failing on hand.
repo_name = "myrepo_a_broken_symlink"
path = (server_repos_root / default_storage / repo_name) path = (server_repos_root / default_storage / repo_name)
...@@ -170,5 +168,5 @@ ...@@ -170,5 +168,5 @@
path = (server_repos_root / default_storage / repo_name) path = (server_repos_root / default_storage / repo_name)
path.symlink_to(path) path.mkdir()
with pytest.raises(grpc.RpcError) as exc_info_hg: with pytest.raises(grpc.RpcError) as exc_info_hg:
do_rpc('hg', repo_name) do_rpc('hg', repo_name)
with pytest.raises(grpc.RpcError) as exc_info_git: with pytest.raises(grpc.RpcError) as exc_info_git:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment