From f4ce0e45981df58ebb10806d53b82beb90a596ce Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 1 Mar 2023 12:07:33 +0100 Subject: test: Add test for just-mr git tree repository type --- test/other_tools/just_mr/just-mr.test.sh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/other_tools/just_mr/just-mr.test.sh b/test/other_tools/just_mr/just-mr.test.sh index 2fa00ec3..3c1f669a 100644 --- a/test/other_tools/just_mr/just-mr.test.sh +++ b/test/other_tools/just_mr/just-mr.test.sh @@ -65,20 +65,29 @@ echo test > "${FILE_ROOT}/test_dir2/test_dir3/test_file" echo "Set up local git repo" # NOTE: Libgit2 has no support for Git bundles yet mkdir -p "${GIT_ROOT}" +mkdir -p bin +cat > bin/git_dir_setup.sh < foo.txt +echo bar > foo/bar.txt +echo baz > foo/bar/baz.txt +EOF +# set up git repo ( cd "${GIT_ROOT}" \ - && mkdir -p foo/bar \ - && echo foo > foo.txt \ - && echo bar > foo/bar.txt \ + && sh "${SERVER_ROOT}/bin/git_dir_setup.sh" \ && git init -b test \ && git config user.email "nobody@example.org" \ && git config user.name "Nobody" \ && git add . \ && git commit -m "test" --date="1970-01-01T00:00Z" ) -# the root commit ID is known -- see git_repo.test.cpp readonly GIT_REPO_COMMIT="$(cd "${GIT_ROOT}" && git rev-parse HEAD)" +echo "Set up git tree repo" +# get tree id; only the content of the directory structure matters +readonly GIT_TREE_ID="$(cd "${GIT_ROOT}" && git ls-tree "${GIT_REPO_COMMIT}" foo/bar | awk '{print $3}')" + echo "Publish remote repos to HTTP server" # start Python server as remote repos location port_file="$(mktemp -t port_XXXXXX -p "${TEST_TMPDIR}")" @@ -136,6 +145,13 @@ cat > test-repos.json <