[PATCH evolve] tests: use curl instead of wget

Jun Wu quark at fb.com
Tue Oct 25 08:59:52 EDT 2016


It sounds like the case that an additional abstraction could solve.

I think it may be worthwhile to add a thin shell script choosing whatever
available to use under "tests/". It could define a shell function (could
be just "wget" and implement it using curl), and tests can source it.

Excerpts from Simon Farnsworth's message of 2016-10-24 14:37:27 +0100:
> On 24/10/2016 14:32, Pierre-Yves David wrote:
> >
> >
> > On 10/24/2016 03:26 PM, Simon Farnsworth wrote:
> >> # HG changeset patch
> >> # User Simon Farnsworth <simonfar at fb.com>
> >> # Date 1477315431 25200
> >> #      Mon Oct 24 06:23:51 2016 -0700
> >> # Branch stable
> >> # Node ID 5fbaca977cd43dfd806a3f452543ef0ed4a4732e
> >> # Parent  970a4c13ebc320a034bc0aff21e0ef0a84157a92
> >> tests: use curl instead of wget
> >>
> >> curl is supplied by default on macOS 10.12, but wget isn't. As curl is
> >> easy
> >> to install on other OSes, just switch the tests over.
> >
> > Hum, 4e7da688a066 and 3ffa12edc05a who did the exact opposite 1.5 year
> > ago. Can you have a look at them and come back with a plan that fits
> > both need?
> >
> 
> I've looked at the commits you referenced, and there's not enough 
> context for me to understand why Matt switched from cURL (works on Linux 
> and macOS by default, needs a package installed on Windows as far as I 
> understand it), to wget (needs a package installed on Windows and macOS 
> as far as I understand it).
> 
> Can you give me context for why you took these two commits?
> 
> >
> >> diff --git a/tests/test-simple4server-bundle2.t
> >> b/tests/test-simple4server-bundle2.t
> >> --- a/tests/test-simple4server-bundle2.t
> >> +++ b/tests/test-simple4server-bundle2.t
> >> @@ -71,12 +71,12 @@
> >>  Capacity testing
> >>  ===================
> >>
> >> -  $ wget -q -O -
> >> http://localhost:$HGPORT/?cmd=hello
> >> +  $ curl -s
> >> http://localhost:$HGPORT/?cmd=hello
> >>    capabilities: * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0
> >> _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (glob)
> >> -  $ wget -q -O -
> >> http://localhost:$HGPORT/?cmd=capabilities
> >> +  $ curl -s
> >> http://localhost:$HGPORT/?cmd=capabilities
> >>    * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0
> >> _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon
> >> (no-eol) (glob)
> >>
> >> -  $ wget -q -O -
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >> +  $ curl -s
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >>    bookmarks
> >>    namespaces
> >>    obsolete
> >> @@ -128,14 +128,14 @@
> >>  ===========================================
> >>  (used by bitbucket to select which repo use evolve)
> >>
> >> -  $ wget -q -O -
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >> +  $ curl -s
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >>    bookmarks
> >>    namespaces
> >>    obsolete
> >>    phases
> >> -  $ wget -q -O -
> >> http://localhost:$HGPORT/?cmd=hello
> >> +  $ curl -s
> >> http://localhost:$HGPORT/?cmd=hello
> >>    capabilities: * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0
> >> _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (glob)
> >> -  $ wget -q -O -
> >> http://localhost:$HGPORT/?cmd=capabilities
> >> +  $ curl -s
> >> http://localhost:$HGPORT/?cmd=capabilities
> >>    * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0
> >> _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon
> >> (no-eol) (glob)
> >>
> >>    $ echo '[__temporary__]' >> server/.hg/hgrc
> >> @@ -144,7 +144,7 @@
> >>    $ hg serve -R server -n test -p $HGPORT -d --pid-file=hg.pid -A
> >> access.log -E errors.log
> >>    $ cat hg.pid >> $DAEMON_PIDS
> >>
> >> -  $ wget -q -O -
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >> +  $ curl -s
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >>    bookmarks
> >>    namespaces
> >>    phases
> >> @@ -154,13 +154,13 @@
> >>    $ hg serve -R server -n test -p $HGPORT -d --pid-file=hg.pid -A
> >> access.log -E errors.log
> >>    $ cat hg.pid >> $DAEMON_PIDS
> >>
> >> -  $ wget -q -O -
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >> +  $ curl -s
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >>    bookmarks
> >>    namespaces
> >>    obsolete
> >>    phases
> >>
> >> -  $ wget -q -O -
> >> http://localhost:$HGPORT/?cmd=hello
> >> +  $ curl -s
> >> http://localhost:$HGPORT/?cmd=hello
> >>    capabilities: * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0
> >> _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (glob)
> >> -  $ wget -q -O -
> >> http://localhost:$HGPORT/?cmd=capabilities
> >> +  $ curl -s
> >> http://localhost:$HGPORT/?cmd=capabilities
> >>    * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0
> >> _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon
> >> (no-eol) (glob)
> >> diff --git a/tests/test-simple4server.t b/tests/test-simple4server.t
> >> --- a/tests/test-simple4server.t
> >> +++ b/tests/test-simple4server.t
> >> @@ -73,12 +73,12 @@
> >>  Capacity testing
> >>  ===================
> >>
> >> -  $ wget -q -O -
> >> http://localhost:$HGPORT/?cmd=hello
> >> +  $ curl -s
> >> http://localhost:$HGPORT/?cmd=hello
> >>    capabilities: * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0
> >> _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (glob)
> >> -  $ wget -q -O -
> >> http://localhost:$HGPORT/?cmd=capabilities
> >> +  $ curl -s
> >> http://localhost:$HGPORT/?cmd=capabilities
> >>    * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0
> >> _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon
> >> (no-eol) (glob)
> >>
> >> -  $ wget -q -O -
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >> +  $ curl -s
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >>    bookmarks
> >>    namespaces
> >>    obsolete
> >> @@ -131,14 +131,14 @@
> >>  ===========================================
> >>  (used by bitbucket to select which repo use evolve)
> >>
> >> -  $ wget -q -O -
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >> +  $ curl -s
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >>    bookmarks
> >>    namespaces
> >>    obsolete
> >>    phases
> >> -  $ wget -q -O -
> >> http://localhost:$HGPORT/?cmd=hello
> >> +  $ curl -s
> >> http://localhost:$HGPORT/?cmd=hello
> >>    capabilities: * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0
> >> _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (glob)
> >> -  $ wget -q -O -
> >> http://localhost:$HGPORT/?cmd=capabilities
> >> +  $ curl -s
> >> http://localhost:$HGPORT/?cmd=capabilities
> >>    * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0
> >> _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon
> >> (no-eol) (glob)
> >>
> >>    $ echo '[__temporary__]' >> server/.hg/hgrc
> >> @@ -147,13 +147,13 @@
> >>    $ hg serve -R server -n test -p $HGPORT -d --pid-file=hg.pid -A
> >> access.log -E errors.log
> >>    $ cat hg.pid >> $DAEMON_PIDS
> >>
> >> -  $ wget -q -O -
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >> +  $ curl -s
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >>    bookmarks
> >>    namespaces
> >>    phases
> >> -  $ wget -q -O -
> >> http://localhost:$HGPORT/?cmd=hello
> >> | grep _evoext_pushobsmarkers_0
> >> +  $ curl -s
> >> http://localhost:$HGPORT/?cmd=hello
> >> | grep _evoext_pushobsmarkers_0
> >>    [1]
> >> -  $ wget -q -O -
> >> http://localhost:$HGPORT/?cmd=capabilities
> >> | grep _evoext_pushobsmarkers_0
> >> +  $ curl -s
> >> http://localhost:$HGPORT/?cmd=capabilities
> >> | grep _evoext_pushobsmarkers_0
> >>    [1]
> >>
> >>    $ echo 'advertiseobsolete=True' >> server/.hg/hgrc
> >> @@ -161,12 +161,12 @@
> >>    $ hg serve -R server -n test -p $HGPORT -d --pid-file=hg.pid -A
> >> access.log -E errors.log
> >>    $ cat hg.pid >> $DAEMON_PIDS
> >>
> >> -  $ wget -q -O -
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >> +  $ curl -s
> >> "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces
> >> " | sort
> >>    bookmarks
> >>    namespaces
> >>    obsolete
> >>    phases
> >> -  $ wget -q -O -
> >> http://localhost:$HGPORT/?cmd=hello
> >> +  $ curl -s
> >> http://localhost:$HGPORT/?cmd=hello
> >>    capabilities: * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0
> >> _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (glob)
> >> -  $ wget -q -O -
> >> http://localhost:$HGPORT/?cmd=capabilities
> >> +  $ curl -s
> >> http://localhost:$HGPORT/?cmd=capabilities
> >>    * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0
> >> _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon
> >> (no-eol) (glob)
> >> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
> >>
> >
> 


More information about the Mercurial-devel mailing list