From patchwork Thu Jun 8 00:35:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3, of, 3, pip-fix] tests: add a test for installing hg with pip in a virtualenv From: Matt Harbison X-Patchwork-Id: 21239 Message-Id: To: "Augie Fackler" Cc: mercurial-devel Date: Wed, 07 Jun 2017 20:35:39 -0400 On Wed, 07 Jun 2017 09:56:09 -0400, Augie Fackler wrote: > >> On Jun 6, 2017, at 21:31, Matt Harbison wrote: >> >> On Tue, 06 Jun 2017 14:24:51 -0400, Augie Fackler >> wrote: >> >>> # HG changeset patch >>> # User Augie Fackler >>> # Date 1496762198 14400 >>> # Tue Jun 06 11:16:38 2017 -0400 >>> # Node ID fed1c1d2fb7a5cb7e72cc882bcea0651551c7758 >>> # Parent 8d69b4886e678a7bc372097eeb33950592c53d43 >>> tests: add a test for installing hg with pip in a virtualenv >>> >>> Since we're doing so much clever junk in our setup.py, let's have a >>> test that exercises it. >> >> The change works for Windows, thanks. But this test doesn't. I can >> follow up, but basically the path on Windows is >> "installenv/Scripts/pip" instead of ../bin/.. But since that's already >> in an #if block, I had to define variables for pip and hg outside of >> the block, and spell out the b?n part. > > Interesting. Should we make it a test-pip-install.t that does #require > virtualenv, and then we can conditionalize the command on the OS? > > Alternatively, could we get away with doing ./installenv/*/hg > debuginstall? would that work? Yes, with some output globbed too. (check-code doesn't like the trailing space in the comment) ($TESTTMP/installenv/*/site-packages/mercurial/templates)... (glob) + checking default template ($TESTTMP/installenv/*/site-packages/mercurial/templates/map-cmdline.default) (glob) checking commit editor... (*) (glob) checking username (test) no problems detected diff --git a/tests/test-install.t b/tests/test-install.t --- a/tests/test-install.t +++ b/tests/test-install.t @@ -183,11 +191,11 @@ $ cd $TESTTMP Note: --no-site-packages is deprecated, but some places have an ancient virtualenv from their linux distro or similar and it's not yet -the default for them. +the default for them. $ unset PYTHONPATH $ $PYTHON -m virtualenv --no-site-packages installenv >> pip.log - $ ./installenv/b?n/pip install $TESTDIR/.. >> pip.log - $ ./installenv/b?n/hg debuginstall || cat pip.log + $ ./installenv/*/pip install $TESTDIR/.. >> pip.log + $ ./installenv/*/hg debuginstall || cat pip.log checking encoding (ascii)... checking Python executable (*) (glob) checking Python version (2.*) (glob) @@ -202,8 +210,8 @@ checking registered compression engines (*) (glob) checking available compression engines (*) (glob) checking available compression engines for wire protocol (*) (glob) - checking templates ($TESTTMP/installenv/lib*/python2.7/site-packages/mercurial/templates)... (glob) - checking default template ($TESTTMP/installenv/lib*/python2.7/site-packages/mercurial/templates/map-cmdline.default) (glob) + checking templates