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

Re: Use mongoose to test smart-http unconditionally?

From
Jeff King <peff@peff.net>
Date
Dec 4, 2013, 22:25 UTC
Message-ID
<20131204222522.GA16706@sigill.intra.peff.net>
In-Reply-To
<xmqqa9ggl6oq.fsf@gitster.dls.corp.google.com>
On Wed, Dec 04, 2013 at 12:09:09PM -0800, Junio C Hamano wrote:
Show 21 quoted lines
> Duy Nguyen <pclouds@gmail.com> writes:
> 
> > I was thinking of an alternative to apache for testing smart-http
> > so that most of http tests could always run.  Mongoose [1] looks
> > like a good candidate to bundle with git. Just one pair of source
> > files, mongoose.[ch], a mainloop wrapper and we have an http
> > server.
> 
> Hmmmm.  How would the high-level integration look like?
> 
>  - we add contrib/mongoose/*;
> 
>  - in t/Makefile, we:
> 
>    . set GIT_TEST_HTTPD to yes, unless it is already set to another value;
> 
>    . set LIB_HTTPD_PATH to $GIT_BUILD_DIR/contrib/mongoose/mongoose,
>      unless it is already set to another value;
> 
>    . if LIB_HTTPD_PATH is set to our mongoose and if it hasn't been
>      built, go ../contrib/mongoose and build it.

I think building it on-demand is probably too much effort. If it is portable, then it should not be a problem to just build it along with the rest of git. If it is not, then we should rethink whether it is worth including.

>  - we teach lib-httpd.sh to trigger the DEFAULT_HTTPD_PATH
>    computation when LIB_HTTPD_PATH is set to 'system-apache', so
>    that people can test with their installed apache if they choose
>    to; and

I do not think we want to allow run-time switching between an embedded solution and apache. That would mean that we have to keep two sets of http-server config in sync.

> Or were you thinking about embedding mongoose in the git executable?

I don't think it makes sense to embed it in git, but it could easily be test-httpd.

The rollout would be:
  1. add contrib/mongoose/*
  2. add test-httpd which links against mongoose, built by default in the
     Makefile
  3. convert lib-httpd/apache.conf into mongoose config as necessary
  4. convert lib-httpd.sh to run test-httpd instead of LIB_HTTPD_PATH
  5. delete apache.conf, LIB_HTTPD_PATH and any other apache remnants
  6. default GIT_TEST_HTTPD to yes

Step 3 is the part where I would anticipate trouble (i.e., finding out that the new server does not do everything the tests expect).

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 10 in “Use mongoose to test smart-http unconditionally?”
  1. Duy NguyenDec 4, 2013
  2. Shawn PearceDec 4, 2013
  3. Jeff KingDec 4, 2013
  4. Jonathan NiederDec 4, 2013
  5. Duy NguyenDec 5, 2013
  6. Jeff KingDec 5, 2013
  7. Junio C HamanoDec 4, 2013
  8. Jeff KingDec 4, 2013
  9. Junio C HamanoDec 4, 2013
  10. Jeff KingDec 5, 2013

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.