From: Ævar Arnfjörð Bjarmason Date: Wed, 27 Jul 2022 23:00:44 GMT Subject: Re: [PATCH 1/5] remote-curl: add 'get' capability Message-ID: <220728.86a68ukvg6.gmgdl@evledraar.gmail.com> In-Reply-To: <40808e92afb7bcf3e8e9b4b53d5e30b5e17816f8.1658781277.git.gitgitgadget@gmail.com> On Mon, Jul 25 2022, Derrick Stolee via GitGitGadget wrote: > From: Derrick Stolee > [...] Add a: TEST_PASSES_SANITIZE_LEAK=true Before: > +. ./test-lib.sh > + > +. "$TEST_DIRECTORY"/lib-httpd.sh > +start_httpd > + > +test_expect_success 'get by URL: 404' ' > + url="$HTTPD_URL/none.txt" && > + cat >input <<-EOF && > + capabilities > + get $url file1 > + EOF > + > + test_must_fail git remote-http $url err && > + test_path_is_missing file1 && > + grep "failed to download file at URL" err && > + rm file1.temp This should presumably be a : test_when_finished "rm file.temp" Before the "test_must_fail", otherwise we'll leave this around if e.g. the "grep" in the &&-chain fails, but we surely want to clean this up in that case.. > +' > + > +test_expect_success 'get by URL: 200' ' > + echo data >"$HTTPD_DOCUMENT_ROOT_PATH/exists.txt" && > + > + url="$HTTPD_URL/exists.txt" && > + cat >input <<-EOF && > + capabilities > + get $url file2 > + > + EOF > + > + GIT_TRACE2_PERF=1 git remote-http $url