[RFC] New TL;DR Essay: What you should know about automated testing

2017-12-06 Thread Shlomi Fish
Hi all!

I started writing this essay and could use some commentary:

https://github.com/shlomif/what-you-should-know-about-automated-testing

It is CC0, and aims to be kept as short as possible and free of fluff, and to
be useful for motivation.

Please let me know what you think.

Regards,

Shlomi

-- 
-
Shlomi Fish   http://www.shlomifish.org/
http://www.shlomifish.org/humour/bits/Can-I-SCO-Now/ - “Can I SCO Now?”

Chuck Norris’ E-mails are signed with “Sent using Chuck Norris’ brain (which
he can also kill you using it).”.
— http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: Test2/Test::Builder release plan

2016-03-26 Thread Shlomi Fish
Hi all,

On Sat, 26 Mar 2016 02:57:38 +
Randy Stauner  wrote:

> As a maintainer of one of the problem modules (Test::Aggregate) i should
> have something to say, but I haven't been able to spend more than an hour
> with Perl in the last year so i don't know when I'll be able to work on
> making it work with the changes.  I see no reason to hold up progress on
> this any longer, so "sounds good" to me.
> 

I may be willing to do some work on Test-Aggregate for that. Otherwise, my use
of Test::More and Test::Builder is probably contained only to the very
high-level API , so I don't expect anything major to break, so "sounds good" to
me as well.

Regards,

Shlomi Fish

-- 
-----
Shlomi Fish   http://www.shlomifish.org/
List of Portability Libraries - http://shlom.in/port-libs

The C Preprocessor - There’s not supposed to be a way to do it.
— http://www.shlomifish.org/humour/ways_to_do_it.html

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: hackathon web page displays strangely

2015-03-21 Thread Shlomi Fish
Hi James,

On Sat, 21 Mar 2015 08:51:42 -0400
James E Keenan  wrote:

> http://act.qa-hackathon.org/qa2015/main
> 
> In Firefox, at least, all the pages on this site are displaying in a 
> strange way.  Each page has a left sidebar with internal links and a 
> right sidebar with sponsors.  But the main content for each page only 
> starts to appear *below* the end of the longer of the two sidebars. 
> Unless and until you scroll down past the sidebars, each page appears 
> void of content.

This appears to happen if and only if the browser's viewport window is too
narrow. If I make it wide enough, the page displays fine. For what it's worth, I
can reproduce a similar behaviour in the Google Chromium browser.

Regards,

Shlomi Fish 

-- 
-----
Shlomi Fish   http://www.shlomifish.org/
Humanity - Parody of Modern Life - http://shlom.in/humanity

The more money Chuck Norris comes across, the less problems he sees.
— http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/

Please reply to list if it's a mailing list post - http://shlom.in/reply .


[ANN] Test-Data-Split - split data-driven tests into several test scripts.

2014-10-24 Thread Shlomi Fish
Hi all,

I am proud to announce Test-Data-Split:

* https://metacpan.org/release/Test-Data-Split

* https://github.com/shlomif/perl-Test-Data-Split

This is a small Perl module that allows one to automatically generate test
files based on data, that can later be run individually or parallelised using
prove -j$N .

Here's an example. Given this generator file:

< CODE >

#!/usr/bin/perl

use strict;
use warnings;
use autodie;

use FindBin;
use lib "$FindBin::Bin/../t/t/lib";

use Test::Data::Split;
use FC_Solve::Test::Valgrind;

Test::Data::Split->new(
{
target_dir => 't',
filename_cb => sub {
my ($self, $args) = @_;

return "valgrind--$args->{id}.t";
},
contents_cb => sub {
my ($self, $args) = @_;
my $id_quoted = quotemeta($args->{id});
return <<"EOF";
#!/usr/bin/perl

use strict;
use warnings;

use Test::More tests => 1;

use FC_Solve::Test::Valgrind;

# TEST
FC_Solve::Test::Valgrind->new->run_valgrind_id_test({ id => qq/$id_quoted/, });

EOF
},
data_obj => FC_Solve::Test::Valgrind->new,
}
)->run;
  
< / CODE >

And a FC_Solve::Test::Valgrind module like this one:

< CODE >

package FC_Solve::Test::Valgrind;

use strict;
use warnings;

use parent 'Test::Data::Split::Backend::Hash';

use Test::More ();
use Carp ();
use File::Spec ();
use File::Temp qw( tempdir );

my %valgrind_tests =
(
'dbm_fc_solver_1' =>
{
prog => "dbm_fc_solver",
argv =>
[
'--offload-dir-path', {type => 'tempdir', },
{ type => 'catfile',
args => [{ type => 'ENV', arg => 'FCS_SRC_PATH'},
't', 't', 'data',
'sample-boards', '2freecells-24-mid-with-colons.board'
],
}
],
blurb => qq{dbm_fc_solver from 24-mid-with-colons.},
},

[snipped]
);

sub get_hash
{
return \%valgrind_tests;
}

[snipped]

sub run_valgrind_id_test
{
local $Test::Builder::Level = $Test::Builder::Level + 1;

my ($self, $args) = @_;

my $id = $args->{id};

return _test_using_valgrind($id, $self->lookup_data($id))
}

< / CODE >

Then I get individual test scripts like:


#!/usr/bin/perl

use strict;
use warnings;

use Test::More tests => 1;

use FC_Solve::Test::Valgrind;

# TEST
FC_Solve::Test::Valgrind->new->run_valgrind_id_test({ id =>
qq/board_gen__aisleriot__t_only/, });





#!/usr/bin/perl

use strict;
use warnings;

use Test::More tests => 1;

use FC_Solve::Test::Valgrind;

# TEST
FC_Solve::Test::Valgrind->new->run_valgrind_id_test({ id =>
qq/dbm_fc_solver_1/, });




Etc.

=====

Some plans for the future are:

1. Code several different backends: DBI/SQL, BDB/Google LevelDB , etc.

2. Allow a way to aggregate several IDs into an individual script. 

3. Perhaps create an ::Easy interface with more magic.

Comments are welcome. Enjoy and Shabbath Shalom.

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Understand what Open Source is - http://shlom.in/oss-fs

Chuck Norris can only convince you that you're deceased. Summer Glau can
also convince you that you're alive, which is much harder.
— http://www.shlomifish.org/humour/bits/facts/Summer-Glau/

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: Final TPF Devel::Cover grant report

2014-10-09 Thread Shlomi Fish
On Tue, 7 Oct 2014 22:42:41 +0100
Paul Johnson  wrote:

> In accordance with the terms of my grant from TPF this is the final report for
> my work on improving Devel::Cover.
> 
> Since the last report I have released versions 1.16 and 1.17.
> 

Thanks for all your work, Paul!

Regards,

Shlomi Fish

-- 
---------
Shlomi Fish   http://www.shlomifish.org/
Parody of "The Fountainhead" - http://shlom.in/towtf

When Chuck Norris orders Pizza, it arrives before he presses the OK button.
— http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: TPF Devel::Cover grant report April 2014

2014-05-20 Thread Shlomi Fish
Hi Paul,

thank you a lot for your work.

Regards,

Shlomi Fish

On Tue, 20 May 2014 22:50:35 +0100
Paul Johnson  wrote:

> In accordance with the terms of my grant from TPF this is the monthly
> report for my work on improving Devel::Cover covering April 2014.
> 
> This month I released versions 1.10, 1.11, 1.12 and 1.13.
> 

-- 
---------
Shlomi Fish   http://www.shlomifish.org/
Stop Using MSIE - http://www.shlomifish.org/no-ie/

I invented the term Object‐Oriented, and I can tell you I did not have C++ in
mind.  — Alan Kay (Attributed)

Please reply to list if it's a mailing list post - http://shlom.in/reply .


New version of libtap - libtap-1.2.1

2014-01-12 Thread Shlomi Fish
Hi all!

libtap version 1.2.1 is now available from its homepage:

http://www.shlomifish.org/open-source/projects/libtap/

libtap is a C library to emit TAP (= the Test Anything Protocol) which allows
writing test programs in C that can be tested using a TAP harness. libtap was
originally created by Nik Clayton, but it was neglected for a long time, and
eventually I decided to adopt it. Some changes were incorporated from the
libtap version of CCAN (= the "Comprehensive C Archive Network").  

In libtap-1.2.1, I made the conversion of its build system from GNU Autotools to
CMake (see http://www.shlomifish.org/open-source/anti/autohell/ for the
motivation), and am also now generating and installing a pkg-config file - 
https://en.wikipedia.org/wiki/Pkg-config .

The announcement of libtap-1.2.1 should hit http://freecode.com/ soon.

Enjoy!

Regards,
    
    Shlomi Fish

-- 
-----
Shlomi Fish   http://www.shlomifish.org/
"Star Trek: We, the Living Dead" - http://shlom.in/st-wtld

When Chuck Norris uses Gentoo, “emerge kde” finishes in under a minute. A
computer cannot afford to keep Chuck waiting for too long.
— http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: How to Port https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames to TAP::Harness

2013-11-29 Thread Shlomi Fish
On Fri, 29 Nov 2013 01:11:23 -0800 (PST)
Ovid  wrote:

> Hi Shlomi,
> 
> My definitive answer would be to say "work with Leon" on this :) He's taken
> over maintenance on TAP::Harness. I haven't looked at that section of the
> code in quite some time and honestly, I don't have the time/energy to do so
> right now. Best, Ovid

OK, thanks for the reply and the clarification. I will work with Leon on it.

Regards,

Shlomi Fish

-- 
---------
Shlomi Fish   http://www.shlomifish.org/
Funny Anti-Terrorism Story - http://shlom.in/enemy

 Absolutely. Also: a German dog barks “wau” and a cat meows “miau”
 Su-Shee: German animals are true German patriots.

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: How to Port https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames to TAP::Harness

2013-11-28 Thread Shlomi Fish
On Tue, 26 Nov 2013 14:00:30 +0100
Leon Timmermans  wrote:

> On Fri, Sep 20, 2013 at 8:29 PM, Shlomi Fish  wrote:
> 
> > I read that post and have one question: can I easily create several
> > specialised
> > plugins and have them all apply their modified behaviours to the relevant
> > part
> > of TAP::Harness? Seems like I can only set up a single subclass of the
> > relevant
> > parts in each plugin (like for the formatter or whatever). Or am I missing
> > something?
> >
> > I'm asking because with Test::Run, I can set up more than one plugin for
> > each
> > class and I'm wondering how to do that with TAP::Harness.
> >
> 
> I think you may want to write a set of subclasses with the appropriate
> hooks (e.g. a TAP::Formatter::Extensible), and use that to write plugins
> for.
> 
> Leon

Hi Leon,

thanks for the response, but I think I'll wait for a definitive answer from
Ovid, who originally wrote TAP::Harness, so I'll know whether I need to invest
the extra effort in doing that. Sorry if you're disappointed.

Regards,

Shlomi Fish 

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Free (Creative Commons) Music Downloads, Reviews and more - http://jamendo.com/

What does “IDK” stand for? I don’t know.

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: How to Port https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames to TAP::Harness

2013-11-25 Thread Shlomi Fish
Hi all,

On Fri, 20 Sep 2013 21:29:02 +0300
Shlomi Fish  wrote:

> Hi Ovid,
> 
> On Sat, 7 Sep 2013 14:16:08 -0700 (PDT)
> Ovid  wrote:
> 
> > Here's a complete example of a TAP::Harness plugin to create a red/green
> > progress bar.
> > 
> > http://blogs.perl.org/users/ovid/2010/05/making-testharness-output-a-progress-bar.html
> > 
> 
> I read that post and have one question: can I easily create several
> specialised plugins and have them all apply their modified behaviours to the
> relevant part of TAP::Harness? Seems like I can only set up a single subclass
> of the relevant parts in each plugin (like for the formatter or whatever). Or
> am I missing something?
> 
> I'm asking because with Test::Run, I can set up more than one plugin for each
> class and I'm wondering how to do that with TAP::Harness. 
> 

Can anyone please answer that question?

Regards,

    Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Escape from GNU Autohell - http://www.shlomifish.org/open-source/anti/autohell/

I’d do Windows-- , but this may result in an integer underflow.
— an Israeli Linuxer.

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: How to Port https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames to TAP::Harness

2013-11-01 Thread Shlomi Fish
Hi all,

can someone (Ovid?) please reply to this post I wrote? I really would like to
know.

Regards,

Shlomi Fish

On Fri, 20 Sep 2013 21:29:02 +0300
Shlomi Fish  wrote:

> Hi Ovid,
> 
> On Sat, 7 Sep 2013 14:16:08 -0700 (PDT)
> Ovid  wrote:
> 
> > Here's a complete example of a TAP::Harness plugin to create a red/green
> > progress bar.
> > 
> > http://blogs.perl.org/users/ovid/2010/05/making-testharness-output-a-progress-bar.html
> > 
> 
> I read that post and have one question: can I easily create several
> specialised plugins and have them all apply their modified behaviours to the
> relevant part of TAP::Harness? Seems like I can only set up a single subclass
> of the relevant parts in each plugin (like for the formatter or whatever). Or
> am I missing something?
> 
> I'm asking because with Test::Run, I can set up more than one plugin for each
> class and I'm wondering how to do that with TAP::Harness. 
> 
> Regards,
> 
>   Shlomi Fish
> 
> > 
> > Cheers,
> > Ovid
> >  
> > --
> > IT consulting, training, international recruiting
> >        http://www.allaroundtheworld.fr/.
> > Buy my book! - http://bit.ly/beginning_perl
> > Live and work overseas - http://www.overseas-exile.com/
> > 
> > 
> 



-- 
-
Shlomi Fish   http://www.shlomifish.org/
Selina Mandrake - The Slayer (Buffy parody) - http://shlom.in/selina

Larry Wall has been changing the world. By modifying its very source code.

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: How to Port https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames to TAP::Harness

2013-09-20 Thread Shlomi Fish
Hi Ovid,

On Sat, 7 Sep 2013 14:16:08 -0700 (PDT)
Ovid  wrote:

> Here's a complete example of a TAP::Harness plugin to create a red/green
> progress bar.
> 
> http://blogs.perl.org/users/ovid/2010/05/making-testharness-output-a-progress-bar.html
> 

I read that post and have one question: can I easily create several specialised
plugins and have them all apply their modified behaviours to the relevant part
of TAP::Harness? Seems like I can only set up a single subclass of the relevant
parts in each plugin (like for the formatter or whatever). Or am I missing
something?

I'm asking because with Test::Run, I can set up more than one plugin for each
class and I'm wondering how to do that with TAP::Harness. 

Regards,

Shlomi Fish

> 
> Cheers,
> Ovid
>  
> --
> IT consulting, training, international recruiting
>        http://www.allaroundtheworld.fr/.
> Buy my book! - http://bit.ly/beginning_perl
> Live and work overseas - http://www.overseas-exile.com/
> 
> 

-- 
---------
Shlomi Fish   http://www.shlomifish.org/
Freecell Solver - http://fc-solve.shlomifish.org/

If his programming is anything like his philosophising, he would find ten
imaginary bugs in the “Hello World” program.

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: How to Port https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames to TAP::Harness

2013-09-08 Thread Shlomi Fish
Hi Ovid,

On Sat, 7 Sep 2013 14:16:08 -0700 (PDT)
Ovid  wrote:

> Here's a complete example of a TAP::Harness plugin to create a red/green
> progress bar.
> 
> http://blogs.perl.org/users/ovid/2010/05/making-testharness-output-a-progress-bar.html

Thanks!

I'll take a look.

Regards,

Shlomi Fish

> 
> 
> Cheers,
> Ovid
>  
> --
> IT consulting, training, international recruiting
>        http://www.allaroundtheworld.fr/.
> Buy my book! - http://bit.ly/beginning_perl
> Live and work overseas - http://www.overseas-exile.com/
> 
> 
> 
> >
> > From: Shlomi Fish 
> >To: perl-qa@perl.org 
> >Sent: Friday, 6 September 2013, 17:16
> >Subject: How to Port
> >https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames to
> >TAP::Harness
> > 
> >
> >Hi all,
> >
> >I'd like to know what is the best way to create a plugin for
> >https://metacpan.org/module/TAP::Harness which will behave similarly to
> >https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames . I
> >found out that the runtests method can accept aliases to be displayed
> >instead of the filename itself using an arrayref of [ $test, $alias ], so I
> >can simply wrap runtests() in a subclass, process the arguments, and call
> >next::method with the modified arguments.
> >
> >However, I still don't know how to write a plugin like that exactly (and how
> >to get prove to recognise it). This section -
> >https://metacpan.org/module/TAP::Harness#WRITING-PLUGINS - explains a bit
> >about how to do that with some hand-waving, but does not show any complete
> >top-to-bottom example, and I could not find anything with a metacpan search.
> >
> >My motivation for doing this is to port the rest of the functionality I miss
> >in Test::Run (which failed to gain mainstream acceptance, and few people
> >aside from me are using it) into TAP::Harness.
> >
> >Regards,
> >
> >    Shlomi Fish
> >
> >-- 
> >-
> >Shlomi Fish      http://www.shlomifish.org/
> >Selina Mandrake - The Slayer (Buffy parody) - http://shlom.in/selina
> >
> >bzr is slower than Subversion in combination with Sourceforge.
> >    — Sjors, http://dazjorz.com/
> >
> >Please reply to list if it's a mailing list post - http://shlom.in/reply .
> >
> >



-- 
-
Shlomi Fish   http://www.shlomifish.org/
Interview with Ben Collins-Sussman - http://shlom.in/sussman

Daniel: Yeah, those guys [= NSA] don’t publish…
Andrew: They perish, man.
— http://www.shlomifish.org/humour/Summerschool-at-the-NSA/

Please reply to list if it's a mailing list post - http://shlom.in/reply .


How to Port https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames to TAP::Harness

2013-09-06 Thread Shlomi Fish
Hi all,

I'd like to know what is the best way to create a plugin for
https://metacpan.org/module/TAP::Harness which will behave similarly to
https://metacpan.org/module/Test::Run::Plugin::TrimDisplayedFilenames . I found
out that the runtests method can accept aliases to be displayed instead of the
filename itself using an arrayref of [ $test, $alias ], so I can simply wrap
runtests() in a subclass, process the arguments, and call next::method with the
modified arguments.

However, I still don't know how to write a plugin like that exactly (and how to
get prove to recognise it). This section -
https://metacpan.org/module/TAP::Harness#WRITING-PLUGINS - explains a bit about
how to do that with some hand-waving, but does not show any complete
top-to-bottom example, and I could not find anything with a metacpan search.

My motivation for doing this is to port the rest of the functionality I miss in
Test::Run (which failed to gain mainstream acceptance, and few people
aside from me are using it) into TAP::Harness.

Regards,

    Shlomi Fish

-- 
-----
Shlomi Fish   http://www.shlomifish.org/
Selina Mandrake - The Slayer (Buffy parody) - http://shlom.in/selina

bzr is slower than Subversion in combination with Sourceforge.
— Sjors, http://dazjorz.com/

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: QA for Perl

2013-07-31 Thread Shlomi Fish
Hi Tracy,

On Wed, 31 Jul 2013 15:29:18 +
Tracy Radel  wrote:

> Hello,
> I'm looking for information on quality assurance documentation for basic
> Perl.  I am trying to do QA on a Perl script that we wrote, but before I can
> do this I need to do QA on the install of Perl.  I've been searching for
> hours online and cannot find QA or V&V documents for Perl.  Do any of you
> know where I might find this documentation, if it exists?  If not, do you
> know how other companies have dealt with QA for the installation of Perl?
> 

The perl core (= the Perl 5 implementation) contains a comprehensive test suite,
that contains over half-a-million (> 500,000) test assertions for testing perl
on the host system. To run it, build perl and type "make test".

I'm not sure what's the easy way to run it on a perl binary that was already
installed to the system, but it should be doable. Make sure you run the test
suite of the version that corresponds to the version of perl that you
installed.

Hope it helps.

Regards,

Shlomi Fish

> Thanks,
> 
> Tracy Radel
> Nuclear Engineer
> SHINE Medical Technologies
> tracy.ra...@shinemed.com



-- 
-
Shlomi Fish   http://www.shlomifish.org/
Selina Mandrake - The Slayer (Buffy parody) - http://shlom.in/selina

I feel much better, now that I’ve given up hope.
— Ashleigh Brilliant

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: [ESSAY] “Writing tests, motherfucker!”

2013-01-29 Thread Shlomi Fish
Hi Jeffrey,

On Tue, 29 Jan 2013 16:36:54 -0800
Jeffrey Ryan Thalhammer  wrote:

> 
> On Jan 26, 2013, at 1:13 AM, Shlomi Fish wrote:
> 
> > However, now I feel that trying to
> > philosophise about the distinction between all those is not so useful for
> > the people who are actually trying to write the tests.
> 
> 
> +1000
> 

:-)

> I once had fervent debates with colleagues about whether something was a
> "unit test" or "integration test" or "acceptance test".  I always felt the
> distinction was pointless, but now I understand why it happened.
> 
> Unit tests were regarded as the developer's realm.  Integration tests are the
> build engineer's responsibility.  And acceptance tests might belong to QA.
> So labeling tests serves as a means for allocating work (and blame).
> 
> Fortunately, I've seen more and more organizations dismantle their QA teams
> completely.  Quality is everyone's responsibility.

Well, I feel that having some testers who try to break the software is useful
for programs which have a GUI, a web UI, etc. They don't need to be coders
per-ce, but should be clueful to try various things. I am always frustrated
that various web UIs don't behave exactly like I want, and I feel that
contacting the web-site owner will yield nothing. (Google, I am looking at
you).

As someone who is obsessed with even the smallest usability details on
http://www.shlomifish.org/ and other sites, I feel that the standard “You have
a problem with a site, and I agree with you that it's a problem, but I'm not
going to make it a high priority to fix it, so f**k you!” (as opposed to what
Joel on Software said here -
http://www.joelonsoftware.com/articles/customerservice.html .


> 
> Now, somebody, just write the damn test :)
> 

Agreed. :-).

> -Jeff

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Stop Using MSIE - http://www.shlomifish.org/no-ie/

My Commodore 64 is suffering from slowness and insufficiency of memory, and its
display device is grievously short of pixels.  Can anybody help?
— Omer Zak

Please reply to list if it's a mailing list post - http://shlom.in/reply .


[ESSAY] “Writing tests, motherfucker!”

2013-01-26 Thread Shlomi Fish
Hi all,

I hope the *.perl.org filters won't give troubles to my title and content, but
I've done it as a tribute to http://programming-motherfucker.com/ , which I
recommend going over, being the anti-methodology/NoMethodology (but in part
apparently written tongue-in-cheek), and which isn't too long a read, and also
hosts the useful http://programming-motherfucker.com/become.html list of
resources for learning.

So why am I writing this? I used to feel guilty about not being conscious of
the distinction between the various scopes of tests, like unit tests vs.
integration tests vs. system tests vs. functional tests etc. when I wrote the
tests. I just noticed that I need a test here (as a regression test for a bug,
or to TDD a new feature, or after implementing a new feature, etc.), and wrote
it using Test::More or whatever. However, now I feel that trying to
philosophise about the distinction between all those is not so useful for the
people who are actually trying to write the tests.

“Tests are good, mmkay? Just freaking write them!”

chromatic has expressed some sentiments against the so-called “Behaviour Driven
Development” (BDD) Domain-specific-languages (DSLs) such as cucumber here:

http://modernperlbooks.com/mt/2012/04/what-testing-dsls-get-wrong.html

One thing he says in a comment there is:

<<<<
Our clients are the parents, guardians, and teachers of children between the
ages of eight and twelve inclusive.

The intent of Cucumber is to make readable testcases, just as the intent of
COBOL and AppleScript and visual component programming is to enable
non-programmers to create software without having to learn how to program.
>>>>

Not only is it impossible to have people who are non-programmers write
structure code without learning how to program (at least until we get
sufficiently intelligent Sci-Fi-like AI that will be able to perform
programming like humans do), I feel that you need to write some kind of code,
however formatted, to write tests, just like HTML and CSS and spreadsheet
programs, involve writing some kind of *code*.

If you want to have your clients write tests, my best suggestion is to other
instruct them in the proper methodology and discipline of coding, or
alternatively have them show you how to reproduce the problem (using
screenshots, screencasts, shared remote desktop sessions, etc.) and then *you*
write a test for it.[Note]

{{{
[Note] - some people fear that teaching laymen how to code will create
competition for professional programmers, and dilute the profession. However,
this is not true, because there's always a difference between a casual dealer
in a craftsmanship or art, and someone who invested a substantial amount of
time doing it. E.g: lots of people can cook well, but not everyone is a
professional Chef. 
}}}

So I think the distinction between the various tests may be useful for
methodologists and software engineering researchers (people who try to guide
other people how to code) more than the people who are actually coding. To quote
Picasso: “When art critics get together they talk about Form and Structure and
Meaning. When artists get together they talk about where you can buy cheap
turpentine.” ( taken from http://orip.org/ ). Similarly, literature
critics and researchers have very little to say that is of use for most writers
and even authors. I hated studying Literature (what Americans might call
"English" although naturally in Israel, we study Hebrew texts) with a
passion, and didn't do too well on the tests (in part because I refused to
write a lot of extraneous text, which the teacher seemed to have liked), only
to become a writer of fiction and essays (see
http://www.paulgraham.com/essay.html ) after graduation, which most people I
talked with seem to have liked and appreciate what I wrote (although I admit
they are certainly not letter perfect).

Similarly, I'm now struggling with this tome -
http://www.amazon.com/xUnit-Test-Patterns-Refactoring-Code/dp/0131495054 -
which seems like I cannot see the forest for the trees from it, while I
really enjoyed reading the much shorter and much more hands-on
http://en.wikipedia.org/wiki/Test-Driven_Development_by_Example (by Kent Beck).

The time we talk about how to write tests is often better spent writing tests
(or production code, which is, naturally, what tests are aim to support and
are meaningless without it), so I think we should just “freaking write them”.

“Write tests, m*f*!”

Regards,

Shlomi Fish

-- 
-----
Shlomi Fish   http://www.shlomifish.org/
Escape from GNU Autohell - http://www.shlomifish.org/open-source/anti/autohell/

Linux — Because Software Problems Should not Cost Money.

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: QA Sqitch and the rest of perl-module-rpms

2012-10-24 Thread Shlomi Fish
Hi David,

On Tue, 23 Oct 2012 12:23:43 -0700
"David E. Wheeler"  wrote:

> Hello QA,
> 
> The perl-module-rpms Git repository has had a number of changes since
> its last promotion to production, including the addition of Sqitch.
> Please QA these for production, as the history database project (née
> audit service) will require it, as will many other projects coming
> down the pike (e.g., reporting).
> 
> Once it looks good, please check with Aaron to make sure his team has
> had a chance to update the SOAP server installation instructions to
> prevent any changes from breaking the current release of the SOAP
> server (and gateway), as described here:
> 
>   http://jira.iovation.com/browse/OPS-1705
> 
> Once he has confirmed it, then your QA-approved stuff can be added to
> the production Yum repo.
> 

What is perl-module-rpms about? How is it related to other efforts of
packaging CPAN modules as RPMs that are mentioned here:

http://perl-begin.org/topics/cpan/wrappers-for-distributions/

Finally, where can it be found?

Regards,

Shlomi Fish

> Thanks,
> 
> David
> 



-- 
-
Shlomi Fish   http://www.shlomifish.org/
List of Text Editors and IDEs - http://shlom.in/IDEs

I hope that if it had not been clear before, it isn’t less clear now.
— One of Shlomi Fish’s Technion Lecturers

Please reply to list if it's a mailing list post -
http://shlom.in/reply .


Getting "No error" instead of "No such file or directory" on Win32

2012-06-24 Thread Shlomi Fish
Hi all,

in this CPAN testers XML-LibXML test failure:

http://www.cpantesters.org/cpan/report/d9cf95fc-d5e8-1017-8e8a-88a105085451

I am getting this:

[QUOTE]
t/01basic.t . ok

#   Failed test 'error parsing non-existent does_not_exist.xml'
#   at t/02parse.t line 238.
#   'Could not create file parser context for file 
"does_not_exist.xml": No error at t/02parse.t line 237.
# '
# doesn't match '(?-xism:\ACould not create file parser context for file 
"does_not_exist\.xml": No\ such\ file\ or\ directory)'
# Looks like you failed 1 test of 531.
t/02parse.t . 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/531 subtests 

[/QUOTE]

My question is - why?

Regards,

Shlomi Fish

-- 
---------
Shlomi Fish   http://www.shlomifish.org/
The Case for File Swapping - http://shlom.in/file-swap

Ran Eilam To Shlomi Fish: so what are you working on? Working on a new wiki
about unit testing fortunes in freecell?

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: Discuss change of namespace Test::Builder2 -> TB2?

2011-11-14 Thread Shlomi Fish
On Mon, 14 Nov 2011 08:02:46 +0100
Paul Johnson  wrote:

> On Sun, Nov 13, 2011 at 07:11:28PM -0800, Michael G Schwern wrote:
> 
> > In the interest of saving my hands, and the hands of test module authors, 
> > I'm
> > considering changing the namespace from Test::Builder2 to just TB2.  Like 
> > LWP
> > and DBI.
> 
> > Test::Builder, Test::More and Test::Simple remain unchanged.
> 
> > Thoughts?
> 
> I see no problems.  When something becomes very common a short form is
> welcome.
> 

I'm OK with it as well.

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Rethinking CPAN - http://shlom.in/rethinking-cpan

I’d do Windows-- , but this may result in an integer underflow.
— an Israeli Linuxer.

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: Move Test::More development discussion back to perl-qa?

2011-01-30 Thread Shlomi Fish
On Sunday 30 Jan 2011 00:20:28 Michael G Schwern wrote:
> When I started Test::Builder2 I gave it its own mailing list so it could
> have its own community and not clutter up perl-qa with detailed chatter
> about Test::Builder2 and Test::More development.
> 
> I don't get much response to posts on test-more-users, though I know people
> are subscribed.  perl-qa traffic has dropped off quite a bit.  I'm
> wondering that if I moved Test::More and Test::Builder2 posts back to
> perl-qa that there would be more discussion?
> 
> Do people not care?  Is it going over everyone's heads?  Is everyone just
> waiting for it to be "done"?  Does it not seem like TB2 is relevant?

I'm fine with these posts being posted on perl-qa (even though I'm subscribed 
to test-more-users).

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
http://www.shlomifish.org/humour/ways_to_do_it.html

Chuck Norris can make the statement "This statement is false" a true one.

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: Looking for a maintainer Test::Deep

2010-09-25 Thread Shlomi Fish
On Saturday 25 September 2010 19:55:59 Andy Armstrong wrote:
> On 24 Sep 2010, at 22:39, Fergal Daly wrote:
> [snip]
> 
> > Thanks. I was hoping to find an active user of the module since they
> > would have a bit of a head-start and motivation so I will leave the
> > door open a little longer before accepting your offer.
> 
> /me waves
> 
> Don't want to snub Schlomi's kind offer but I'm a big Test::Deep fan and
> would be happy to take it on.

Go for it!

Oh, and I spell my name "Shlomi" - not "Schlomi". People keep making this 
mistake from some reason.

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
My Public Domain Photos - http://www.flickr.com/photos/shlomif/

 She's a hot chick. But she smokes.
 She can smoke as long as she's smokin'.

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: Looking for a maintainer Test::Deep

2010-09-24 Thread Shlomi Fish
Hi Fergal,

On Friday 24 September 2010 23:00:53 Fergal Daly wrote:
> For a long time now, I haven't had time to maintain this module. I
> don't write any perl beyond 1-liners these days and work and family
> take up most of my free time. When I do have some time, tweaking
> software I don't use any more is not on high up the list.
> 
> There are a couple of things that need doing for the docs and a couple
> of small contributed patches to apply for new features but other than
> that, it's fairly static and low maintenance. I believe there are
> plenty of users but no real bug has been reported for a very long
> time.
> 
> The code itself is very modular, adding a new type of comparison is
> just a matter of adding a class and tests so if someone wanted to
> start actively developing new features it would be fairly easy.
> 

I (= http://search.cpan.org/~shlomif/ ) have some spare time to work on open-
source software. I don't believe I've used Test-Deep before, but may have used 
it indirectly. In any case, I volunteer to maintain the module unless and 
until a more suitable developer is found.

> I have change history available as git or hg.
> 

I think a Mercurial repository would be preferable because I think I like it 
better than git. Is there any difference between the two versions of the 
change history?

While we discuss Test-Deep it seems to have a fairly large number of old 
versions on CPAN: http://search.cpan.org/dist/Test-Deep/ . Please consider 
trimming them so CPAN will take less space (they are always available on 
backpan).

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
"Humanity" - Parody of Modern Life - http://shlom.in/humanity

 She's a hot chick. But she smokes.
 She can smoke as long as she's smokin'.

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: [Perl-org-patches] qa.perl.org

2009-12-30 Thread Shlomi Fish
On Wednesday 30 Dec 2009 10:50:35 Shlomi Fish wrote:
> On Tuesday 29 Dec 2009 23:54:26 Leo Lapworth wrote:
> > Hi,
> >
> > Please note this is cross posted.
> >
> > Several of the QA people have kindly said they will help with updating
> > http://qa.perl.org/.
> >
> > I'm cross posting to
> > http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/perl-org-patches
> >
> > I've split out the site a bit more, so there is a 'testing your code' and
> > a 'testing cpan' section on the site.
> >
> > So what is needed?...
> >
> > 1) Testing your code - I think this will need the largest amount of work.
> >
> > Hilary, could I ask you to have a look at this?
> >
> >  - Are the articles the best we can link to?
> >  - Do we need those articles if we update the rest of the content.
> >  - can the test-modules.html and testing-guidelines.html be cleaned up
> > and updated
> >(currently in POD, but does not have to stay that way)?
> >
> > 2) Testing CPAN
> >
> > Shaun, would you mind looking at this?
> >
> >  - Just needs a quick review/update
> >
> > 3) Phalanx
> >
> > Shlomi, would you look at this?
> >
> >  - Clean up, so that it can be put aside as completed/superseded.
> 
> OK, I will.
> 

OK, here goes:

1. "How many tests? How many bugs in RT? Report to Andy." - which Andy is it 
and where can I find his contact information.

2. Here's a patch that is a minor update (some formatting and some 
clarifications). Otherwise, the Phalanx site seems good.

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
What does "Zionism" mean? - http://shlom.in/def-zionism

Bzr is slower than Subversion in combination with Sourceforge. 
( By: http://dazjorz.com/ )
Index: phalanx/kwalitee.html
===
--- phalanx/kwalitee.html	(revision 1602)
+++ phalanx/kwalitee.html	(working copy)
@@ -6,23 +6,38 @@
 });
 
 %]
+What is Quality?
+
+
+Software quality is the property of software that makes it fit the needs of
+the end-users, not get on their nerves, and make them feel good about using
+it. The English Wikipedia has 
+http://en.wikipedia.org/wiki/Software_quality";>an article about
+software quality and Shlomi Fish wrote
+http://www.shlomifish.org/philosophy/computers/high-quality-software/";>an essay called "What Makes Software High-Quality?".
+
 
 What is kwalitee?
 
 
-Kwalitee is inexact quality. We don't know exactly what it is, but we know it when we see it.
+Measuring quality is hard, and so we coined the term Kwalitee which is 
+measurable (but inexact quality), so we can know it when we see it.
 
 
 What is a bug?
 
 
-If there is any difference between the docs, the code and the tests, it is a bug. Period. The bug might be in the docs or the tests, and the code is fine, but it's still a bug.
+If there is any difference between the docs, the code and the tests, it is a
+bug. Period. The bug might be in the docs or the tests, and the code is fine,
+but it's still a bug.
 
 
-If there is ambiguity about how the code is supposed to work, it is a bug. The documentation must be clarified, and the code may be out of sync as well.
+If there is ambiguity about how the code is supposed to work, it is a bug. The
+documentation must be clarified, and the code may be out of sync as well.
 
 
-If a hoplite discovers something behaving "incorrectly", according to the hoplite, it may or may not be a bug, according to the author's intent.
+If a hoplite discovers something behaving "incorrectly", according to the
+hoplite, it may or may not be a bug, according to the author's intent.
 
 
 What's a kwalitee module?
Index: phalanx/faq.html
===
--- phalanx/faq.html	(revision 1602)
+++ phalanx/faq.html	(working copy)
@@ -14,25 +14,33 @@
 How did you come up with the Phalanx 100 list?
 
 
-The specifics of how we derived the list isn't really important. We don't want the focus of the project to become which modules are getting attention. We'll be working on a wide variety of CPAN modules, as well as Perl itself, to improve their tests and documentation.
+The specifics of how we derived the list isn't really important. We don't want
+the focus of the project to become which modules are getting attention. We'll
+be working on a wide variety of CPAN modules, as well as Perl itself, to
+improve their tests and documentation.
 
 
 No, but really, did you look at logs or something?
 
 
-It really d

Re: [Perl-org-patches] qa.perl.org

2009-12-30 Thread Shlomi Fish
On Tuesday 29 Dec 2009 23:54:26 Leo Lapworth wrote:
> Hi,
> 
> Please note this is cross posted.
> 
> Several of the QA people have kindly said they will help with updating
> http://qa.perl.org/.
> 
> I'm cross posting to
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/perl-org-patches
> 
> I've split out the site a bit more, so there is a 'testing your code' and a
> 'testing cpan' section on the site.
> 
> So what is needed?...
> 
> 1) Testing your code - I think this will need the largest amount of work.
> 
> Hilary, could I ask you to have a look at this?
> 
>  - Are the articles the best we can link to?
>  - Do we need those articles if we update the rest of the content.
>  - can the test-modules.html and testing-guidelines.html be cleaned up and
> updated
>(currently in POD, but does not have to stay that way)?
> 
> 2) Testing CPAN
> 
> Shaun, would you mind looking at this?
> 
>  - Just needs a quick review/update
> 
> 3) Phalanx
> 
> Shlomi, would you look at this?
> 
>  - Clean up, so that it can be put aside as completed/superseded.
> 

OK, I will.

Regards,

Shlomi Fish


-- 
-
Shlomi Fish   http://www.shlomifish.org/
Rethinking CPAN - http://shlom.in/rethinking-cpan

Bzr is slower than Subversion in combination with Sourceforge. 
( By: http://dazjorz.com/ )


Re: qa.perl.org - anyone interested in updating it?

2009-12-20 Thread Shlomi Fish
On Saturday 19 Dec 2009 14:54:42 Leo Lapworth wrote:
> Hi,
> 
> I cleaned up http://qa.perl.org/ but the content needs a complete
> review/update.
> 
> Is anyone interested in doing this?
> 

I am!

You can contact me here:

http://www.shlomifish.org/me/contact-me/

Regards,

Shlomi Fish

> I've chatted with several people, but so far not found anyone interested.
> 
> If no one is interested we'll shut down the site as a lot has changed and
>  we now have CPAN Testers as well, which is probably where we'd redirect
>  to.
> 
> Cheers
> 
> Leo
> 

-- 
-----
Shlomi Fish   http://www.shlomifish.org/
"The Human Hacking Field Guide" - http://shlom.in/hhfg

Bzr is slower than Subversion in combination with Sourceforge. 
( By: http://dazjorz.com/ )


Test-Run 0.0120 - Now With Moosey Goodness

2009-08-06 Thread Shlomi Fish
Test-Run 0.0120 is now available from a CPAN mirror near you:

* http://web-cpan.berlios.de/modules/Test-Run/

* http://search.cpan.org/dist/Test-Run/

What is Test-Run?
-

Test-Run is an improved test harness for TAP based test streams. Originally 
forked from Test-Harness-2.x, it has been heavily modularised and extended, 
and was ported to use TAP-Parser. It has been split into a front-end, a back-
end, a prove-like script-in-a-module, all with several OOP classes, and has 
several optional plugins on CPAN for such things as colouring the output, 
using alternate interpreters for running the TAP scripts and trimming the 
displayed filenames. More plugins can be written.

What's new in this release?
---

The primary change was the Moosification of Test-Run, which made the code 
cleaner and more modern. Moreover, NEXT.pm was ditched in favour of the more 
modern MRO::Compat (which defaults to mro.pm in perl-5.10.x and above).  
YAML.pm was replaced with the faster and better YAML::XS . Finally, the 
META.yml was enhanced with resources and keywords.



Have fun!

    Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Interview with Ben Collins-Sussman - http://xrl.us/bjn8s

God gave us two eyes and ten fingers so we will type five times as much as we
read.


Re: looking for CPANTS (co-) maintainers

2009-07-02 Thread Shlomi Fish
On Monday 29 June 2009 23:03:00 Thomas Klausner wrote:
> Hi!
>
> See over there: http://use.perl.org/~domm/journal/39189

Hi Thomas!

Is this the reason that CPANTS was out-of-date for a long time? It seemed 
better yesterday, though.

Regards,

    Shlomi Fish

-- 
-----
Shlomi Fish   http://www.shlomifish.org/
"The Human Hacking Field Guide" - http://xrl.us/bjn8q

God gave us two eyes and ten fingers so we will type five times as much as we
read.


Re: "Fluent" tests?

2009-07-01 Thread Shlomi Fish
On Tuesday 30 June 2009 21:44:50 Michael Peters wrote:
> Ovid wrote:
> > use Test::Fluent 'no_plan';
> >
> > my ( $have, $want ) = ( 1, 1 );
> > have $have, want $want, reason 'Some test name';
> > have [ 3, 4 ], want [ 4, 5 ], reason 'cuz I said so';   # fails
> > true 3,  reason '3 had better be true';
> > false 3, reason '3 had better still better be true';# fails
>
> I would much rather see something like
>
> cmp_ok(
>have   => 1,
>want   => 2,
>reason => 'Some test name',
>diagnostic => { world => $world },
> );
>
> Much more Perlish. I've always disliked some APIs where it's not
> immediately clear what's a function call and what's an argument to that
> function: is reason() an argument to want() or have()?. It also seems more
> obvious for doing things like data-driven tests where you just have a large
> data structure that tests are run against.

I tend to agree with this. However, for my subroutines, I prefer to pass named 
arguments in a hash-ref, instead of clobbered into @_. So "mysub({%args})", 
and "my $args = shift;" rather than "mysub(%args)" and "my %args = shift;".

In any case, in my opinion, your proposal for syntax is saner than Ovid's 
proposed DSL.

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
http://www.shlomifish.org/humour/ways_to_do_it.html

God gave us two eyes and ten fingers so we will type five times as much as we
read.


Fwd: [sf-perl] Slides for "Evolving Tests"

2009-03-27 Thread Shlomi Fish

--  Forwarded Message  --

Subject: [sf-perl] Slides for "Evolving Tests"
Date: Thursday 26 March 2009
From: Fred Moyer 
To: San Francisco Perl Mongers User Group 

Big thanks to Jeff Thalhammer for the great talk on Wednesday evening.
 I've posted the slides:

http://bit.ly/11TJxs

Great to see a lot of enthusiasm at the meeting.  I think we are a
ways away from being able to take on a YAPC, but if we can keep the
momentum going, I think a workshop of some sort would be possible to
pull off.  Most of the Perl workshops are back east or in Europe, so
we could likely attract some attention with an SF Bay Area Perl
Workshop.

What would we need to make that happen?  Volunteers.  Regular meeting
attendees.  Running this group has taken more work than I anticipated.
 I never appreciated how much effort Quinn put into it until I took
the reins :)

Email me off list if you are interested in helping contribute to part
of the group operations.

Next meeting is April 28 (yeah I need to fix the meetup site, it shows
May right now).  Speaker will be David Lowe, an early SF.pm member.
Talk is "Half a dozen horrible uses for pack and unpack".  Hope to see
you there!

- Fred
___
SanFrancisco-pm mailing list
sanfrancisco...@pm.org
http://mail.pm.org/mailman/listinfo/sanfrancisco-pm

---
-- 
-----
Shlomi Fish   http://www.shlomifish.org/
Why I Love Perl - http://xrl.us/bjn88

God gave us two eyes and ten fingers so we will type five times as much as we
read.



Re: [PATCH] ExtUtils::MakeMaker and world writable files in dists

2008-11-13 Thread Shlomi Fish
On Thursday 13 November 2008, David Golden wrote:
> On Thu, Nov 13, 2008 at 3:39 AM, Shlomi Fish <[EMAIL PROTECTED]> wrote:
> >> What I was expressing is that the CPAN shell can do the twiddling to
> >> strip flags at the point of extraction, rather than PAUSE stopping it at
> >> the gate. Archive::Tar already does this (see
> >> $Archive::Tar::INSECURE_EXTRACT_MODE).
> >
> > Archive::Tar does, but Archive::Extract (which CPANPLUS uses) doesn't.
>
> It was a bug.  Addressed in 0.28 as a result of these discussions.
> The next non-development release of CPANPLUS will use the new
> Archive::Extract and close the security hole under discussion.
>

This bug still exists in Archive-Extract-0.28. See my comment at the end of:

http://rt.cpan.org/Ticket/Display.html?id=39554

One needs to also set $Archive::Tar::CHMOD .

Regards,

Shlomi Fish


-- 
-
Shlomi Fish   http://www.shlomifish.org/
Funny Anti-Terrorism Story - http://xrl.us/bjn7t

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


Re: [PATCH] ExtUtils::MakeMaker and world writable files in dists

2008-11-13 Thread Shlomi Fish
On Thursday 13 November 2008, Michael G Schwern wrote:
> Andreas J. Koenig wrote:
> >>>>>> On Wed, 12 Nov 2008 19:13:40 -0800, Michael G Schwern
> >>>>>> <[EMAIL PROTECTED]> said:
> >   >
> >   > Now that the CPAN shells and archiving modules are handling it at
> >   > their end, I think the PAUSE filter should be removed.  It's not
> >   > PAUSE's job to be the code police.
> >
> > It is 'tar xzf CPANFILE.tar.gz' which is exploitable. No CPAN shell
> > and archiving module involved.
>
> What I was expressing is that the CPAN shell can do the twiddling to strip
> flags at the point of extraction, rather than PAUSE stopping it at the
> gate. Archive::Tar already does this (see
> $Archive::Tar::INSECURE_EXTRACT_MODE).

Archive::Tar does, but Archive::Extract (which CPANPLUS uses) doesn't.

> The important distinction being that 
> it's done under the user's control and not by PAUSE fiat.  PAUSE shouldn't
> be playing security nanny or any other nanny.
>
> It's not even necessary or effective.  Because there's already a perfectly
> sensible and universal way to avoid this problem and that's to set your
> umask to something sensible.  Then no matter what the archive's internal
> permissions are set to they'll be stripped when it's extracted.

I already have a sensible umask. However, CPANPLUS ignores it and sets the 
permissions to be world-writable. See these bugs:

* http://rt.cpan.org/Ticket/Display.html?id=39516

* http://rt.cpan.org/Ticket/Display.html?id=39554

>
> Most systems already do this by default, because it's good security
> practice. If you don't have a umask set, that's a basic vulnerability *at
> the user's end*.  No amount of hand-holding from CPAN will protect the user
> without a umask.  Some other system will ship a world writable file or a
> setuid executable or something.  Then you're hosed all over again.
>
> We are trying to fix a basic, wide-spread, user-end security hole, one that
> is not at all specific to Perl, at too high a level and too specific a
> system.
>
> It's like plugging one hole in a screen door.

It's not necessarily a problem at the user-end, because CPANPLUS ignores the 
(secure) umask I set and still sets the permissions to 666 or 777.

Regards,

Shlomi Fish

-
Shlomi Fish   http://www.shlomifish.org/
http://www.shlomifish.org/humour/ways_to_do_it.html

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


Re: Apology. Re: Public Humiliation and Kwalitee

2008-10-27 Thread Shlomi Fish
On Friday 24 October 2008, Ovid wrote:
> Shlomi,
>
> Given what was said here and my own past statements on wanting to improve
> civility, I apologize to you (and publicly!) because regardless of my
> opinion of your email, I should not have copied the Perl-QA list on that. 
> It was very disrespectful of me.

Apology accepted, and no real harm done.

In any case, someone replied to me in private and told me that I should send 
such complaints/queries/etc. to the CPAN Testers' reporter first and if it 
fails, send it to [EMAIL PROTECTED] . So perl-qa won't be hearing 
from me about this again.

Regards,

Shlomi Fish

>
> Sincerely,
> Ovid
> --
> Buy the book - http://www.oreilly.com/catalog/perlhks/
> Tech blog- http://use.perl.org/~Ovid/journal/
> Twitter  - http://twitter.com/OvidPerl
> Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

-----
Shlomi Fish   http://www.shlomifish.org/
"The Human Hacking Field Guide" - http://xrl.us/bjn8q

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


Tested File-Find-Object-0.1.1 with Class::Accessor not installed

2008-10-23 Thread Shlomi Fish
Hi Chris!

These reports:

* http://www.nntp.perl.org/group/perl.cpan.testers/2008/10/msg2472650.html
* http://www.nntp.perl.org/group/perl.cpan.testers/2008/10/msg2473253.html

Have tested File-Find-Object without installing its Class::Accessor 
pre-requisite:


#   at t/01ffo.t line 9.
# Tried to use 'File::Find::Object'.
# Error:  Base class package "Class::Accessor" is empty.
#   (Perhaps you need to 'use' the module which defines that package 
first.) 
at 
/home/cpan/rel/conf/perl-5.6.2/.cpanplus/5.6.2/build/File-Find-Object-0.1.1/blib/lib/File/Find/Object/Base.pm
 
line 9



And:


Here is a list of prerequisites you specified and versions we 
managed to load:

  Module NameHave Want
! Class::Accessor   00


Please fix it on your end.

Regards,

Shlomi Fish

-----
Shlomi Fish   http://www.shlomifish.org/
First stop for Perl beginners - http://perl-begin.org/

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


http://www.nntp.perl.org/group/perl.cpan.testers/2008/10/msg2399796.html

2008-10-09 Thread Shlomi Fish
Hi!

In http://www.nntp.perl.org/group/perl.cpan.testers/2008/10/msg2399796.html it 
seems that you didn't install the Template.pm module and as a result 
HTML-Latemp-NavLinks-GenHtml is failing. I specifically require a version of 
it, but it wasn't made available for it.

Please fix your CPAN smooking setup.

Regards,

    Shlomi Fish

-----
Shlomi Fish   http://www.shlomifish.org/
Parody on "The Fountainhead" - http://xrl.us/bjria

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


Re: CPAN-YACSmoke-0.03_09 - http://www.cpantesters.org/show/CPAN-YACSmoke.html

2008-10-09 Thread Shlomi Fish
Hi Chris!

On Thursday 09 October 2008, Chris 'BinGOs' Williams wrote:
> On Thu, Oct 09, 2008 at 02:58:01PM +0200, Shlomi Fish wrote:
> > Hi all!
> >
> > Where does CPAN-YACSmoke-0.03_09 (reported here -
> > http://www.cpantesters.org/show/CPAN-YACSmoke.html) can be found? I
> > couldn't find it on kobesearch, s.c.o or ftp.cpan.org in the author's
> > directory.
>
> CPAN-YACSmoke-0.03_09 was something I was fiddling with. It was never an
> official release in any shape or form.
>
> The changes and fixes I made eventually got rolled into CPANPLUS-YACSmoke.

Thanks! CPANPLUS-YACSmoke does look better, and I converted my 
CPAN-Smoke-AutoSetup to use it.

In any case, I discovered a bug in it:


[EMAIL PROTECTED] ~]$ 
~/apps/perl-5.10.0/bin/perl -MCPANPLUS::YACSmoke -e 'test'[EMAIL PROTECTED] ~]$ 
~/apps/perl-5.10.0/bin/perl -MCPANPLUS::YACSmoke -e 'test()'
Undefined subroutine &main::test called at -e line 1.
[EMAIL PROTECTED] ~]$


"test" is not exported by default (nor with -MCPANPLUS::YACSmoke=:all). So the 
synposis at:

http://cpan.uwinnipeg.ca/htdocs/CPANPLUS-YACSmoke/CPANPLUS/YACSmoke.html

is misleading.

Its exports should be fixed.

Regards,

Shlomi Fish

-
Shlomi Fish   http://www.shlomifish.org/
Parody on "The Fountainhead" - http://xrl.us/bjria

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


CPAN-YACSmoke-0.03_09 - http://www.cpantesters.org/show/CPAN-YACSmoke.html

2008-10-09 Thread Shlomi Fish
Hi all!

Where does CPAN-YACSmoke-0.03_09 (reported here - 
http://www.cpantesters.org/show/CPAN-YACSmoke.html) can be found? I couldn't 
find it on kobesearch, s.c.o or ftp.cpan.org in the author's directory.

And why does a JavaScript on the page causes its test results to disappear?

And BTW, I couldn't find it on:

http://cpantesters.perl.org/show/CPAN-YACSmoke.html

Which is linked from:

http://cpan.uwinnipeg.ca/dist/CPAN-YACSmoke

Any help would be appreciated.

Regards,

Shlomi Fish

---------
Shlomi Fish   http://www.shlomifish.org/
Interview with Ben Collins-Sussman - http://xrl.us/bjn8s

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


Re: [PATCH] ExtUtils::MakeMaker and world writable files in dists

2008-09-30 Thread Shlomi Fish
On Monday 29 September 2008, Aristotle Pagaltzis wrote:
> * Cosimo Streppone <[EMAIL PROTECTED]> [2008-09-29 02:10]:
> > but it seems that gnu tar doesn't like the following:
> >
> >   $ tar --mode=0755 cvf blah.tar somedir
> >   $ tar c --mode=0755 vf blah.tar somedir
> >
> > and will only accept:
> >
> >   $ tar cvf blah.tar --mode=0755 somedir
> >
> > Could this work?
>
> GNU tar will, however, accept this:
>
> tar cv --mode=0755 -f foo.tar bar/
>
> BSD tar will also accept this placement of the `-f` flag,
> according to the man page. Other tars may not, though I don’t
> think that is very likely.
>
> However, the `--mode` switch is a GNU curiosity. No other tar
> that I checked does have it.
>
> Honestly, though, if you are using tar on Windows, I don’t know
> why you would want any other default. Patching EU::MM is the
> pragmatic approach, and we probably can’t avoid it, but I think
> it is the wrong place to fix this, still.
>

Wouldn't setting TAR_OPTIONS on Windows be a better solution?

http://www.linuxtopia.org/online_books/linux_tool_guides/tar_user_guide/using-tar-options.html

Regards,

Shlomi Fish

-
Shlomi Fish   http://www.shlomifish.org/
"The Human Hacking Field Guide" - http://xrl.us/bjn8q

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


Re: [RFC] Dealing with World-writable Files in the Archive of CPAN Distributions

2008-09-23 Thread Shlomi Fish
On Tuesday 23 September 2008, Eric Wilhelm wrote:
> # from Ovid
>
> # on Tuesday 23 September 2008 00:54:
> >Of course, even as Eric pointed out, a umask of 0002  still masks the
> > world writeable permissions, so I still don't see how you're getting
> > there and if you've configured your system to give *you* a umask of
> > 0022, then you still shouldn't be getting the warnings you're
> > getting.  I don't understand how this arose, but I'd be curious to
> > find out how.
>
> Me too.
>
> Shlomi, It looks like your tar is /bin/tar, so either TAR_OPTIONS is set
> in your environment or something else is weird.

{{{
[EMAIL PROTECTED] ~]$ echo "$TAR_OPTIONS"

[EMAIL PROTECTED] ~]$
}}}

>
> If you can do a 'look Data::Dump::Streamer' from your smoker user's cpan
> environment and 'ls -l Makefile.PL' from inside that shell. 

{
CPAN Terminal> z Data::Dump::Streamer

[MSG] Trying to 
get 'http://mirror.mirimar.net/cpan/authors/id/Y/YV/YVES/CHECKSUMS'
[MSG] Checksum matches for 'Data-Dump-Streamer-2.08-40.tar.gz'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/.patch'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/Changes'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/INSTALL.SKIP'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/lib/'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/lib/Data/'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/lib/Data/Dump/'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/lib/Data/Dump/Streamer/'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/lib/Data/Dump/Streamer/_/'
[MSG] 
Extracted 'Data-Dump-Streamer-2.08-40/lib/Data/Dump/Streamer/_/Printers.pm'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/lib/Data/Dump/Streamer.pm'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/Makefile.PL'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/MANIFEST'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/MANIFEST.SKIP'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/META.yml'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/README'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/Streamer.xs'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/as.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/blessed.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/dogpound.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/dump.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/filter.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/globtest.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/hardrefs.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/impure_madness.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/lexicals.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/locked.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/madness.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/madness_w.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/names.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/overload.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/readonly.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/refaddr.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/refcount.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/refelem.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/reftype.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/sortkeys.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/test_helper.pl'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/tree.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/usage.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/t/xs_subs.t'
[MSG] Extracted 'Data-Dump-Streamer-2.08-40/typemap'
[MSG] Extracted 'Data::Dump::Streamer' 
to '/home/cpan/.cpanplus/5.10.0/build/Data-Dump-Streamer-2.08-40'
[EMAIL PROTECTED] Data-Dump-Streamer-2.08-40]$ ls -l Makefile.PL
-rwxrwxrwx 1 cpan cpan 3792 2006-04-16 18:33 Makefile.PL*
}}}

> Then 
> run 'umask' or 'env' or something until you find out what is causing
> it.
>
> If I do that, I see -rwxr-xr-x, so no hole.
>
> Now, if it's using Archive::TAR, that's potentially a different thing.
>

~/apps/perl-5.10.0/bin/perl -MArchive::Tar -e 1 is successful and so it seems 
that I have Archive::Tar.

Regards,

Shlomi Fish

-
Shlomi Fish   http://www.shlomifish.org/
The Case for File Swapping - http://xrl.us/bjn7i

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


Re: [RFC] Dealing with World-writable Files in the Archive of CPAN Distributions

2008-09-23 Thread Shlomi Fish
On Tuesday 23 September 2008, Ovid wrote:
> --- On Tue, 23/9/08, Shlomi Fish <[EMAIL PROTECTED]> wrote:
> > The default Mandriva umask appears to be 0002 .
>
> That surprised me, so I googled "default mandriva umask".  All the
> references I found say the default umask is 0022 ... unless ...
>
> Mandriva offers a tool to control security settings.  It's called "Msec":
>
>   http://wiki.mandriva.com/en/Msec
>   http://is.gd/2Zzk
>
> Msec offers 7 security levels.  Level 0 ("The user should not be allowed to
> own a computer") is very insecure (not even a password), and Level 6 comes
> with its own tinfoil hat.  As it turns out, those different security levels
> correspond to different umasks, as detailed here:
>
>   http://www.brunolinux.com/07-Security/Mandriva_Security_Settings.html
>   http://is.gd/2Zzn
>
> The only levels which provide a default umask of 0002 are levels 0 and 1,
> both of which are *NOT* recommended, but if that's what you say your
> default is, I can only wonder how, exactly, you managed to get your system
> in that state.  (In fact, distributions generally default to level 3, which
> has a default umask of 0022.)

My /etc/sysconfig/msec reads:

{
UMASK_ROOT=022
SECURE_LEVEL=3
UMASK_USER=022
TMOUT=0
}

So it should be OK, but it's not. Even if I login from the console as a 
different user, for which I did not set the umask explicitly. I see he has a 
umask of 0002. Maybe it's the doing of one of the files in /etc.

>
> Of course, even as Eric pointed out, a umask of 0002  still masks the world
> writeable permissions, so I still don't see how you're getting there and if
> you've configured your system to give *you* a umask of 0022, then you still
> shouldn't be getting the warnings you're getting.  I don't understand how
> this arose, but I'd be curious to find out how.

OK. I'll investigate.

Regards,

Shlomi Fish

-
Shlomi Fish   http://www.shlomifish.org/
What Makes Software Apps High Quality -  http://xrl.us/bkeuk

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


Re: [RFC] Dealing with World-writable Files in the Archive of CPAN Distributions

2008-09-23 Thread Shlomi Fish
On Tuesday 23 September 2008, Eric Wilhelm wrote:
> # from Shlomi Fish
>
> # on Monday 22 September 2008 23:55:
> >> There would be no "mechanism" because tar respects the umask by
> >> default when invoked as a non-root user.  Thus, there are no
> >> world-writable files being unpacked from CPAN dists on my machine.
> >>
> >> Is a umask of 022 not the default setup?  Shlomi?
> >
> >The default Mandriva umask appears to be 0002 . I have the following
> > line in my default user's .bashrc:
> >
> >{{{
> >umask 022
> >}}}
>
> So, how are those files being created with world-writable permissions?

That's what my smoke configuration gives me in user "cpan".

> You are running smokes as this user or as root?  

I'm running smokes as a different user altogether (= "cpan") which still has 
the 0002 umask. I only explicitly set the umask to 0022 on user "shlomi", 
which is the user I'm doing most of my work in. 

> You are using tar or 
> something else?

See for yourself:

https://svn.berlios.de/svnroot/repos/web-cpan/CPAN-Smoke-AutoSetup/trunk/first-rev/

>
> Even with the 0002 it would only set the group write bit.
>

Interesting.

Regards,

Shlomi Fish

-
Shlomi Fish   http://www.shlomifish.org/
Stop Using MSIE - http://www.shlomifish.org/no-ie/

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


Re: [RFC] Dealing with World-writable Files in the Archive of CPAN Distributions

2008-09-22 Thread Shlomi Fish
On Tuesday 23 September 2008, Eric Wilhelm wrote:
> # from chromatic
>
> # on Monday 22 September 2008 17:37:
> >> Yes.  Would someone please explain to me how this issue is not
> >> already made a mostly non-issue by having a proper umask and running
> >> CPAN as non-root?
> >
> >If I were so inclined and had access to your machine, I could do a lot
> > of damage through such a mechanism without root access.
>
> There would be no "mechanism" because tar respects the umask by default
> when invoked as a non-root user.  Thus, there are no world-writable
> files being unpacked from CPAN dists on my machine.
>
> Is a umask of 022 not the default setup?  Shlomi?
>

The default Mandriva umask appears to be 0002 . I have the following line in 
my default user's .bashrc:

{{{
umask 022
}}}

Regards,

    Shlomi Fish

-
Shlomi Fish   http://www.shlomifish.org/
Understand what Open Source is - http://xrl.us/bjn82

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


Re: [RFC] Dealing with World-writable Files in the Archive of CPAN Distributions

2008-09-22 Thread Shlomi Fish
Hi all.

Note to "Securiteam": there's a link to the possible security problem report 
at the bottom.

On Monday 22 September 2008, chromatic wrote:
> On Monday 22 September 2008 08:41:31 Michael G Schwern wrote:
> > Shlomi Fish wrote:
> > > Let's suppose Makefile.PL is world-writable. While the distro is being
> > > unpacked, a malicious user writes something like:
> > >
> > > {{{
> > > system('rm -fr $HOME');
> > > }}}
> > >
> > > to it, and after you come to the "perl Makefile.PL" stage - you lose
> > > your home-directory. ;-)
> >
> > Run that by me again how the Makefile.PL being world-writable has any
> > effect on that?  If a Makefile.PL does an "rm -rf $HOME" and you run it,
> > it doesn't matter what permission flags are on the file.  Your home
> > directory is gone.
>
> There's a race condition attack between the time the CPAN client *writes*
> the world-writeable file and the time the CPAN client *executes* the
> world-writeable file.  During that time, anyone on the system can write
> anything to the file, replacing its legitimate and safe contents with
> malicious contents.
>
> That's completely orthogonal to the problem of the Build.PL/Makefile.PL
> containing malicious code.
>

Right. I decided that it was a major problem with how CPANPLUS handles such 
situations (regardless to whether we are smoking or just installing) and 
reported it here:

http://rt.cpan.org/Ticket/Display.html?id=39516

Please don't keep it more public than it is already until there's a good fix.

Regards,

Shlomi Fish

-
Shlomi Fish   http://www.shlomifish.org/
My Aphorisms - http://www.shlomifish.org/humour.html

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


Re: [RFC] Dealing with World-writable Files in the Archive of CPAN Distributions

2008-09-22 Thread Shlomi Fish
On Monday 22 September 2008, David Golden wrote:
> On Mon, Sep 22, 2008 at 8:40 AM, Shlomi Fish <[EMAIL PROTECTED]> wrote:
> > My suggestion for resolving this is to modify the smoking modules so,
> > after the archive is unpacked (with a proper umask and arguments to tar),
> > they will traverse the directory tree and look for any world-writable
> > files. If any are found, they will report the smoking of the module as
> > "FAIL", and delete the unpacked directory tree, without doing the "perl
> > Makefile.PL/Build.PL ..." dance.
>
> This isn't just a smoking problem, right?  A normal CPAN/CPANPLUS
> install would trigger the same warning?
>

Yes, it would.

> > We could give an option for doing this, if it bothers you. But I'm tired
> > of finding these files in the msec report and reporting them manually.
> >
> > Now I volunteer to implement this.
>
> I think that CPANTS is probably the better place for this kind of
> analysis, particularly because it's static and because the reason for
> the Kwalitee point is clear.  It sounds like exactly the kind of thing
> that fits among the core Kwalitee metrics.

Well, it does. However, hardly anyone pays any attention to CPANTS, and it's 
out there in the background, and hardly influences the general perception of 
the module. 

>
> There are some reasons I think that CPAN Testers is *not* the right
> place for this:
>
> * The CPAN Testers grades relate only to the ability to build/test a
> distribution.  Unless world writable files prevent that, FAIL or
> UNKNOWN are not appropriate

World-writable files are a security risk and the CPAN shell should refuse to 
test the distribution if they exist. A security conscious admin won't install 
such modules if they generate world-writable files. As such, one should not 
proceed to the build/test stage and fail immediately.

>
> * Someone would have to read the FAIL and pay attention to understand
> that the problem is a world-writable file (whereas it's obvious on
> CPANTS what the problem is)

Someone would have to read the FAIL report in any kind of failure. If we 
report at the top that it was caused by world-writable files then people 
would pay attention in case they didn't expect a failure.

>
> * CPAN::Testers is no longer notifying authors directly anyway
>

Actually, they do. I receive "CPAN Testers Daily Report"s in email every day, 
and am also subscribed to the RSS feed. I pay much less attention to the 
CPANTS.

Regards,

Shlomi Fish

-
Shlomi Fish   http://www.shlomifish.org/
What does "Zionism" mean? - http://xrl.us/bjn8u

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


[RFC] Dealing with World-writable Files in the Archive of CPAN Distributions

2008-09-22 Thread Shlomi Fish
Hi all.

Today, after I invoked my CPAN smoker for a while, I received another msec 
(Mandriva Security) report with many world-writable files in the CPAN 
distributions that were left unpacked under /home/cpan/.cpanplus . Among the 
gems there are:


/home/cpan/.cpanplus/5.10.0/build/Data-Dump-Streamer-2.08-40/Makefile.PL
/home/cpan/.cpanplus/5.10.0/build/Digest-JHash-0.05/Makefile.PL
/home/cpan/.cpanplus/5.10.0/build/Getopt-ArgvFile-1.11/Makefile.PL
/home/cpan/.cpanplus/5.10.0/build/HTML-Scrubber-0.08/Makefile.PL
/home/cpan/.cpanplus/5.10.0/build/Kephra-0.3.10.11/Makefile.PL
/home/cpan/.cpanplus/5.10.0/build/Readonly-1.03/Makefile.PL
/home/cpan/.cpanplus/5.10.0/build/OOTools-2.21/Makefile.PL


As I noted here - http://rt.cpan.org/Ticket/Display.html?id=39481 :


> * Why exactly are you reporting this?
>

Because msec reports it after I'm smoking CPAN.

> * What is the problem with world writeable files in a distro?

Let's suppose Makefile.PL is world-writable. While the distro is being
unpacked, a malicious user writes something like:

{{{
system('rm -fr $HOME');
}}}

to it, and after you come to the "perl Makefile.PL" stage - you lose
your home-directory. ;-)

In any case, Mandriva's msec warns about them, which bothers me.

>
> * What is your proposed remedy?

Make sure none of the files in the archive are world-writable.
}}}

My suggestion for resolving this is to modify the smoking modules so, after 
the archive is unpacked (with a proper umask and arguments to tar), they will 
traverse the directory tree and look for any world-writable files. If any are 
found, they will report the smoking of the module as "FAIL", and delete the 
unpacked directory tree, without doing the "perl Makefile.PL/Build.PL ..." 
dance.

We could give an option for doing this, if it bothers you. But I'm tired of 
finding these files in the msec report and reporting them manually.

Now I volunteer to implement this.

Regards,

Shlomi Fish

-----
Shlomi Fish   http://www.shlomifish.org/
What Makes Software Apps High Quality -  http://xrl.us/bkeuk

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


Re: CPAN Testers Daily Report

2008-09-20 Thread Shlomi Fish
Hi all!

Here's the CPAN Testers daily report I have got today. I have some questions 
regarding it.

On Saturday 20 September 2008, CPAN Tester Report Server wrote:
> Dear Shlomi Fish,
>
> CPAN Testers Notifications have changed. This mail now comes from a
> centralised server, and authors should no longer be receiving reports
> directly from testers. If you do receive reports, please ask the tester in
> question to update their version of Test-Reporter, which now disables the
> CCing to authors. Thanks.
>
> Please find below the latest reports for your distributions, generated by
> CPAN Testers, from the last 24 hours.
>
> Currently only FAIL reports are listed, with only the first instance of a
> report for a distribution on a particular platform, using a specific
> version of Perl. As such you may find further similar reports at
> http://www.cpantesters.org.
>
>
> Acme-CPANAuthors-Israeli-0.01:
> - i386-dragonfly-thread-multi-64int / 5.8.8 patch 34376:
>   - FAIL http://nntp.x.perl.org/group/perl.cpan.testers/2249796
> - i386-dragonfly-thread-multi-64int / 5.8.8:
>   - FAIL http://nntp.x.perl.org/group/perl.cpan.testers/2245013
> - i686-linux-thread-multi-64int-ld / 5.6.2:
>   - FAIL http://nntp.x.perl.org/group/perl.cpan.testers/2246011
> - i686-linux-thread-multi-64int-ld / 5.10.0:
>   - FAIL http://nntp.x.perl.org/group/perl.cpan.testers/2243437
> - i686-linux-thread-multi-64int-ld / 5.11.0 patch 34379:
>   - FAIL http://nntp.x.perl.org/group/perl.cpan.testers/2248253
> - i686-linux-thread-multi-64int-ld / 5.8.8:
>   - FAIL http://nntp.x.perl.org/group/perl.cpan.testers/2243516
>

Acme-CPANAuthors-Israeli version 0.01 was heavily broken, and I:

1. Already released version 0.0102

2. Deleted the previous versions from the CPANPerl QA  using 
PAUSE.

I don't understand why I'm still getting reports for it, when there are 
already more updated packages.

>
> IO-Socket-INET6-2.54:
> - i686-linux / 5.11.0 patch 34379:
>   - FAIL http://nntp.x.perl.org/group/perl.cpan.testers/2247432
>
>
> CPANPLUS-Dist-Fedora-0.0.2:
> - i686-linux-thread-multi-64int-ld / 5.6.2:
>   - FAIL http://nntp.x.perl.org/group/perl.cpan.testers/2246029

This is also broken, but there's a new version. Why am I getting reports for 
it, too?

Regards,

Shlomi Fish

-
Shlomi Fish   http://www.shlomifish.org/
What does "Zionism" mean? - http://xrl.us/bjn8u

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


World-writable files in CPAN Distributions

2008-09-06 Thread Shlomi Fish
Hi all,

I'm smoke-testing the CPAN distributions using CPAN::YACSmoke, in an 
under-privileged user. Now I'm using Mandriva Cooker and have msec running, 
and, as a result, am getting warnings that I have world-writable files in the 
directories where the CPAN modules were built:


Security Warning: World Writable files found :
- /home/cpan/.cpanplus/5.10.0/build/Acme-EyeDrops-1.54/Changes
- /home/cpan/.cpanplus/5.10.0/build/Acme-EyeDrops-1.54/LICENSE
- /home/cpan/.cpanplus/5.10.0/build/Acme-EyeDrops-1.54/MANIFEST
- /home/cpan/.cpanplus/5.10.0/build/Acme-EyeDrops-1.54/META.yml
- /home/cpan/.cpanplus/5.10.0/build/Acme-EyeDrops-1.54/Makefile.PL
- /home/cpan/.cpanplus/5.10.0/build/Acme-EyeDrops-1.54/README
 .
 .
 .
- /home/cpan/.cpanplus/5.10.0/build/HTML-Scrubber-0.08/Changes
- /home/cpan/.cpanplus/5.10.0/build/HTML-Scrubber-0.08/LICENSE
- /home/cpan/.cpanplus/5.10.0/build/HTML-Scrubber-0.08/MANIFEST
- /home/cpan/.cpanplus/5.10.0/build/HTML-Scrubber-0.08/MANIFEST.SKIP
- /home/cpan/.cpanplus/5.10.0/build/HTML-Scrubber-0.08/META.yml
- /home/cpan/.cpanplus/5.10.0/build/HTML-Scrubber-0.08/Makefile.PL
- /home/cpan/.cpanplus/5.10.0/build/HTML-Scrubber-0.08/README
 .
 .
 . 


Some of these are -rw-rw-rw permissions in the .tar archive, but some are also 
files that are made world-writable by running code. Here are some of my bug 
reports:

* http://rt.cpan.org/Ticket/Display.html?id=39038

* http://rt.cpan.org/Ticket/Display.html?id=39037

* http://rt.cpan.org/Ticket/Display.html?id=39035

I would like to brainstorm about possible ways to deal with this problem.

Regards,

    Shlomi Fish

-----
Shlomi Fish   http://www.shlomifish.org/
Stop Using MSIE - http://www.shlomifish.org/no-ie/

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


Re: "FAIL Error" - please fix your smoker configuration

2008-09-05 Thread Shlomi Fish
Hi!

On Thursday 04 September 2008, David Golden wrote:
> On Thu, Sep 4, 2008 at 4:56 AM, Shlomi Fish <[EMAIL PROTECTED]> wrote:
> > "-j2" is invalid for ./Build and you shouldn't use it with it.
> > Alternatively, you can use "perl Makefile.PL ; make ; ", etc., which is
> > also supported by the Error distribution.
> >
> > But as it stands, you're giving many false positives.
>
> FYI, that's a CPAN.pm bug:
>
> http://rt.cpan.org/Public/Bug/Display.html?id=32823
>

Thanks for letting us know.

> Fixed in CPAN 1.92_57.
>
> I strongly encourage testers to upgrade to a recent CPAN dev version
> if you're going to use "-jN" flags.
>
> I've added the need to detect and discard that case to the
> CPAN::Reporter TODO list.
>

Thanks again.

Regards,

Shlomi Fish

-
Shlomi Fish   http://www.shlomifish.org/
Funny Anti-Terrorism Story - http://xrl.us/bjn7t

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


"FAIL Error" - please fix your smoker configuration

2008-09-04 Thread Shlomi Fish
Hi!

In regards to:

http://www.nntp.perl.org/group/perl.cpan.testers/2008/09/msg2127117.html

It is obvious that you try to run ./Build like this:


shlomi:~/progs/perl/cpan/Error/trunk/module$ ./Build -j2
No action '-j2' defined, try running the 'help' action.


"-j2" is invalid for ./Build and you shouldn't use it with it. Alternatively, 
you can use "perl Makefile.PL ; make ; ", etc., which is also supported by 
the Error distribution.

But as it stands, you're giving many false positives.

Regards,

Shlomi Fish

-----
Shlomi Fish   http://www.shlomifish.org/
"The Human Hacking Field Guide" - http://xrl.us/bjn8q

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam


Slightly OT: "What Makes Software High-Quality?"

2008-05-06 Thread Shlomi Fish
Hi!

I wrote a new essay about what makes software high-quality:

http://www.shlomifish.org/philosophy/computers/high-quality-software/

Any comments would be welcome. Licence is the CC-by-2.5 (or any later version 
of it).

Regards,

Shlomi Fish

-
Shlomi Fish   http://www.shlomifish.org/
Understand what Open Source is - http://xrl.us/bjn82

The bad thing about hardware is that it sometimes work and sometimes doesn't.
The good thing about software is that it's consistent: it always does not
work, and it always does not work in exactly the same way.


Re: TAP YAML Diagnostics

2008-04-07 Thread Shlomi Fish
On Monday 07 April 2008, Aristotle Pagaltzis wrote:
> * Eric Wilhelm <[EMAIL PROTECTED]> [2008-04-06 18:45]:
> > (perhaps allow non-first numbers too?) /^[a-z][a-z0-9_]*$/ ?
>
> ++
>
> Preceding the key with an underscore or some kind of squiggle
> should be enough to make it safe. Having ToWrite AllPrivateKeys
> InStudlyCaps OR_EVEN_SHOUT_THEM_IN_FULL_CAPITALISATION would get
> terribly old very quickly.

I second that suggestion.

Regards,

Shlomi Fish

-----
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

I'm not an actor - I just play one on T.V.


Re: Changing the focus of the chronic CPAN problem

2008-04-05 Thread Shlomi Fish
On Saturday 05 April 2008, Andy Lester wrote:
> On Apr 5, 2008, at 1:34 PM, Shlomi Fish wrote:
> > Thanks for the comments. See below for my response. It will be a
> > rather
> > stream-of-consciousness thing, but I hope something can come up of it.
>
> I've expanded my original comments here:
> http://perlbuzz.com/2008/04/rethinking-the-interface-to-cpan.html
>

Overall it's a good summary. I have some comments, but I'll comment later. 
Meanwhile I've set up the wiki pages as promised:

http://perl.net.au/wiki/Finding_a_Module_on_CPAN/Module-Rank

The reason I'm using perl.net.au instead of the Perl 5 Wiki is that:

1. I feel that MediaWiki is more suitable for such brainstorming and massive 
editing due to the fact it has a better diff-based feed; a dedicated 
discussion page; the less AJAXy editing interface which I feel is a good 
thing in this case; and the fact that one can easily edit a sub-section of 
the page.

2. We can always move it to somewhere else at a later stage.[1]

{{
[1] - Legal and licensing issues put aside of course, but I hereby proclaim 
that the licensing by any contributors will remain compatible. We can say 
it's Public Domain (Creative Commons, etc.) or MIT X11 for the sake of the 
argument. In any case, arguing about the licence is counter-productive.
}}

So be bold and edit. There are some other pages I have in mind, but let's have 
something we can play with on a wiki. It's possible that this pair of 
discussions are going to take enough energy of the Perl mongers who will have 
to read through them after the weekend (or the Sabbath). I'm not saying it's 
not important just that such long and similar discussions tend to get 
annoying.

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

I'm not an actor - I just play one on T.V.


Re: Changing the focus of the chronic CPAN problem

2008-04-05 Thread Shlomi Fish
the-whole-world-will-be-better" schemes.

3. It should make a judicial choice based on as many different relevant 
factors as possible.

4. It should be the first thing that people look for.

5. Other parameters that I'm forgetting.

---

For example, the CPANTS Kwalitee metric, if set, is usually very good 
indicator of a module's quality. That's because I assume that if it has a 
full or close to full kwalitee, then the author has:

1. Updated it recently.

2. Probably intends to support it into the future.

I admit that in the CPANTS game, I often just increased my kwalitee by 
relatively superficial means. But at least it means I'm still alive and 
kicking and care enough about the module to release a new version.

Now the number of open bugs is a poor indicator. If a module has no bugs, 
either the author is very diligent and handles all of them, or perhaps no one 
uses the module. On the other hand if it has a lot of bugs, it obviously 
means quite a few people are using it, but it also may mean that despite it 
it is incredibly.[1]

[1] - For example, XML::Simple is very popular, but I find its concept and way 
of implementation broken-by-design, and have a policy against helping people 
with problems with it. 

So we need to be a bit smart. I think adding some (optional) meta-data to the 
META.yml for categories, tags and for some flags or a status indicator saying 
things like "deprecated", "don't use", "in deep maintenance mode", "under 
development", "API is not frozen", etc. would be a step in the right 
direction.

I can try filing an RFC about it for the META.yml spec and implementing it 
into Module::Build, etc. And there could be a Kwalitee metric that the author 
set these flags.

What other parameters can we think of?

1. Last update date - doesn't mean it's not good (see 
http://perl.plover.com/yak/12views/samples/notes.html#sl-9) , but usually a 
good one.

2. Average activity over time. (How many releases and how frequently).

3. Kwalitee metric.

4. CPAN Testers (?).

5. Number of incoming references/dependecies in (WWW, CPAN, etc.) - 
PageRank-like.

6. CPAN Ratings/Reviews.

7. Test coverage.

8. Author tagging/categorising/marking.

9. User-contributed tagging/categorising/marking.

I'm not sure if there's one metric we can rely on exclusively. It probably 
needs to rely on many factors. (Just like Google relies on many factors and 
heuristics). I don't think there's a single "Aha!" silver bullet, but we just 
need to be very smart.

Now Freshmeat.net has a similar problem, but I'm not sure if they solved it 
too well in their search.

Nevertheless I think it's encouraging that CPAN has become so full of good 
modules (because like Andy Lester noted, it's also so full of junk) that we 
now worry about how to find them. Many languages have a problem of lacking 
such good APIs and abstractions in the first place, or that they are 
scattered across many places, and lack the comprehensiveness of CPAN.

I think CPAN faces the same problem that the web faced a few years ago before 
Google - how to find good and relevant information in a lot of low-quality 
one. This means we have a lot of good and bad "information", where that 
information is code.

Anyway, I'll probably set up a wiki page about it, so we can brain-storm more 
easily.

Hopefully we can make this CPAN-Rank happen.

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

I'm not an actor - I just play one on T.V.
* Abstract

* Introduction:
- The fc-solve-discuss thing.
- "industrial strength" Freecell solvers
- I'm not going to discuss what makes a software "industrial strength",
"enterprise-grade", etc., but rather will discuss what makes it
high quality.
- What's high-quality?
- hard to define.
- Good software.
- that most people like or advocate.
- that "just works".
- often has a lot of FUD or written badly, but at the end of the
day, it's what most people use or are even told to use.
- Software that is of exceptional quality:
- Vim
- Subversion
- gcc
- perl
- Note about python
- Note about Ruby
- bad online documentation
- no internal UTF-8 support.
- slow
- Note about PHP
- KDE
- Note about GNOME

* Parameters for Quality:
+ - The software is available for download or buying.
+ - The software has a version number in the archive, or package.
+ - The software has a homepage.
+ - An SF.net /project/mysoft/ pa

Re: Idea: CPAN Category Reviews

2008-04-05 Thread Shlomi Fish
On Saturday 05 April 2008, Guy Hulbert wrote:
> On Sat, 2008-05-04 at 15:16 +0300, Shlomi Fish wrote:
> >  one
> > paragraph summary then:
> >
> > <<<<<<<<<<<<
> > I suggest having a feed of human readable (and possibly machine
> > readable)
> > reviews of the modules in various CPAN categories, as an indication of
> > which
> > modules are recommended and when and which are not.
>
> already exists ( cpan-testers ? ).
>

I don't see it existing. All cpan-testers do is fetch the module from the CPAN 
(sometimes very old ones), and make sure they pass all tests (if they exist), 
and can be installed. They don't say how otherwise good the module is. A test 
coverage may give you better indication of how good the quality of the module 
is, but it may still be high-quality code implementing "low-quality"[1] 
semantics. 

[1] - for some value of low-quality.

What I suggest is a way for individuals (and the community as a whole) to say 
out of the various XML-processing/OOP-frameworks/Web-frameworks/etc. $X, $Y 
and $Z are good but different in the following aspects, $T, $S, $R are not 
recommended but still maintained, and $A, $B and $C should be avoided.

> Ok.  Snark aside, let's look at your list:
>
>  1. Maintained by CPAN admins.
>  2. If not XML then YAML.
>  3. Format for category reviews rather than categorization.
>  4. Perhaps (see above) ... allow authors.
>
> These are all questions about HOW someone (who?) is going to improve
> something and at certain people's expense (1 CPAN admins, 4 CPAN
> authors).
>
> I think it is better to start with WHAT are the problems with CPAN (and
> perl).  Make the list as short as possible.  Pick the most important
> one.  DO something about it.
>
> So, what are the problems ?  Here is what I see:
>
>   a) It is not sufficiently easy to find useful modules.
>   b) There are several ways to create modules[1].
>   c) Existing documentation is contradictory.
>

I think a) is the most important problem which I'm trying to address. I'll 
repharse as also that it's not sufficiently easy to find whether a given 
module is "good" (of any of the aspects of good), or what is generally 
recommended, or what most people are using, or what has been deprecated, or 
what should not be used except for legacy, etc. etc. You get the idea.

I don't see b) as a problem. I'm using Module::Build and am happy with it. 
EU::MM is still maintained because it was the original and people still 
depend on it. Some people claim M::B is not good. Module::Install has a 
different philosophy than either EU::MM or M::B, and some people prefer it 
this way.

As for c) - which existing documentation? CPAN Meta-documentation? The 
documetnation of the individual modules and distributions themselves? Can you 
point to any proof that this is the case? How is it contradictory?

> [1] At least:
>   Module::Build
>   Module::Install
>   ExtUtils::MakeMaker
>
> I think (a) is the most important problem to solve.
>

So do I.

> Concisely, I think the best solution is to add some restrictions at the
> upload interface.  To be consistent with TMTOWTDI, these would not
> prevent modules from being uploaded but not following them would result
> in making the module more obscure (see 3 catgories below).

Hmmm do you suggest it would be omitted from search.cpan.org searches?


>
> One way, I have though this could be done is to create cpanp.org or
> cpan6.org (the latter is on the todo list for perl6 ;-)

Right, but from what I understood CPAN6 is not limited to Perl 6 (and possibly 
not limited even to Perl.)

> and import all 
> of CPAN into the new system ... but that might annoy people or worse,
> get you ignored.  So a better way would be to clone cpan.org, add the
> new upload feature, import some modules into it and see what people
> think.  Make it work and minimize the changes and I'm sure you would
> have people (see 4 above) request the CPAN admins (see 1 above) upgrade.
>
> It still looks like a big job to me.
>

A new CPAN... isn't it the chicken-and-the-egg problem? If people know they 
won't be able to find most "obscure" modules on NewCPAN, why should they go 
there instead of OrigCPAN? They probably won't.

> === details ===
>
> I actually had to stretch a bit to get (b) and (c) since they are things
> that I have found but have not been discussed in detail since I have
> been on the list.  I think to some degree that (a) is the cause of (b)
> and (c).  Also, (b) is not a problem on its own but it seems that this
> is one area that the authors involved seem to agree that there should be
> some convergence rather than divergence.
>

Re: Idea: CPAN Category Reviews

2008-04-05 Thread Shlomi Fish
Hi!

Thanks for your email.

On Saturday 05 April 2008, Guy Hulbert wrote:
> On Sat, 2008-05-04 at 14:02 +0300, Shlomi Fish wrote:
> > Hi all!
> >
> > In regards to the previous discussion about trimming down CPAN and
> > finding
>
> I don't think trimming is necessary if you are successful with this.
> IMO the problem is just finding things, which your proposal addresses.

I also don't think trimming is necessary, though a voluntary marking modules 
as "deprecated", "unmaintained", etc. may be nice. I believe CPAN-Forum's 
tags (see http://www.cpanforum.com/tags/ ) are a partial solution to the 
problem, but there should also be a way for a maintainer to conclusively tag 
the status of his module as such.

>
> > better ways to find quality modules, I got an idea of making CPAN
> > "category" reviews. The idea was originally derived from Freshmeat.net
> > where they often
>
> [snip]
>
> > etc. he should note it. Now that I think about it, it may be a good idea
> > to also define a machine-readable format (XML etc.) for the conclusions
> > (possibly more) so they can be processed by the various CPAN interfaces.
>
> not XML ... there already seems to be a format, viz:
>   .cpan/sources/
>   authors/01mailrc.txt.gz
>   modules/02packages.details.txt.gz
>   modules/03modlist.data.gz
>
> so you could add:
>   modules/04categories.gz
>

Well now we end up with the following extra questions:

1. Is this something that should be centrally maintained by the CPAN admins? 
Or can it be a side service?

2. If not XML, then YAML or something else? I don't have a lot of problems 
with XML for many things (especially if I want to write free-form text with 
tags in it)[1], but sometimes a different format would be preferable. In any 
case, I'd like the containing format to be extensible, so that would probably 
leave out most ad-hoc custom formats.

3. I was talking about a format for the category reviews, not the 
categorisation. By all means, I don't want the category reviews themselves to 
be distributed as meta-data along with the rest of CPAN.

Since a category review also contains a lot of free form text, possibly with 
markup, it makes more sense to use XML than YAML or JSON. At least to me.

4. Perhaps it would be a good idea to allow authors to categorise their 
modules using PAUSE or the META.yml. We could use something like 
Freshmeat.net's TROVE categoricalisation - http://freshmeat.net/browse/18/ - 
or we can simply let them put arbitrary tags and/or categories into the 
modules.

Naturally, this depends on authors actually taking the extra effort to do so, 
but this is true of many other CPAN quality indicators.

> you'd also need a web interface at cpan.org
>

Or elsewhere.


> [snip]
>
> > So what do you think - is there an interest in this?
>
> Sure.  Can you write something more concise, and definite.  That would
> make it easier to discuss.

Why do you feel my previous email was not concise or definite? I admit it was 
a sort-of brainstorming email, but it was not too long. If you want a one 
paragraph summary then:

<<<<<<<<<<<<
I suggest having a feed of human readable (and possibly machine readable) 
reviews of the modules in various CPAN categories, as an indication of which 
modules are recommended and when and which are not.
>>>>>>>>>>>>

That's even one choice.

>
> > I'm attaching here a list of OOP modules I found on CPAN (probably not
> > fully
>
> That's a good choice for an example (again, IMO).
>

Thanks!

Regards,

Shlomi Fish

[1] - the whole argument that XML is basically just S-expressions in desguise 
is quite silly, in my opinion. We might as well argue that every data can be 
encoded as 1's or 0's, or that we can write any program using NAND gates. 
Both of these claims are correct, but they still miss the point.

What do you find clearer:

Hello Guy Hulbert! Today is Saturday

Or:

(body "Hello" ((b :id "name") "Guy Hulbert") "! Today is "
((b :id "day") "Saturday"))

Likewise, S-expressions are more suited for writing Lisp code in than XML 
markup is. Syntax, no matter how superficial people believe it is, is still 
very important.


-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

I'm not an actor - I just play one on T.V.


Idea: CPAN Category Reviews

2008-04-05 Thread Shlomi Fish
Hi all!

In regards to the previous discussion about trimming down CPAN and finding 
better ways to find quality modules, I got an idea of making CPAN "category" 
reviews. The idea was originally derived from Freshmeat.net where they often 
have category reviews of the various software hosted there:

http://themes.freshmeat.net/articles/section/category%20reviews/

Now I thought of importing that idea for CPAN. What we will do is have a 
certain blog (possibly on perl-buzz or Perlc.com or somewhere else) where 
occasionally someone takes upon himself a certain subject (e.g: templating 
systems, date/time modules, web frameworks, OOP modules or testing modules), 
review all of the modules (if possible) or the main contenders, and reach a 
certain conclusion or recommendation. Often there will be modules for 
orthogonal purposes, or trade-offs (e.g: Template Toolkit vs. Text::Template 
vs. HTML::Template, which have very different philosophies), and they'll need 
to state their pros-and-cons and reach a conclusion.

Naturally, if there are modules that are buggy, unmaintained, not recommended, 
etc. he should note it. Now that I think about it, it may be a good idea to 
also define a machine-readable format (XML etc.) for the conclusions 
(possibly more) so they can be processed by the various CPAN interfaces.

Later on, there could be back-links from search.cpan.org/kobesearch back to 
the appropriate reviews on the category reviews, similar to the fact that 
Freshmeat has "this project was mentioned in this article, etc.".

After the demise and depreciation of the CPAN registered modules list (I can 
no longer find the URL on http://www.cpan.org/ but it was horribly 
out-of-date and misleading anyway), it is acceptable that a better human 
review of the links could be a good idea.

What I suppose is that the category reviews should not be published 
immediately and should be given to peer review by a forum (like a mailing 
list) dedicated for it. While the review itself should only be written by a 
very limited number of people[1], the more people review the article before 
it is published and comment, the better.

So what do you think - is there an interest in this?

I'm attaching here a list of OOP modules I found on CPAN (probably not fully 
encompassing, and any addition will be welcome) which I intended to write a 
category review for on Perl.com. (But from what I understood from my editor 
it was rejected). It's not much, but it's a start.

Regards,

Shlomi Fish




This is the summary for the article about modules for facilitating
Object Oriented Programming in Perl.

* Accessors:

* Class::Accessor
- Class::Accessor::Fast.
- Class::Accessor::Chained.
- Class::Accessor::Ref
* more.
* http://search.cpan.org/dist/Object-AutoAccessor/
- Using AUTOLOAD.
* http://cpan.uwinnipeg.ca/dist/Class-Field
- by Ingy
* http://cpan.uwinnipeg.ca/dist/Attribute-Property
- by Juerd
* Object-Tiny
- by Adam Kennedy - extremely minimalistic.

* Class::Data::Inheritable
- http://cpan.uwinnipeg.ca/dist/Class-Data-Inheritable
- Class::Data::Inheritable::Translucent
- http://cpan.uwinnipeg.ca/dist/Class-Data-Inheritable-Translucent

* Method generators:

* Class::MethodMaker
* Class::MakeMethods
* Class::BuildMethods


* Utility modules:

* Delegation:
- http://cpan.uwinnipeg.ca/dist/Class-Delegator
- Class::Delegate
- http://cpan.uwinnipeg.ca/dist/Class-Delegation

* Class::Multimethods.

* NEXT
* Class::C3

* Roles/Traits
* Class::Trait
* Class::Roles
* http://cpan.uwinnipeg.ca/dist/mixin
* http://cpan.uwinnipeg.ca/dist/Perl6-Roles

* Introspection:
* http://search.cpan.org/dist/Class-Inspector/

* Object systems:

* Moose.
- Class::MOP
* Class::Std.

* Class::Contract
- http://cpan.uwinnipeg.ca/dist/Class-Contract

* Prototype-based OO
- Self, JS, IO
* Class::Prototyped
* CGI::Prototype
* Class::Classless

* Spiffy
- Class::Spiffy

* Aspect Oriented Programming.

* Aspect.pm

* OO Testing.

* Test::Unit.
* Test::Class.

* OO Exceptions

- Error.pm
- Exception::Class
- http://search.cpan.org/dist/Class-Throwable/



-----
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

I'm not an actor - I just play one on T.V.


Re: Find all the modules 'use'd in a directory

2008-02-08 Thread Shlomi Fish
On Friday 08 February 2008, Dominique Quatravaux wrote:
> Andy Lester wrote:
> > First, install ack, either installing App::Ack or downloading the
> > standalone version from http://petdance.com/ack/
>
> Interesting. Would you be so kind as to implement "grep -n"-style output
> format for us Emacs users?
>

ack outputs line numbers by default. If you're interested in Emacs 
integration, see:

http://perladvent.pm.org/2006/5/

(Search for "Emacs".)

Note that this is a cut-and-paste-and-modify of an existing XEmacs Elisp code. 
I couldn't figure out a better way to do it.

Regards,

Shlomi Fish

-----
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

I'm not an actor - I just play one on T.V.


Re: Searching CPAN repositories in a chain

2007-10-05 Thread Shlomi Fish
Hi Matisse!

First of all, don't start new threads by replying to existing messages. Write 
a new message to perl-qa@perl.org

On Friday 05 October 2007, Matisse Enzer wrote:
> I'd like to be able to;
> check mirror-list-number-one (probably all private, inside our
> firewall)
> check mirror-list-number-two
> and so on, for each thing that is being installed, including
> dependencies.
>
> This will allow having a local CPAN that contains locally created
> stuff, and specific versions of public modules, but allows for using
> public CPAN repositories for modules not available in the private repos.
>
> Does anyone else want this?

Yes, I also want secondary CPANPLUS repositories, so people can set up their 
own in-house repositories for in-house code, or that people can set up 
entirely new CPAN-like networks.

>
> Does this exist?
>

Not that I'm aware of.

> Shall I patch CPAN or CPANPLUS?
>

That would be nice. I intended to do it myself for quite some time, but did 
not get to it.

Regards,

Shlomi Fish

> Shall I just have a drink and be quiet?
>
> -M
>
>
> ---
> Matisse Enzer <[EMAIL PROTECTED]>
> http://www.matisse.net/  - http://www.eigenstate.net/



-- 

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

If it's not in my E-mail it doesn't happen. And if my E-mail is saying
one thing, and everything else says something else - E-mail will conquer.
-- An Israeli Linuxer


Re: .t files as specs

2007-06-19 Thread Shlomi Fish
On Tuesday 19 June 2007, Mike Malony wrote:
> So I'm working my project, and I've got one other more junior coder with
> me.
>
> Has anyone tried writing test files as part of their spec's?
>
> An overview document would also be needed, and some time walking through
> the expected testing.  But it sure would be setting clear expectations.
>
> Comments?
>

Well, generally the Test-Driven Development (TDD) methodology encourages 
writing individual test assertions, seeing them fail and then fixing the 
current source to have them pass. And repeat.

I find that writing too much testing code at once without having a working 
code, and then trying to get it to pass incrementally (using TODO or SKIP or 
similar functionality), is sub-optimal. 

Eventually, when you finish coding an application the TDD way, then your tests 
serve as specification for the code. However, writing a large amount of 
testing code, before you have any working code, is not such a good idea, 
because many of the testing code will have bugs (and may not even compile), 
and it would be relatively hard to fix it incrementally.

I prefer the incremental write-test -> get-the-test-to-pass -> repeat cycle.

If you're planning on writing a comprehensive specification at once, then 
while demonstration code would be useful to illustrate the point, it should 
still probably be expected to contain bugs, etc. and not be runnable as is. I 
suggest you write your real tests incrementally in a TDD way.

Regards,

Shlomi Fish

-----
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

If it's not in my E-mail it doesn't happen. And if my E-mail is saying
one thing, and everything else says something else - E-mail will conquer.
-- An Israeli Linuxer


Testing Using Scripts that are Installed by the Dependent Modules

2007-06-14 Thread Shlomi Fish
Hi all!

In this report:

http://www.nntp.perl.org/group/perl.cpan.testers/2007/06/msg508523.html

I receive the following errors for one of my modules, which is a Test-Run 
plugin:

{{{
t/00-load...# Testing Test::Run::Plugin::ColorFileVerdicts 0.0101, 
Perl 5.008008, /home/chris/perl588/bin/perl
ok
t/01-runok
t/02-cmdline-run
#   Failed test 'ok is colored'
#   at t/02-cmdline-run.t line 56.
# $trap->stdout() is
# $trap->stderr() is
# Can't exec "runprove": No such file or directory at t/02-cmdline-run.t line 
46.

#   Failed test 'ok is colored in a different color'
#   at t/02-cmdline-run.t line 74.
# $trap->stdout() is
# $trap->stderr() is
# Can't exec "runprove": No such file or directory at t/02-cmdline-run.t line 
64.

#   Failed test 'ok is colored in a different color'
#   at t/02-cmdline-run.t line 92.
# $trap->stdout() is
# $trap->stderr() is
# Can't exec "runprove": No such file or directory at t/02-cmdline-run.t line 
82.
# Looks like you failed 3 tests of 3.
}}}

As you can see the "runprove" utility (that is installed as part of 
Test-Run-CmdLine, which is a dependency of that plugin), could not be 
executed for some reason. My guess is that its installation path was not in 
$ENV{PATH}.

So my questions are:

1. Shouldn't the path where the scripts and executables are installed should 
be configured before CPANPLUS.pm or CPAN.pm are invoked for installing the 
modules as part of the smoking? Isn't it a bug at their end?

2. Should I somehow convert the command line invocation to a command line 
application disguised as a module (e.g: <>), so I'll avoid such problems in the future?

Regards,

Shlomi Fish


-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

If it's not in my E-mail it doesn't happen. And if my E-mail is saying
one thing, and everything else says something else - E-mail will conquer.
-- An Israeli Linuxer


Re: CPANTS reports in e-mail

2007-05-31 Thread Shlomi Fish
On Thursday 31 May 2007, Andy Armstrong wrote:
> On 31 May 2007, at 08:28, Eric Wilhelm wrote:
> > Wouldn't it would be interesting if there were a multiplexing service
> > for this sort of thing?  E.g. maybe a system that allows you to
> > subscribe to a personal mailing list of sorts in much the same way
> > that
> > you can get an rss feed for a given rt query.  Cue debate over push vs
> > pull.
>
> I'm sure RSS is the way to go - at least as an option. No problem
> with opting in / opting out / loosing stuff in their spam filter.

Sounds good to me, although an email feature will also be nice (though there's 
always rss2email or a different RSS to email gateway).

I should note that like Gabor said I'd like this feature to be opt-in, because 
I don't want it. I don't care too much about the CPANTS so-called "kwalitee", 
although sometimes when I'm bored, I raise the kwalitee of some of my 
modules. Still, I see it as just a silly game, and not really an indication 
of quality.

But Gabor's idea is good.

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

If it's not in my E-mail it doesn't happen. And if my E-mail is saying
one thing, and everything else says something else - E-mail will conquer.
-- An Israeli Linuxer


Re: Wiki spam #3

2007-05-04 Thread Shlomi Fish
Hi Andy!

On Friday 04 May 2007, Andy Armstrong wrote:
> On 4 May 2007, at 15:54, Andy Armstrong wrote:
> > Can anyone who has any objections or who knows more about the
> > current hosting arrangements than me please speak now. If I hear
> > nothing I'm going to set up a new Mediawiki installation and import
> > the current QA wiki into it.
>
> Ok, it's here:
>
> http://perl-qa.hexten.net/wiki/index.php
>
> I've imported the user pages but not the accounts - so you'll need to
> register again and hopefully it won't barf on the fact that your user
> page already exists.
>

It didn't for me. I'm now registered there. :-)

Thanks for that! Andy++.

Regards,

    Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

If it's not in my E-mail it doesn't happen. And if my E-mail is saying
one thing, and everything else says something else - E-mail will conquer.
-- An Israeli Linuxer


Re: Wiki spam #3

2007-05-04 Thread Shlomi Fish
On Friday 04 May 2007, Andy Armstrong wrote:
> More spam deleted:
>
> http://perl-qa.yi.org/index.php/Special:Recentchanges
>
> Can I assume that nobody currently on this list or monitoring the
> Wiki has admin?
>
> Can we fix this please?
>
> I'm still assuming that it's Tyler who controls the wiki - but I
> haven't been able to track him down.
>
> Assuming we can't find the person who currently holds the keys I'll
> happily set up and host a new version of the Wiki.
>
> Can anyone who has any objections or who knows more about the current
> hosting arrangements than me please speak now. If I hear nothing I'm
> going to set up a new Mediawiki installation and import the current
> QA wiki into it.

Sound good to me. +1.

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

If it's not in my E-mail it doesn't happen. And if my E-mail is saying
one thing, and everything else says something else - E-mail will conquer.
-- An Israeli Linuxer


Re: New CPANTS metrics

2007-03-31 Thread Shlomi Fish
On Sunday 01 April 2007, chromatic wrote:
> On Saturday 31 March 2007 15:26, Yuval Kogman wrote:
> > uses_version_control sounds more like lacks_manifest_skip_file which
> > should deduct kwalitee IMHO.
>
> Maybe so, but how else can CPANTS detect that you use the world's most
> advanced version control system: CVS?
>

Are you kidding?

CVS is not advanced as:

1. Microsoft Visual SourceSafe - the only sane choice for good data integrity 
and portability.

2. tarballs/zip-files and patches. This one excels in convenience, and 
robustness.

CVS is a very advanced version control system, however. I do wish that 
Subversion (which is a VCS that I have to use against my will) was as good as 
it is.

Regards,

Shlomi Fish

-----
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

If it's not in my E-mail it doesn't happen. And if my E-mail is saying
one thing, and everything else says something else - E-mail will conquer.
-- An Israeli Linuxer


Re: Eliminating STDERR without any disruption.

2007-03-18 Thread Shlomi Fish
On Sunday 18 March 2007, Michael G Schwern wrote:
> Ovid wrote:
> > Amusingly, when I was at last year's Google Test Automation Conference,
> > lots of folks were talking about their XML output from their test
> > harnesses and many of them weren't happy with it (having to wait for a
> > well-formed XML document sucks, particularly when a human can read the
> > partially formed document and still understand things).  I wound up
> > giving a lightning talk on TAP in hopes of reeling in the people who
> > were unhappy with XML, but no dice.
>
> It would be nice to know what those other systems do that TAP does not. 
> Steal their ideas.
>
> Another problem is we're not even on most people's maps.  Here's one
> example. http://opensourcetesting.org
>
> Might it be time we start up a TAP-only mailing list?  If nothing else it
> would unclog perl-qa from those who want to talk about something other than
> TAP.

I think that's a good idea. I believe many people here got tired of the 
TAP-related discussions, and they grew to unpreceded volume.

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


ANN: Test-Run-Plugin-AlternateInterpreters

2007-03-16 Thread Shlomi Fish
Test-Run-Plugin-AlternateInterpreters version 0.0101 was uploaded to the CPAN 
today:

http://search.cpan.org/dist/Test-Run-Plugin-AlternateInterpreters/

This is a plugin for Test-Run and an accompanying Test-Run-CmdLine plugin that 
enable one to specify alternate interpreters for running the test files. 
Here's a demonstration:

<<<<<<<<<<<<<<<<<<<<<<<
shlomi:~/progs/perl/cpan/Test/Test-Harness/Temp$ ls
mokcat1.yml~  my-interpreters.yaml  t
shlomi:~/progs/perl/cpan/Test/Test-Harness/Temp$ cat my-interpreters.yaml
---
- cmd: '/usr/bin/python'
  pattern: \.py\z
  type: regex
- cmd: '/usr/bin/ruby'
  pattern: \.rb\z
  type: regex
- cmd: '/usr/bin/perl'
  pattern: \.pl\z
  type: regex
shlomi:~/progs/perl/cpan/Test/Test-Harness/Temp$ ls -l t/
total 12
-rw-r--r-- 1 shlomi shlomi  94 Mar 16 11:22 test.pl
-rw-r--r-- 1 shlomi shlomi 256 Mar 16 11:15 test.py
-rw-r--r-- 1 shlomi shlomi 222 Mar 16 11:13 test.rb
shlomi:~/progs/perl/cpan/Test/Test-Harness/Temp$ cat t/test*
use strict;
use warnings;

use Test::More tests => 1;

# TEST
ok (1+1 == 2, "1 and 1 is 2");

num = 1

def ok(test, msg):
global num
if test:
extra = ""
else:
extra = "not "

print extra + "ok " + str(num) + " - " + msg
num = num + 1

print "1..2"
ok((5+5 == 10), "5 and 5 is 10")
ok((3*8==24), "3 times 8 is 24")
$num = 1;

def ok(test, msg)
extra = test ? "" : "not "
if (test)
puts "#{extra}ok #{$num} - #{msg}"
end
$num += 1
end

puts "1..2"
ok((5+5 == 10), "5 and 5 is 10")
ok((3*8==24), "3 times 8 is 24")
shlomi:~/progs/perl/cpan/Test/Test-Harness/Temp$ export 
HARNESS_PLUGINS="ColorSummary AlternateInterpreters"
shlomi:~/progs/perl/cpan/Test/Test-Harness/Temp$ export 
HARNESS_ALT_INTRP_FILE=`pwd`/my-interpreters.yaml
shlomi:~/progs/perl/cpan/Test/Test-Harness/Temp$ runprove t/test*
t/testok
t/testok
t/testok
All tests successful.
Files=3, Tests=5,  0 wallclock secs ( 0.08 cusr +  0.02 csys =  0.10 CPU)
shlomi:~/progs/perl/cpan/Test/Test-Harness/Temp$
>>>>>>>>>>>>>>>>>>>>>>

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Test::Run 0.0105

2007-03-13 Thread Shlomi Fish
Hi all!

Up on the hills of the release of TAP::Parser 0.51, I released a new version 
of Test::Run that works against it:

http://search.cpan.org/dist/Test-Run/

The Changes file reads:

<<<<<<<<<<<<<
0.0105Mon Mar 12 23:46:34 IST 2007
* Converted from TAPx::Parser 0.3x to TAP::Parser 0.51, including various
changes to the tests and code to get over several regressions.
>>>>>>>>>>>>>

While I was in the swing, I also started cleaning up the code a bit (in the 
trunk only so far):

1. Removed some unused package variables.

2. Converted use MyModule; @ISA=(qw(MyModule)); directives to use 
base 'MyModule';

3. Extracted several classes to their own files. (Not over with it yet).

4. Implemented the increment function for the totals in a better way.

Regards,

    Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: Worrying about future proofing TAP is a little premature

2007-03-13 Thread Shlomi Fish

On 3/13/07, Andy Lester <[EMAIL PROTECTED]> wrote:


On Mar 13, 2007, at 2:39 AM, Shlomi Fish wrote:

> Hmmm I sent Andy a patch to correct some typos in TAP.pm (the
> TAP spec)
> and received no reply. Here is the message for your inspection.

Dude, two days in patch land is teeny.

Applied, thank you.



You're welcome.

Regards,

 Shlomi Fish


xoa

--
Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance








--
------
Shlomi Fish http://www.shlomifish.org/

If his programming is anything like his philosophising, he
would find 10 imaginary bugs in the "Hello World" program.


Re: Worrying about future proofing TAP is a little premature

2007-03-12 Thread Shlomi Fish
On Tuesday 13 March 2007, Michael G Schwern wrote:
> So, we seem to have drifted from the topic of test groups over to this
> topic of future proofing against broken versions and TAP producer / parser
> version negotiation.  I have a simple solution for this.
>
> If all we do is argue about TAP extensions and never actually produce one
> we will never have to worry about new versions!
>
> Brilliant!  I'm a god damned genius.  And it seems that we're steady on
> track on this one, batting 1.000 since May 2001. [1]
>
> Point is, its a little premature to worry about future proofing TAP against
> versioning mistakes when we're not producing new versions!  I said last
> week that I'm worried about how much time has been spend talking about TAP
> extensions and so little actually writing code and I'm serious.  There are
> four tasks to be done.  Andy Armstrong has done one.  Andy, Ovid and Eric
> are working on TAP::Parser.  There's been one edit to the TAP spec, which I
> suspect was done by Andy.  

Hmmm I sent Andy a patch to correct some typos in TAP.pm (the TAP spec) 
and received no reply. Here is the message for your inspection.

Regards,

Shlomi Fish


> And nothing done to work on the TAP diagnostic 
> syntax, easily the most pressing new TAP feature.
>
> I'm not even going to address the issue further, consider it shelved until
> we get a TAP extension implemented.
>
>
>
> [1] Technically Andy Armstrong went ahead and actually implemented the TAP
> version spec in TAP::Parser breaking our perfect record.  Boo! ;)



-- 

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.
--- Begin Message ---
Hi Andy!

I went over TAP.pm and corrected some typos. Here's the patch.

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.
--- TAP.pm.orig	2007-03-10 10:19:23.585295498 +
+++ TAP.pm	2007-03-10 10:27:52.886318909 +
@@ -13,7 +13,7 @@
 
 TAP, the Test Anything Protocol, is Perl's simple text-based interface
 between testing modules such as Test::More and a test harness such as
-Test::Harness 2.x or TAP::Harness 3.x.
+Test::Harness 2.x or TAP::Harness.
 
 =head1 THE TAP FORMAT
 
@@ -52,7 +52,7 @@
 
 The plan tells how many tests will be run, or how many tests have run.
 It's a check that the test file hasn't stopped prematurely.  It must
-appear once, whether at the beginning or end of the output.
+appear once, whether at the beginning or at the end of the output.
 
 The plan is usually the first line of TAP output and it specifies how
 many test points are to follow. For example,
@@ -86,7 +86,7 @@
 point. C is a successful test point. This is the only mandatory
 part of the line.
 
-Note that unlike the Directives below, C and C are
+Note that unlike the directives below, C and C are
 case-sensitive.
 
 =item * Test number
@@ -297,7 +297,7 @@
 
 =head2 Got spare tuits?
 
-The following example reports that four tests are run and the last two
+The following example reports that four tests were run and the last two
 tests failed. However, because the failing tests are marked as things
 to do later, they are considered successes. Thus, a harness should report
 this entire listing as a success.
--- End Message ---


Re: TAPx::Parser -> TAP::Parser?

2007-03-07 Thread Shlomi Fish

On 3/7/07, Adrian Howard <[EMAIL PROTECTED]> wrote:


On 5 Mar 2007, at 22:30, Ovid wrote:

> (Resent from the address I've actually subscribed from!)
>
> Hi all,
>
> Per an email from Schwern, he does not object to renaming TAPx::Parser
> to TAP::Parser.  Hence, we have an official 'blessing' from him for
> claiming this namespace.  Does anyone have any thoughts/objections to
> this?  I realize that enough people are using TAPx::Parser that it
> might be a tiny speed bump for some, but I can't see any major
> difficulties here.
>
> Any concerns/objections?

Nope.



Also fine by me, as Test::Run only uses TAPx::Parser on a small number
of places.

Regards,

 Shlomi Fish


Adrian




--
--
Shlomi Fish http://www.shlomifish.org/

If his programming is anything like his philosophising, he
would find 10 imaginary bugs in the "Hello World" program.


Re: a safer way to use no_plan?

2007-03-04 Thread Shlomi Fish
On Sunday 04 March 2007, chromatic wrote:
> On Saturday 03 March 2007 18:18, Andy Lester wrote:
> > Good Lord do I get frustrated at the handwringing over test  
> > counting.  Look, it's simple.  You write your tests.  You run it  
> > through prove.  You see how many tests it reports.  You add it at the  
> > top of the file.  Voila!
>
> But Andy, what if I modify the test file?  I don't want to have to modify
> the test file to tell my test harness that I've modified the test file!
>
> If only we had something that flies through space
>

My solution to this is:

http://search.cpan.org/dist/Test-Count/

It's not a perfect solution but it Works For Me.

What I do is add comments in a small domain-specific language that allow me to 
count how many tests were added. These comments are usually placed close to 
the tests themselves, so they can be updated at the same time. Examples for 
such comments are:

# TEST
is ($mystring, "Hello", "String is Hello");

# TEST*3
for my $i (0 .. 2)
{
ok ()
}

Regards,

    Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: Custom extensions to META.yml

2007-03-01 Thread Shlomi Fish

On 3/1/07, David Golden <[EMAIL PROTECTED]> wrote:

I've had some requests for a mechanism for module authors to indicate
whether or not they want to be copied on module test emails generated
by CPAN::Reporter (particularly for passing reports).  This seems like
the kind of thing that should go in the module META.yml.

Is there a de facto standard for custom extensions to META.yml?  (I
didn't see one in the spec.)  An example might be fields beginning
with a capital letter or "X-foo" style extensions.  E.g.

X-cc-author: no

Alternatively, what would people think about adding a field in
META.yml like "notes" for this kind of extra information.  E.g.:

notes:
cc_author: no



I would prefer the second option because it is more modular. However,
there should be a way to add things to it easily when preparing the
META.yml.

Regards,

Shlomi Fish


Thanks in advance for your thoughts.

David




--
------
Shlomi Fish http://www.shlomifish.org/

If his programming is anything like his philosophising, he
would find 10 imaginary bugs in the "Hello World" program.


Re: Generating test data and testing it

2007-02-20 Thread Shlomi Fish

Hi Ovid!

On 2/20/07, Ovid <[EMAIL PROTECTED]> wrote:

Here's a common enough problem that I assume someone else has solved
it.

Tools in question:

  Test::Class
  Test::WWW::Mechanize

We want to test creating users (pseudo-code, but close to what we
actually use):

  sub add_user : Tests(5) {
  my $test = shift;
  my $mech = $test->mech;
  $mech->get_ok( $add_user_page, 'get the "Add User" page' );
  $mech->submit_form(
form_name => 'add_user',
fields=> { name => $some_name }
  );
  $mech->content_like( qr/User added/ );
  $mech->back;
  $mech->submit_form(
form_name => 'add_user',
fields=> { name => $some_other_name }
  );
  $mech->content_like( qr/User added/ );
  $mech->get_ok( $user_page, 'get the "List User" page' );
  $mech->content_like( qr/2 users found/ );
  }

So that's all well and good, but another class has another method where
we to add accounts, but we must have a customer backing each account
successfully added.  We'd rather not simply duplicate the above logic
and since the code's already written, I had the (quite possibly stupid)
idea of rewriting the above like this:

  sub add_user : Tests(5) {
  my $test = shift;
  my $mech = $test->mech;

  my $override = override_if_fixture(
  test => $test,
  mech => $mech,
  overrides => {
  get_ok   => sub {
  my ( $mech, $page ) = @_;
  $mech->get($page);
  },
  content_like => sub {},
  }
  );


Maybe I'm missing something, but in your second example, you declare
$override as a lexical and don't use it anywhere. May I inquire what
was your real intention?

Regards,

   Shlomi Fish


  $mech->get_ok( $add_user_page, 'get the "Add User" page' );
  $mech->submit_form(
form_name => 'add_user',
fields=> { name => $some_name }
  );
  $mech->content_like( qr/User added/ );
  $mech->back;
  $mech->submit_form(
form_name => 'add_user',
fields=> { name => $some_other_name }
  );
  $mech->content_like( qr/User added/ );
  $mech->get_ok( $user_page, 'get the "List User" page' );
  $mech->content_like( qr/2 users found/ );
  }

The idea is, in this scope, we'd convert the 'get_ok' and
'content_like' methods to *not* be tests for the current scope.  This
allows us to use our tests as test fixtures rather than duplicate this
logic.

I think this is a horribly clumsy idea, but the above is a simplified
example and some test data could get hairy to setup and if we change
our Web pages, I'd hate to find all of the duplicated logic for setting
up this test data and testing that it actually works (note that we
could be testing a remote server and not always be in a position to
access the database directly).

Thoughts?

Cheers,
Ovid

--

Buy the book -- http://www.oreilly.com/catalog/perlhks/
Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/




--
--
Shlomi Fish http://www.shlomifish.org/

If his programming is anything like his philosophising, he
would find 10 imaginary bugs in the "Hello World" program.


Integrating Test::Run into an ExtUtils::MakeMaker+Test::Manifest Setup - Take 2

2007-02-16 Thread Shlomi Fish
Hi all!

In regards to:

http://www.nntp.perl.org/group/perl.qa/2006/11/msg7395.html

I applied Schwern's input into the Makefile.PL process of XML::RSS:

http://svn.perl.org/modules/XML-RSS/trunk/Makefile.PL

Enjoy!

Regards,

    Shlomi Fish
-- 

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: Regression Behaviour between TAPx-Parser-0.41 to TAPx-Parser-trunk

2007-02-16 Thread Shlomi Fish
On Friday 16 February 2007, Ovid wrote:
> Can anyone else comment on this?  I understand exactly where Shlomi is
> coming from and I know that he's wrong in his thoughts, but there is
> certainly a difference of opinion regarding 'correct' behavior.
>

Actually, I wasn't claiming the current behaviour of Test::Run and 
Test::Harness is the correct one. I only claimed that Test::Run behaves the 
same as T::H and that TAPx::Parser broke it in this respect.

> > I find it unlikely that my code differs in interpreation from
> > Test::Harness in
> > this regard. After all, my code is derived from Test::Harness, and I
> > don't
> > recall changing the tests inside t/test-harness.t. Furthermore, the
> > results
> > specification for the test for 'bignum' is the same in both places.
>
> I can understand that.  In this case, I'm not sure where Test::Harness
> goes wrong, but it's wrong.  After conversation with Schwern, it was
> determined that any tests run which are more than the 'planned' tests
> are 'not ok'.  I think Test::Harness is wrong in this regard and that's
> possibly part of the reason why the prove output is so strange.

Very well - I guess I agree with that. I'll wait until the new TAPx::Parser 
has a stable version on CPAN and modify the tests and behaviour of Test::Run 
accordingly while bumping the required version of TAPx::Parser to the new 
one. (Due to the incompatibility changes).

>
> > >   $ prove badplan
> > >   badplan...FAILED tests 3-4
> > >
> > >   Failed 2/2 tests, 0.00% okay
> > >   Failed Test Stat Wstat Total Fail  List of Failed
> > >   
> > >   badplan22  3-4
> > >   Failed 1/1 test scripts. -2/2 subtests failed.
> > >   Files=1, Tests=2,  0 wallclock secs ( 0.01 cusr +  0.01 csys =
> >
> > 0.02
> >
> > > CPU)
> > >   Failed 1/1 test programs. -2/2 subtests failed.
>
> First it says that 2/2 failed and that 0.00% were OK and later says
> that -2/2 failed.  Both 2/2 and -2/2 are wrong, since 2/4 tests
> 'failed'.  2 tests were planned, 4 were run.  We don't have any way of
> knowing if the plan is wrong or if the final two tests were run in
> error.  Only a human looking at the code can determine this.  Thus, the
> 'prove' output is incorrect (and contradictory and non-sensical).

Yes, you're right.

>
> (Note:  this isn't meant to be a slam on Schwern or Andy Lester.
> They've both done great work with a code base which has evolved into a
> corner.)

Sure.

>
> > >   $ runtests badplan
> > >   badplan All 2 subtests passed
> > >
> > >   Test Summary Report
> > >   ---
> > >   badplan (Wstat: 0 Tests: 4 Failed: 2)
> > > Failed tests:  3-4
> > > Parse errors: Bad plan.  You planned 2 tests but ran 4.
> > >   Files=1, Tests=4,  0 wallclock secs ( 0.00 cusr +  0.00 csys =
> >
> > 0.00
> >
> > > CPU)
> > >
> > > That's much clearer.
>
> As pointed out, 'runtests' output is clearer, non-contradictory,
> documented, and tells the programmer what happened, unlike 'runprove'
> or 'prove'.  This is one case where I think that following the exact
> behavior of T::H and 'prove' is an error.

OK.

>
> > It does, but I still don't know how to emulate the Test::Harness
> > behaviour using the new TAPx::Parser API.
>
> Admittedly, I don't know your design goals, but I don't think you
> should emulate broken behavior.  You've done enough work on Test::Run
> that I suspect that fixing confusing output is not a bad thing.
>
> If you really want to emulate the behavior, check 'has_todo' and
> 'actual_ok' in TAPx::Parser::Result::Test.  Those might help.

No, that's OK - I'll change the behaviour.

>
> > And furthermore, I'm not sure I'll be
> > able to
> > rely on the new API until a stable version of TAPx::Parser 0.5x is
> > released,
>
> That's fair.  We're working on getting a stable release (there are
> enough changes that it might bump up to 0.6).
>
> Thanks again for pointing this out.  In writing more tests for it, I
> found a subtle bug with my implementation.  It won't fix your problem
> and might even make things worse.  (I was comparing
> $parser->tests_planned to $result->test_num -- which might be wrong if
> tests are misnumbered -- instead of to $parser->tests_run).
>

You're welcome.

Thanks and regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: Regression Behaviour between TAPx-Parser-0.41 to TAPx-Parser-trunk

2007-02-15 Thread Shlomi Fish
On Thursday 15 February 2007, Ovid wrote:
> --- Shlomi Fish <[EMAIL PROTECTED]> wrote:
> > > Test::Run works fine with TAPx-Parser 0.41, but it breaks with the
> > > TAPx-Parser from the trunk:
>
> I've figured it out and that's because TAPx::Parser 0.41 was buggy and
> the latest TAPx::Parser has found a point where your code differs in
> interpretation from Test::Harness.

I find it unlikely that my code differs in interpreation from Test::Harness in 
this regard. After all, my code is derived from Test::Harness, and I don't 
recall changing the tests inside t/test-harness.t. Furthermore, the results 
specification for the test for 'bignum' is the same in both places.

>
> > Replying to myself I'd like to note that from my analysis at least
> > the
> > bignum test failed because of the following code in the new
> > TAPx::Parser:
> >
> > <<<<<<<<<
> > sub is_ok {
> > my $self = shift;
> >
> > return if $self->is_unplanned;   # <---
> >
> > # TODO directives reverse the sense of a test.
> > return $self->has_todo ? 1 : $self->ok !~ /not/;
> > }
>
> You noted that the 'bignum' test failed.  Well, let's look at that one:
>
>   print <   1..2
>   ok 1
>   ok 2
>   ok 136211425
>   ok 136211426
>   DUMMY
>
> If you try and run that through 'prove', you'll get a strange "Can't
> detailize, too big" error, so let's keep it simple, with normal tests
> but a bad plan:
>
>   $ cat badplan
>   print <   1..2
>   ok 1
>   ok 2
>   ok 3
>   ok 4
>   DUMMY
>
> And then use 'prove':
>
>   $ prove badplan
>   badplan...FAILED tests 3-4
>
>   Failed 2/2 tests, 0.00% okay
>   Failed Test Stat Wstat Total Fail  List of Failed
>   
>   badplan22  3-4
>   Failed 1/1 test scripts. -2/2 subtests failed.
>   Files=1, Tests=2,  0 wallclock secs ( 0.01 cusr +  0.01 csys =  0.02
> CPU)
>   Failed 1/1 test programs. -2/2 subtests failed.
>
> Hmm, 2/2 tests failed with 0.00% ok?  Later we get -2/2 subtests
> failed?

I'm getting:

<<<<<<<<<<<<<<
shlomi:$trunk/modules/Test-Shlomif-Harness$ prove badplan
badplan...FAILED tests 3-4
Failed 2/2 tests, 0.00% okay
Failed Test Stat Wstat Total Fail  Failed  List of Failed
---
badplan22 100.00%  3-4
Failed 1/1 test scripts, 0.00% okay. -2/2 subtests failed, 200.00% okay.
>>>>>>>>>>>>>>

And with runprove (the Test::Run-based prove equivalent):

<<<<<<<<<<<<
badplan...FAILED test 3-4
Failed 2/2 tests, 0.00% okay
Failed Test Stat Wstat Total Fail  Failed  List of Failed
---
badplan22 100.00%  3-4
Failed 1/1 test scripts, 0.00% okay. -2/2 subtests failed, 200.00% okay.
>>>>>>>>>>>>

Which seem exactly identical to me.

>
> What does 'runtests' say?  ('runtests' will handle the 'bignum' test
> above, too):
>
>   $ runtests badplan
>   badplan All 2 subtests passed
>
>   Test Summary Report
>   ---
>   badplan (Wstat: 0 Tests: 4 Failed: 2)
> Failed tests:  3-4
> Parse errors: Bad plan.  You planned 2 tests but ran 4.
>   Files=1, Tests=4,  0 wallclock secs ( 0.00 cusr +  0.00 csys =  0.00
> CPU)
>
> That's much clearer.  The problem happens because you've run two more
> tests than you planned, so the third and fourth tests are 'unplanned'.
> As a result, the harness has no way of knowing if you have a bad plan
> or if you have spurious tests being run.  Hence, running more tests
> than you have planned is an error.
>
> Note that 'is_unplanned' is documented to always return false with a
> trailing plan because you can't know until you reach the plan (or
> never, with an infinite stream) if any tests were unplanned.
>

OK.

> I'm also about to commit more tests to guarantee this behavior since it
> is documented but not tested well enough.
>
> I hope that explains things.
>

It does, but I still don't know how to emulate the Test::Harness behaviour 
using the new TAPx::Parser API. And furthermore, I'm not sure I'll be able to 
rely on the new API until a stable version of TAPx::Parser 0.5x is released, 
in which case, I'll have to require this particular version in my "requires" 
field. (Just as I'm requiring version 0.33 now).

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: Regression Behaviour between TAPx-Parser-0.41 to TAPx-Parser-trunk

2007-02-15 Thread Shlomi Fish
On Thursday 15 February 2007, Ovid wrote:
> --- Shlomi Fish <[EMAIL PROTECTED]> wrote:
> > Replying to myself I'd like to note that from my analysis at least
> > the
> > bignum test failed because of the following code in the new
> > TAPx::Parser:
> >
> > <<<<<<<<<
> > sub is_ok {
> > my $self = shift;
> >
> > return if $self->is_unplanned;   # <---
> >
> > # TODO directives reverse the sense of a test.
> > return $self->has_todo ? 1 : $self->ok !~ /not/;
> > }
>
> This does appear to be a bug.  
> I know how it came about and I'm looking 
> at how to get around it.  

OK, thanks.

> Thanks for the heads up. 
>

You're welcome. Of course, this is only the cause for the first failure of the 
Test::Run tests. There may be more regressions in TAPx::Parser that the other 
failures in Test::Run. You may wish to see that everything passes while 
you're at the neighbourhood.

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: Regression Behaviour between TAPx-Parser-0.41 to TAPx-Parser-trunk

2007-02-15 Thread Shlomi Fish

Hi all!

On 2/15/07, Shlomi Fish <[EMAIL PROTECTED]> wrote:

Hi!

Test::Run works fine with TAPx-Parser 0.41, but it breaks with the
TAPx-Parser from the trunk:



Replying to myself I'd like to note that from my analysis at least the
bignum test failed because of the following code in the new
TAPx::Parser:

<<<<<<<<<
sub is_ok {
   my $self = shift;

   return if $self->is_unplanned;   # <---

   # TODO directives reverse the sense of a test.
   return $self->has_todo ? 1 : $self->ok !~ /not/;
}





Since the test is reported as unlpanned, then it always returns false,
regardless of the true verdict. And I don't see a way to get the
second condition evaluation (which is what I need) without duplicating
its logic.

In TAPx::Parser 0.41 we have:

<<<<<<
sub is_ok {
   my $self = shift;

   # TODO directives reverse the sense of a test.
   return $self->has_todo ? 1 : $self->ok !~ /not/;
}




So this is apparently what broke Test::Run.

Regards,

  Shlomi Fish


<<<<<<<<<<<
shlomif:$trunk/modules/Test-Shlomif-Harness$ perl -Ilib  t/test-harness.t
1..182
ok 1
ok 2 # skip don't apply to a bailout
ok 3 # skip don't apply to a bailout
ok 4 # skip don't apply to a bailout
ok 5 # skip don't apply to a bailout
ok 6 # skip don't apply to a bailout
ok 7 - bailout - No warnings
ok 8 # skip special tests for bailout
ok 9
ok 10 - bignum - all ok
ok 11 - bignum - has total
not ok 12 - bignum - totals
# Failed test (t/test-harness.t at line 522)
# Structures begin differing at:
#  $got->{ok} = '2'
# $expected->{ok} = '4'
ok 13 - bignum - failed
ok 14 - bignum - Got proper warnings
ok 15 # skip special tests for bailout
not ok 16
# Failed test (t/test-harness.t at line 518)
#  got: 'Assert failed! at lib/Test/Run/Straps.pm line 333
# '
# expected: ''
.
.
.
>>>>>>>>>>>

While:

<<<<<<<<<
shlomif:$trunk/modules/Test-Shlomif-Harness$ prove -I lib -I
~/progs/perl/cpan/Test/TAPx-Parser/TAPx-Parser-0.41/lib/
t/test-harness.t
t/test-harnessok
30/182 skipped: various reasons
All tests successful, 30 subtests skipped.
Files=1, Tests=182,  3 wallclock secs ( 2.54 cusr +  0.57 csys =  3.11 CPU)
>>>>>>>>>

I'll try to investigate further. In the meanwhile you can see what I'm
doing by svn checkout'ing this:

https://svn.berlios.de/svnroot/repos/web-cpan/Test-Harness-NG/trunk/

Regards,

  Shlomi Fish
--
--
Shlomi Fish http://www.shlomifish.org/

If his programming is anything like his philosophising, he
would find 10 imaginary bugs in the "Hello World" program.




--
--
Shlomi Fish http://www.shlomifish.org/

If his programming is anything like his philosophising, he
would find 10 imaginary bugs in the "Hello World" program.


Regression Behaviour between TAPx-Parser-0.41 to TAPx-Parser-trunk

2007-02-15 Thread Shlomi Fish

Hi!

Test::Run works fine with TAPx-Parser 0.41, but it breaks with the
TAPx-Parser from the trunk:

<<<<<<<<<<<
shlomif:$trunk/modules/Test-Shlomif-Harness$ perl -Ilib  t/test-harness.t
1..182
ok 1
ok 2 # skip don't apply to a bailout
ok 3 # skip don't apply to a bailout
ok 4 # skip don't apply to a bailout
ok 5 # skip don't apply to a bailout
ok 6 # skip don't apply to a bailout
ok 7 - bailout - No warnings
ok 8 # skip special tests for bailout
ok 9
ok 10 - bignum - all ok
ok 11 - bignum - has total
not ok 12 - bignum - totals
# Failed test (t/test-harness.t at line 522)
# Structures begin differing at:
#  $got->{ok} = '2'
# $expected->{ok} = '4'
ok 13 - bignum - failed
ok 14 - bignum - Got proper warnings
ok 15 # skip special tests for bailout
not ok 16
# Failed test (t/test-harness.t at line 518)
#  got: 'Assert failed! at lib/Test/Run/Straps.pm line 333
# '
# expected: ''
.
.
.




While:

<<<<<<<<<
shlomif:$trunk/modules/Test-Shlomif-Harness$ prove -I lib -I
~/progs/perl/cpan/Test/TAPx-Parser/TAPx-Parser-0.41/lib/
t/test-harness.t
t/test-harnessok
   30/182 skipped: various reasons
All tests successful, 30 subtests skipped.
Files=1, Tests=182,  3 wallclock secs ( 2.54 cusr +  0.57 csys =  3.11 CPU)




I'll try to investigate further. In the meanwhile you can see what I'm
doing by svn checkout'ing this:

https://svn.berlios.de/svnroot/repos/web-cpan/Test-Harness-NG/trunk/

Regards,

 Shlomi Fish
--
--
Shlomi Fish http://www.shlomifish.org/

If his programming is anything like his philosophising, he
would find 10 imaginary bugs in the "Hello World" program.


Automating Setting up a CPAN Smoking Environment

2007-02-10 Thread Shlomi Fish
Hi all,

in case you're not following my use.perl.org Journal, I wrote an entry about a 
program I wrote to automate the setting up of a CPAN smoking environment:

http://use.perl.org/~Shlomi+Fish/journal/32367

It's still a bit raw and uncooked, but it is much better than doing all these 
steps manually.

Comments, suggestions, corrections and flames are welcome.

Regards,

    Shlomi Fish

-----
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Test Coverage vs. Refactoring

2007-01-12 Thread Shlomi Fish
As I've been increasing the test coverage of XML::RSS, something has occured 
to me. Let's suppose we have the following pseaudo-code:

<<<<<<
sub func1
{
my ($self, @params) = @_;

.
.
.
if (COND)
{
$self->do_something(...);
}
.
.
.
}

sub func2
{
my ($self, @params) = @_;

.
.
.
if (COND)
{
$self->do_something(...);
}
.
.
.
}
>>>>>>>>>

Now, in order to achieve full test coverage we need to cover both (identical) 
conditional in func1 as well as func2. However, after we refactor the code to 
extract the conditional, we get the following code:

<<<<<<<<<<

sub handle_cond
{
my ($self, ...) = @_;
if (COND)
{
$self->do_something(...);
}
}

sub func1
{
my ($self, @params) = @_;

.
.
.
$self->handle_cond(...);
.
.
.
}

sub func2
{
my ($self, @params) = @_;

.
.
.
$self->handle_cond(...);
.
.
.
}

>>>>>>>>>>

Now we only have to cover the outcomes of the condition in only one function. 
(or two different outcomes in different functions). So our test coverage is 
not as comprehensive as the previous one.

This is naturally a limitation of test coverage in general which only checks 
coverage for individual code atoms, and not for all the different paths of 
execution (their Cartesian products).

Right now an ad-hoc solution is to make sure that one has a good test coverage 
before one refactors the code. But I think the philosophical problem is also 
interesting.

Regards,

Shlomi Fish


-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Module::Build and the Test Harness Report in the CPAN Testers

2007-01-12 Thread Shlomi Fish
Hi all!

In this message to Israel.PM:

http://perl.org.il/pipermail/perl/2006-September/008165.html

Yuval Kogman claimed that Module::Build generates CPAN testers reports with no 
output from the test harness. Now, I released Math::GrahamFunction, which is 
based on Module::Build, a few days ago and today received this failure error 
report:

http://nntp.x.perl.org/group/perl.cpan.testers/397523

And indeed it does not contain the output of the test harness.

Is this a known problem with Module::Build? Is it intentional, or are people 
otherwise working on resolving it? Is there anything I can do about it?

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: TAPx::Parser 0.05_03

2007-01-08 Thread Shlomi Fish
Hi Ovid!

On Monday 08 January 2007 22:26, Ovid wrote:
> It's on its way to the CPAN now.  Thanks for lots of feedback.  I'd
> really love to hear from Windows users as to whether or not it seems to
> work OK there.
>
> Also, if you're using TAPx::Parser and you think your
> project/organization wouldn't mind, I'd love to start including a list
> of users, just to show folks that it's being used.  For example, I know
> someone in Yahoo! is using it to 'tag' test output (this is public
> knowledge via the Perl-QA mailing list).
>
> More feature requests welcome.
>
> 0.05_03 08 January 2007
>

You said "0.05_03" once here ^^^ and once in the subject. However, there's 
already 0.41 on CPAN. Didn't you mean 0.50_03?

Regards,

Shlomi Fish

> - Fixed bug where '-q' or '-Q' with colored tests weren't
>   suppressing all information.
> - Fixed an annoying MANIFEST nit.
> - Made '-h' for runtests now report help.  Using a new
>   harness requires the full --harness switch.
> - Added 'problems' method to TAPx::Parser and
>   TAPx::Parser::Aggregator.
> - Deprecatd 'todo_failed' in favor of 'todo_passed'
> - Add -I switch to runtests.
> - Fixed runtests doc nit (smylers)
> - Removed TAPx::Parser::Builder.
> - A few more POD nits taken care of.
> - Completely removed all traces of C<--merge> as
>   IPC::Open3 seems to be working.
> - Moved the tprove* examples to examples/bin in hopes
>   of them no longer showing up in CPAN's docs.
> - Made the 'unexpectedly succeeded' message clearer
>   (Adam Kennedy)
>
> Cheers,
> Ovid
>
> --
>
> Buy the book -- http://www.oreilly.com/catalog/perlhks/
> Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/

-- 

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: The Wiki Has Been Spammed

2006-12-05 Thread Shlomi Fish
On Tuesday 05 December 2006 04:53, Michael G Schwern wrote:
> Shlomi Fish wrote:
> > Hi all!
> >
> > The wiki has been spammed:
> >
> > http://qa.yi.org/index.php?title=TAP%3A%3AHarness&diff=1744&oldid=1611
> >
> > And there isn't any contact information on the wiki anywhere. You can
> > find the porocedures to battle it here:
> >
> > http://www.iglu.org.il/wiki/index.php/Hamakor_Servers/MediaWikis_Spam_Fig
> >hting
>
> Thanks for reporting this, but its also nice to clean up what you see.  It
> a wiki, edit it.

Well, there are scripts to clean spam. (See: maintenance/cleanupSpam.php in 
the MediaWiki distribution).

They should be run instead of humans cleaning up the spam manually.

Regards,

    Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


The Wiki Has Been Spammed

2006-11-29 Thread Shlomi Fish
Hi all!

The wiki has been spammed:

http://qa.yi.org/index.php?title=TAP%3A%3AHarness&diff=1744&oldid=1611

And there isn't any contact information on the wiki anywhere. You can find the 
porocedures to battle it here:

http://www.iglu.org.il/wiki/index.php/Hamakor_Servers/MediaWikis_Spam_Fighting

Regards,

    Shlomi Fish

-----
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: Integrating Test::Run into an ExtUtils::MakeMaker+Test::Manifest Setup

2006-11-13 Thread Shlomi Fish
Hi!

Sorry for the late response - I've been distracted.

On Wednesday 01 November 2006 22:13, Michael G Schwern wrote:
> Shlomi Fish wrote:
> > Hi all!
> >
> > See http://xrl.us/sw5o for a recipe for integrating "make runtest" and
> > "make distruntest" targets into a Makefile.PL-generated Makefile that
> > makes use of Test::Manifest.
> >
> > I needed that when working on XML::RSS, so I wrote it.
>
> What has me scratching my head here is why you're hacking in a new target
> for Test::Run rather than just overriding the test target using the much
> cleaner test_via_harness().  Either the author wants to use Test::Run or
> they don't.  If the intention is for your own personal use while hacking
> other's modules, it seems much easier to simply have a prove command-line
> equivalent for running tests with Test::Run and Test::Manifest then to have
> to hack up each author's Makefile.PL.

Well, my original motivation was to have "make test" still use Test::Harness 
so one will not need to use Test::Run to run the tests. I don't want to 
impose Test::Run. Now instead, those that have Test::Run installed will be 
able to say "make runtest" or "make distruntest" (which is harder to 
implement as a command line utility.)

I already have "runprove" which is a Test-Run-based command line utility 
like "prove". However, running "runprove -l t/*.t" or in our case, something 
using Test::Manifest, is more error prone than typing "make runtest" 
and "make distruntest" would be even harder to get right this way.

Over-riding "make test" and "make disttest" would not be a good idea, because 
it will necessisate Test::Run in order to test the module.

>
>
> As for the implementation, here's some notes to avoid MakeMaker land mines:
>
> Your "perl" is hard coded.  You should be using $(PERLRUNINST) so that the
> tests run with the same perl used to run Makefile.PL.

Thanks, I'll correct it.

>
>
> You probably want to stash the bulk of the command line code off in a
> function somewhere like ExtUtils::Command::MM::test_harness() and
> Test::Manifest::run_t_manifest().  Long command lines mean portability
> problems.
>

Yes, that would be a good idea.

>
> This is not how you override methods in MakeMaker.  Its not backwards
> compatible and it pokes at the guts which are likely to move.
>
>   sub ExtUtils::MM_Any::test_via_harness {
>

Well, this function was added to the XML::RSS Makefile.PL before I modified it 
to add Test::Run support. I guess it would still be a good idea to fix it.

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Integrating Test::Run into an ExtUtils::MakeMaker+Test::Manifest Setup

2006-11-01 Thread Shlomi Fish
Hi all!

See http://xrl.us/sw5o for a recipe for integrating "make runtest" and "make 
distruntest" targets into a Makefile.PL-generated Makefile that makes use of 
Test::Manifest.

I needed that when working on XML::RSS, so I wrote it. 

Enjoy!

Regards,

Shlomi Fish

-----
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: Suggestions for cpantesters

2006-10-01 Thread Shlomi Fish
On Saturday 30 September 2006 01:16, Alexandr Ciornii wrote:
> Hello!
>
> For a long time I'm using Test::Reporter. Now I participate in Vanilla
> Perl project (http://win32.perl.org). I've started CPAN smoke.
>
> I've come to several ideas regarding cpantesters. I want your opinion on
> them.
>
> 1. YAML files on http://cpantesters.perl.org/ should include compiler
> info. Most important example: distinguish between ActiveState Perl and
> Vanilla Perl. I have both. Special case would be using gcc to compile
> modules for ActiveState (don't know how to check for it).
> Maybe also include some identifier (like Perl included in OS or compiled).

That would be a good idea.

> 2. Develop http transport for Test::Reporter (partially done by me).

Good idea. In addition to submitting the test report by email.

> 3. Modify CPANPLUS to report versions of dependencies even in case of
> success. CPAN::Reporter already does this.

Good idea.

> 4. Modify CPAN::YACSmoke to have better configuration and to always skip
> distributions in corresponding list in config.

Right.

> 5. We should have a list of hanging modules with comments for skipping
> on CPAN smoking. Also list modules that require external libraries to
> skip on Win32.

Sounds good.

> 6. Add posibility to module developers (or anybody) to subscribe to FAIL
> reports.

Right. Via email or RSS. It was discussed previously, how authors get 
notifications of RT issues, but don't get notificiation of the module smoke 
tests.

> 7. Dupe checks for reports.

That would be good.

> 8. External libraries versions also should be included in report.

That may require some support from EU::MM/M::B/etc. because one cannot know in 
advance which external libraries are used by the modules.

> 9. AFAIK reports from people not on cpan-testers/AT/perl.org list are
> manually checked. I don't want to subcribe to this list, if I want, I
> read it via NNTP. With http transport there is no need for such checks.

What do you mean?

> 10. CPAN::YACSmoke should also store dependecies in it's DB. If it is
> testing module again it should report again it also if dependencies
> versions changed.

Sounds good.

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: A Suitable Iterator for TAPx::Parser

2006-09-20 Thread Shlomi Fish
On Tuesday 19 September 2006 17:59, Ovid wrote:
> - Original Message 
> From: Shlomi Fish <[EMAIL PROTECTED]>
>
> >my $parser =
> >TAPx::Parser->new(
> >{
> >stream => TAPx::Parser::Iterator->new($test_output_orig),
> >}
> >);
>
> I'd recommend trying this:
>
>   my $parser = TAPx::Parser->new( { source => $source } );
>

I converted the code to use this convention in the svn trunk. Seems to work 
nicely. Thanks for the advice.

> I did that to simplify building parsers and it's new as of 0.30.  $source
> can be one of:
>
> 1.  An array reference of TAP lines.
> 2.  A complete string of TAP output.
> 3.  A filehandle.
> 4.  The path to an existing file.
>
> The original interface is still available with a desire to not break
> people's code (plus, I use it internally).
>
> So far it seems to work well, with the only caveat being that filenames are
> not permitted to have newlines in them (I forgot to document that).  Thus,
> if the iterator changes in the future, it hopefully won't break your code!
>

H you may wish to differentiate between #2 and #3 by saying that a 
filename is passed as a plain string, while a string is passed by taking a 
reference to it. That's what Template Toolkit and other modules are doing.

> > BTW, the documentation for the interface that the "stream => " argument
> > expects on the TAPx::Parser pod may be misleading:
>
> Thanks.  I need to clean that up, too!
>

No problem.

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: A Suitable Iterator for TAPx::Parser

2006-09-19 Thread Shlomi Fish
On Tuesday 19 September 2006 15:03, Ovid wrote:
> - Original Message 
> From: Shlomi Fish
>
> > Switching to TAPx::Parser::Iterator :
> >
> > http://search.cpan.org/~ovid/TAPx-Parser-0.30/lib/TAPx/Parser/Iterator.pm
> >
> > Solved this problem.
> >
> > However, the TAPx::Parser::Iterator POD says:
> >
> > "FOR INTERNAL USE ONLY!".
>
> Can you send me a short code example of how you're using it?
>

Sure:

<<<<<<<<<

# $test_output_orig is a ref to an array.
sub analyze {
my($self, $name, $test_output_orig) = @_;

my $parser =
TAPx::Parser->new(
{
stream => TAPx::Parser::Iterator->new($test_output_orig),
}
);

return $self->_analyze_with_parser($name, $parser);
}

sub analyze_fh {
my($self, $name, $fh) = @_;

my $parser = 
TAPx::Parser->new(
{
stream => TAPx::Parser::Iterator->new($fh),
}
);
return $self->_analyze_with_parser($name, $parser);
}

>>>>>>>>

That's it!

BTW, the documentation for the interface that the "stream => " argument 
expects on the TAPx::Parser pod may be misleading:

http://search.cpan.org/~ovid/TAPx-Parser-0.30/lib/TAPx/Parser.pm

Reading from it:

<<<<<<<<<<<<
* stream 

The value should be a code ref. Every every time the reference is called, it 
should return a chunk of TAP. When no more tap is available, it should return 
undef.
>>>>>>>>>>>>

> I think I may be able to remove that notice now, but I'm not quite ready to
> yet.  Still, I do show provide examples of how to use it, so I guess that's
> contradictory.  Oops.

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


A Suitable Iterator for TAPx::Parser

2006-09-19 Thread Shlomi Fish
Hi all!

I thought I could safely rely on using a Test::Run::Iteratory (essentially the 
same as Test::Harness::Iterator) object as a an argument to  "stream =>" in 
TAPx::Parser. However, then Ovid added more required to the iterator. 
Switching to TAPx::Parser::Iterator :

http://search.cpan.org/~ovid/TAPx-Parser-0.30/lib/TAPx/Parser/Iterator.pm

Solved this problem.

However, the TAPx::Parser::Iterator POD says:

"FOR INTERNAL USE ONLY!".

So, Ovid, what am I supposed to do? Can I safely use it? I'm just 
instantiating an object for a stream or an array and using it as is in 
Test::Run. Is this still OK?

Else, should I roll up some iterator of my own?

Regards,

Shlomi Fish

-----
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Integrating Test::Run with Module::Build

2006-09-08 Thread Shlomi Fish
Hi all!

Today, after a long session of hacking on XML-Grammar-ProductsSyndication 
(more about that later), I experimented a bit with integrating Test::Run into 
a Module::Build build system. It turns out to be very easy, with just having 
to add ACTION_runtest and ACTION_distruntest with the appropriate logic. My 
complete Build.PL (for the Test-Run distribution) now looks like this:

<<<<<<<
use strict;
use warnings;

use Module::Build;

my $class = Module::Build->subclass(
class => "Test::Run::Module::Build",
code => <<'EOF',
use strict;
use warnings;

sub ACTION_runtest
{
my ($self) = @_;
my $p = $self->{properties};

$self->depends_on('code');

local @INC = @INC;

# Make sure we test the module in blib/
unshift @INC, (File::Spec->catdir($p->{base_dir}, $self->blib, 'lib'),
 File::Spec->catdir($p->{base_dir}, $self->blib, 'arch'));

$self->do_test_run_tests;
}

sub ACTION_distruntest {
  my ($self) = @_;

  $self->depends_on('distdir');

  my $start_dir = $self->cwd;
  my $dist_dir = $self->dist_dir;
  chdir $dist_dir or die "Cannot chdir to $dist_dir: $!";
  # XXX could be different names for scripts

  $self->run_perl_script('Build.PL') # XXX Should this be run 
w/ --nouse-rcfile
  or die "Error executing 'Build.PL' in dist directory: $!";
  $self->run_perl_script('Build')
  or die "Error executing 'Build' in dist directory: $!";
  $self->run_perl_script('Build', [], ['runtest'])
  or die "Error executing 'Build test' in dist directory";
  chdir $start_dir;
}

sub do_test_run_tests
{
my $self = shift;

require Test::Run::CmdLine::Iface;

my $test_run =
Test::Run::CmdLine::Iface->new(
'test_files' => [glob("t/*.t")],
# 'backend_params' => $self->_get_backend_params(),
);

return $test_run->run();
}
EOF
);

my $build = $class->new(
module_name => "Test::Run",
requires => 
{
'Class::Accessor' => 0,
'File::Spec' => 0.6,
'Test::Harness' => "2.53",
'Scalar::Util' => 0,
'TAPx::Parser' => "0.21",
},
dist_version_from => "lib/Test/Run/Obj.pm",
);

$build->create_build_script;
>>>>>>>

Now, the ->do_test_run_tests() method is much shorter than its Test::Harness 
equivalent. I had to copy and paste some code in the $self->ACTION_... 
methods. Perhaps the M::B hackers would like to abstract the common 
functionality somehow.

In other news, Test::Run now makes use of TAPx::Parser to parse the TAP. It 
still collects the statistics on its own, because I couldn't remember whether 
TAPx::Parser does that or not, and it was too much work to do at one time.

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: "todo" tests in the TAP Plan

2006-09-06 Thread Shlomi Fish
On Wednesday 06 September 2006 22:50, Michael G Schwern wrote:
> Shlomi Fish wrote:
> > "t/sample-tests/todo" in the Test-Harness distribution reads:
> >
> > <<<<<<<<<<<
> > print < > 1..5 todo 3   2;
> > ok 1
> > ok 2
> > not ok 3
> > ok 4
> > ok 5
> > DUMMY_TEST
> >
> > As one can see, the "1..5" plan is followed by the "todo 3  2;"
> > directive. This is supposed to indicate something about plan ahead todo
> > tests. (Instead of the "# TODO" directives in the individual tests'
> > outputs. Now:
> >
> > 1. t/sample-tests/todo is being run by Test-Harness, which seems to think
> > the "not ok 3" is a todo test.
> >
> > 2. This todo-enabled plan is not documented in:
> >
> > http://search.cpan.org/~petdance/Test-Harness/lib/Test/Harness/TAP.pod
> >
> > 3. TAPx-Parser version 0.20 cannot handle it.
> >
> > --
> >
> > I'd like to know what I should do about this feature, because right now
> > I'm trying to convert Test-Run to use TAPX::Harness, and this is giving
> > me problems.
>
> These "old style" todo tests were never really documented until I stumbled
> on them inside Test::Harness and Test.pm, nobody really understood, aren't
> very useful and weren't really used.
>
> They were deprecated a while ago.  Since they were never really documented
> or used I just hid the deprecation notice inside Test::Harness as it was
> only interesting to folks hacking on it.  This notice used to appear in
> Test::Harness but it appears to have been removed.
>
> =begin _deprecated
>
> Alternatively, you can specify a list of what tests are todo as part
> of the test header.
>
>   1..23 todo 5 12 23
>
> This only works if the header appears at the beginning of the test.
>
> This style is B.
>
> =end _deprecated
>
>
> Don't push them forward into TAP.  Any feature which relies on static test
> numbering is broken.  Just let them die.

OK, thanks. I'll forward-port this sample-tests script to the new "# TODO" 
syntax , and would not take measurements to handle this situation.

Thanks for the heads up.

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


"todo" tests in the TAP Plan

2006-09-05 Thread Shlomi Fish
"t/sample-tests/todo" in the Test-Harness distribution reads:

<<<<<<<<<<<
print <>>>>>>>>>>

As one can see, the "1..5" plan is followed by the "todo 3  2;" directive. 
This is supposed to indicate something about plan ahead todo tests. (Instead 
of the "# TODO" directives in the individual tests' outputs. Now:

1. t/sample-tests/todo is being run by Test-Harness, which seems to think 
the "not ok 3" is a todo test.

2. This todo-enabled plan is not documented in:

http://search.cpan.org/~petdance/Test-Harness/lib/Test/Harness/TAP.pod

3. TAPx-Parser version 0.20 cannot handle it.

--

I'd like to know what I should do about this feature, because right now I'm 
trying to convert Test-Run to use TAPX::Harness, and this is giving me 
problems.

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: TAP ain't "Test All Perl"

2006-08-21 Thread Shlomi Fish
On Monday 21 August 2006 21:56, Ovid wrote:
> - Original Message 
> From: Shlomi Fish <[EMAIL PROTECTED]>
>
> > I'd like to make use of TAPx::Parser in Test::Run. Another thing I'd like
> > to do is extract all the non-core functionality from the main Test::Run
> > module into plugins. I did not completely forget it, just was busy.
>
> Thanks!  Let me know if there's anything you need changed which can support
> this.

Sure.

>
> > Speaking of tests, I wrote Test::Count, and placed it on the CPAN:
> >
> > http://search.cpan.org/dist/Test-Count/
> >
> > Its purpose is to keep track of the number of tests in a test script, by
> > having meta-comments in the code.
>
> No offense, but I can't tell from the docs how to use this.
>

This has to be remedied, I guess.

Quick primer:

"# TEST*[[EXPR]]" add [[EXPR]] tests to the total. "# TEST+[[EXPR]]" does the 
same.

"# TEST:$VAR1=[[EXPR]];$VAR2=[[EXPR]];" are variable assignments. You can 
later use these variables in subsequent lines.

Note that the space after the "#" is significant and "TEST" is always 
uppercase. But I'll write this in the POD.

Regards,

Shlomi Fish 

> Cheers,
> Ovid

-- 

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: TAP ain't "Test All Perl"

2006-08-21 Thread Shlomi Fish
On Monday 21 August 2006 17:48, Ovid wrote:
> - Original Message 
> From: Adrian Howard <[EMAIL PROTECTED]>
>
> > Of course this issue is nothing to do with any intrinsic property of
> > TAP. There's nothing stopping TAP being integrated much more tightly
> > - there just needs to be somebody with that itch to scratch.
>
> Except that there needs to be some movement on TAP again.  There was a
> flurry of enthusiasm, upgrading the perl-qa wiki with plans for
> TAP::Harness, talks about subsequent versions of TAP, but then it died. 
> Hell, I have the core in place to move on this, if only I could get an
> official blessing on it.  Having heard nothing, I just gave up.
>

I'd like to make use of TAPx::Parser in Test::Run. Another thing I'd like to 
do is extract all the non-core functionality from the main Test::Run module 
into plugins. I did not completely forget it, just was busy.

Speaking of tests, I wrote Test::Count, and placed it on the CPAN:

http://search.cpan.org/dist/Test-Count/

Its purpose is to keep track of the number of tests in a test script, by 
having meta-comments in the code.

Regards,

Shlomi Fish

-----
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: Kwalitee metric: Community support channels

2006-07-25 Thread Shlomi Fish
Hi Salve!

See below for my comments.

On Monday 24 July 2006 16:23, Salve J Nilsen wrote:
> Shlomi Fish wrote:
> > On Wednesday 19 July 2006 17:08, Salve J Nilsen wrote:
> >> Just a wild thought...
> >>
> >> Would it be useful to check for references to community support channels
> >> like mailing lists, IRC channels, public bug trackers and official web
> >> pages?
> >
> > Interesting idea. One thing I should probably note is that ESR has this
> > recommendation in "The Cathedral and the Bazaar":
>
> [http://catb.org/esr/writings/cathedral-bazaar/cathedral-bazaar/ar01s10.htm
>l]
>
> [Shlomi's experiences using different community channels]
>
> > What did I want to say? Yes, often the scope or maturity of the module
> > does not justify a special "community" support channels. So I'm not sure
> > whether penalising CPAN distros for not having this information is a good
> > idea. But I'll have to think about it some more.
>
> I'd rather look at these metrics as a way of encouraging developers to
> think about issues around community sustainment. That way, we can use "the
> game" as a tool for software improvement in addition to improving the
> codebase. 

Sure, that's probably good.

> Which specific types of channels one should get points for may 
> warrant discussion, but if our goal is the improvement of the software, we
> should at least encourage a mininmum number of ways to reach the users and
> developers of a software project.
>
> I would suggest giving a point for explicitly (and in a consistently
> machine-readable manner) stating the project's...
>
>   * primary public bugtracker (frontpage URL) in use by it's users and
> developers 

Well, we have rt.cpan.org for free. I believe module-starter and friends can 
put it in the YAML by default, while allowing you to override with something 
else (in case you have your own different bug tracker, as is the case for 
Catalyst with their Trac.).

+1.

> * main public mailing list (subscription URL) in use by it's 
> users and developers 

Well sometimes people segment between the mailing list for developers and 
mailing list for users of the software. I was involved with the Subversion 
development for a while, and they had one common mailing list. Then they 
decided to separate it into [EMAIL PROTECTED] and 
[EMAIL PROTECTED]

I should also note that there are other types of mailing lists:

1. Mailing list for Version Control Commits.

2. Wine-style Licence/flames mailing list. (Just kidding).

3. Mailing list for individual components (Mozilla style madness, where I can 
never determine where to post something).

4. Etc.

> * publically searchable archive of the mailing list 
> (search page URL) 

Well, Google as well as mail-archive.com, yahoogroups, googlegroups etc. give 
you an archive and a search for free. The archive should be publicly 
accessible, and have some search functionality. I set up a htdig search for 
the entire Perl Mongers domain, and it was a pretty straightforward 
experience.

> * publically readable code repository (e.g. to a CVSWeb 
> or SVN::Web frontpage URL)

H... would a standard Subversion HTTP/S tree be enough? 

>
> "Instant" communication channels like IRC and IM can of course be useful,
> but since the chat logs usually aren't stored and indexed publically, their
> lon term usefulness for the community are somewhat limited.

True, but I solved many problems using IRC or at least got a lot of help.

>
> One could of course say distros that don't state ANY contact information or
> community support channels could be "penalized", but I'd guess these
> developers probably don't care enough about their software or "the game" to
> feel much penalty from losing those points.

Yes.

>
> The rest of us ("the CPAN/Perl community") can still get all the good
> stuff, in addition to some hints on which projects one shouldn't expect any
> improvements or support. :)
>

Yes.

I daresay that sometimes a simple forward or developer email address is enough 
as a contact address. Recently I encountered some people in Israel 
(relatively new to the Internet scene) who seem to dislike mailing lists and 
prefer web forums and other mediums. Some of them even complained that some 
relatively low volume mailing lists were high volume, while in fact they were 
less than p5p and perl6-language, and much less than BugTraq or the Linux 
Kernel Mailing List. 

There is some software for multiplexing between a web forum, a newsgroup, a 
mailing list and an RSS feed, which could be useful. But we need to consider 
whether we also want a forum (a la Gabor's http://www.cpanforum.com/ ) as 
we

Re: Test::More, BEGIN use_ok, plan, what?

2006-07-21 Thread Shlomi Fish
On Friday 21 July 2006 19:50, A. Pagaltzis wrote:
> Hi Adriano,
>
> * Adriano Ferreira <[EMAIL PROTECTED]> [2006-07-21 15:20]:
> > If I run this script
> >
> >use Test::More;
> >
> >plan tests => 2;
> >
> >BEGIN { use_ok( 'My', 'foo' ); }
> >
> >ok(1);
> >is(foo, 1);
> >
> > I got the output, which says nothing about the use_ok. It is
> > not counted as a test, it does not ruin the plan, it does its
> > job (requiring and importing a &foo subroutine).
>
> I assume it’s because, despite the order in the file, the BEGIN
> block runs before the `plan tests => 2` line.
>
> Sure looks like a bug.
>

I don't think that it is. Perl preprocesses the files and at compile time 
executes any BEGIN { ... } blocks it encounters and execute them before the 
rest of the program. If you want to execute the plan at the beginning either 
also put it in a BEGIN { ... } block, or use the "use Test::More tests => 
$num_tests" directive.

It's not a bug - it's a feature. BTW, the "use" Perl keyword is also executed 
in compile time. There's some equivalent code to it in "perldoc -f use":

http://perldoc.perl.org/functions/use.html

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: Kwalitee metric: Community support channels

2006-07-21 Thread Shlomi Fish
On Wednesday 19 July 2006 17:08, Salve J Nilsen wrote:
> Just a wild thought...
>
> Would it be useful to check for references to community support channels
> like mailing lists, IRC channels, public bug trackers and official web
> pages?
>

Interesting idea. One thing I should probably note is that ESR has this 
recommendation in "The Cathedral and the Bazaar":

<<<<<<
It's fairly clear that one cannot code from the ground up in bazaar style 
[IN]. One can test, debug and improve in bazaar style, but it would be very 
hard to originate a project in bazaar mode. Linus didn't try it. I didn't 
either. Your nascent developer community needs to have something runnable and 
testable to play with.

When you start community-building, what you need to be able to present is a 
plausible promise. Your program doesn't have to work particularly well. It 
can be crude, buggy, incomplete, and poorly documented. What it must not fail 
to do is (a) run, and (b) convince potential co-developers that it can be 
evolved into something really neat in the foreseeable future.

http://www.catb.org/esr/writings/cathedral-bazaar/cathedral-bazaar/ar01s10.html
>>>>>>

I can attest from my experience that my most successful projects started from 
some code I wrote for myself, for some reason or another, and then finalised 
and released to the public. I usually didn't start a mailing list right away 
for them, and instead just publicised them on Freshmeat and collected the 
mails I received regarding them in my inbox, until there was enough to form a 
mailing list. Some of them still don't have a mailing list.

In regards to IRC channels: I tend to avoid starting one IRC channel for every 
limited-scope Perl module I put on the CPAN. There are enough channels I'm 
trying to participate on Freenode as it is, and usually cannot concentrate on 
one or two channels at a time. I feel that such modules should be discussed 
on channels of larger scope like #perl. (Albeit larger scale projects such as 
POE, Catalyst/Jifty/etc. Perl-QA, etc. may justify their own channels). For 
example, LeoNerd and I have coordinated the development of Error.pm on #perl.

Note that #perlcafe (on Freenode) is intended as #perl's chat channel, where 
one can also "banish" discussions that tend to flood #perl and have too 
little interest on the other #perl participants and lurkers. 

Another note is that I'm often not on the IRC on my waking hours, because I'm 
finding it too distracting and addictive. People can always reach me on IM or 
on Email:

http://www.shlomifish.org/me/contact-me/

What did I want to say? Yes, often the scope or maturity of the module does 
not justify a special "community" support channels. So I'm not sure whether 
penalising CPAN distros for not having this information is a good idea. But 
I'll have to think about it some more.

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.


Re: Using Perl in QA departments

2006-07-08 Thread Shlomi Fish
On Saturday 17 June 2006 22:12, Gabor Szabo wrote:
> If anybody is interested on this list,
> the slides and the examples of my 2 days course are available here:
>
> http://www.szabgab.com/perl_in_test_automation.html
>

Started reading them - they're very nice. Thanks for sharing them!

One note I'd like to add:

I believe that in:

<<<
http://www.szabgab.com/talks/perl_in_testing/test-functions-improved.html
>>>

You'd want to add:

<<<
local $Test::Builder::Level = $Test::Builder::Level + 1;
>>>

To the testing function, so it will correctly report the line from which it 
was called. (Because T::B uses caller()).

Regards,

Shlomi Fish

-----
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

95% of the programmers consider 95% of the code they did not write, in the
bottom 5%.


  1   2   >