git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] http: do not ignore proxy path

From
Jeff King <peff@peff.net>
Date
Aug 1, 2024, 05:45 UTC
Message-ID
<20240801054523.GA621899@coredump.intra.peff.net>
In-Reply-To
<xmqqle1hyzcu.fsf@gitster.g>
On Wed, Jul 31, 2024 at 03:24:01PM -0700, Junio C Hamano wrote:
Show 30 quoted lines
> > +start_socks() {
> > +	mkfifo socks_output &&
> > +	{
> > +		"$PERL_PATH" "$TEST_DIRECTORY/socks4-proxy.pl" "$1" >socks_output &
> > +		socks_pid=$!
> > +	} &&
> > +	read line <socks_output &&
> > +	test "$line" = ready
> > +}
> > +
> > +test_expect_success PERL 'try to start SOCKS proxy' '
> > +	# The %30 tests that the correct amount of percent-encoding is applied
> > +	# to the proxy string passed to curl.
> > +	if start_socks %30.sock
> > +	then
> > +		test_set_prereq SOCKS_PROXY
> > +	fi
> > +'
> 
> Making it a regular test_expect_success would mean GIT_SKIP_TEST
> mechansim can be used to skip it, which is probably not what you
> want.  Can't this be a more common test_lazy_prereq, perhaps like
> 
> 	test_lazy_prereq SOCKS_PROXY '
> 		# useful comment about 30% here ...
> 		test_have_prereq PERL &&
> 		start_socks %30.sock
> 	'
> 
> or something?

I think Ryan picked up this approach from my earlier mail. And the reason I suggested doing it this way is that the prereq test has an important side effect: it creates the socket and starts the proxy server!

I think lazy prereqs only make sense when their only output is the yes/no of whether we match the prereq. And then we don't care when or how often they are evaluated. I do think things would work, assuming the proxy server then can serve multiple tests. It just feels weird, and doing it more like the git-daemon/http tests made more sense to me (though those ones do not even do their work inside an expect block).

If we did it in a lazy prereq I think you'd need to munge the path, as the lazy prereq operates in a throwaway directory (so the %30.sock would get removed before we can use it in the next test).

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 15 of 31 in “http: do not ignore proxy path”
  1. http: do not ignore proxy pathRyan Hendrickson via GitGitGadget, Jul 26, 2024
  2. Junio C HamanoJul 26, 2024
  3. Ryan HendricksonJul 26, 2024
  4. Junio C HamanoJul 26, 2024
  5. Jeff KingJul 26, 2024
  6. Ryan HendricksonJul 26, 2024
  7. Jeff KingJul 29, 2024
  8. http: do not ignore proxy pathRyan Hendrickson via GitGitGadget, Jul 27, 2024
  9. Jeff KingJul 29, 2024
  10. Ryan HendricksonJul 31, 2024
  11. http: do not ignore proxy pathRyan Hendrickson via GitGitGadget, Jul 31, 2024
  12. Junio C HamanoJul 31, 2024
  13. Ryan HendricksonAug 1, 2024
  14. Junio C HamanoAug 1, 2024
  15. Jeff KingAug 1, 2024
  16. Junio C HamanoAug 1, 2024
  17. http: do not ignore proxy pathRyan Hendrickson via GitGitGadget, Aug 1, 2024
  18. Jeff KingAug 1, 2024
  19. Junio C HamanoAug 1, 2024
  20. http: do not ignore proxy pathRyan Hendrickson via GitGitGadget, Aug 2, 2024
  21. Junio C HamanoAug 2, 2024
  22. Ryan HendricksonAug 2, 2024
  23. Junio C HamanoAug 2, 2024
  24. Ryan HendricksonAug 2, 2024
  25. Junio C HamanoAug 2, 2024
  26. Ryan HendricksonAug 2, 2024
  27. Junio C HamanoAug 2, 2024
  28. Ryan HendricksonAug 2, 2024
  29. Junio C HamanoAug 2, 2024
  30. Junio C HamanoAug 2, 2024
  31. Ryan HendricksonAug 2, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.