echo script output to the display

Ryan Schmidt ryandesign at macports.org
Sun Sep 21 01:32:56 PDT 2014


On Sep 21, 2014, at 2:42 AM, Marko Käning wrote:
> 
> On 21 Sep 2014, at 01:21 , Ryan Schmidt wrote:
>> I wouldn't necessarily say that. The test phase tests the software. Users may well want to test that the software they're going to use passes its test suite. Of course, not all ports have test suites, and of those that do not all of them pass. Not all maintainers run their ports' test phases either.
> 
> +1
> 
> 
> I remember that we already had a discussion about this topic a while back,
> in thread [1]
> 
> 	Where do I find a good example of a "tests” variant
>        (which is really installing the tests on the system)?
> 
> when I stumbled over this myself. I also would like to have a user-end test
> phase

The existing test phase should be fine.

> which would expose test results to the user. Users should be able to
> opt-in for this by setting a global option enabling these tests.
> 
> But this would need some serious work on MacPorts’ base code, I figure...

I've very infrequently tried to run any ports' tests. Partly it's the inconvenience of having to remember to run "sudo port test" before running "sudo port install". If wanting to use a variant, it's harder (having to specify the same variants to both test and install). If wanting to test an upgrade of an already installed port, it's harder (having to determine which variants were specified before, then specifying them again). This would be fixed by offering your proposed global (i.e. macports.conf) setting for automatically running the test phase.

The other reason I avoid the tests is that much of the time, the tests would fail. Now what? If I was about to commit an update to the port, should I let a test failure prevent me from committing the update? Should I then have to go back and test the previous version to see if its tests failed too? Failing tests could admittedly indicate real problems in the software, but they could just as easily indicate a test suite that was never tested on OS X.

If we offer a setting for automatically running the test phase, I feel we should have a way to print the results of the tests, while not preventing the installation of the port (either always, or via another setting). For example:


$ sudo port install zlib
--->  Computing dependencies for zlib
--->  Fetching distfiles for zlib
--->  Verifying checksums for zlib
--->  Extracting zlib
--->  Applying patches to zlib
--->  Configuring zlib
--->  Building zlib
--->  Testing zlib: failed
--->  Staging zlib into destroot
--->  Installing zlib @1.2.8_0
--->  Activating zlib @1.2.8_0
--->  Cleaning zlib


To see the test results, the user could run:

port log --phase test zlib

For the log to still be there after the installation, the user would also have to have set "keeplogs yes". I do this on my main MacPorts installation, and I periodically run my housekeeping script which deletes logs more than a month old.




More information about the macports-dev mailing list