On Jan 8, 2008 1:11 PM, Barbie <[EMAIL PROTECTED]> wrote:
> It's mostly to handle exclusions, avoid duplication, prempt NA
> submissions (a NA prereq will submit a NA in place of a FAIL for the
> current dist),

I thought we agreed in discussing semantics about NA that
distributions failing prereqs should not have reports submitted at
all.  (ca. CPAN::Reporter 0.46)

> allow retesting previously halted (internal ABORT grade)
> dists,

Better abort handling should probably go into CPAN::Reporter's Todo list.

> >     CPAN::Shell->test("AUTHOR/Dist-Name-0.01.tar.gz")
>
> That's essentially what I was planning for the bridge between YACSmoke
> and CPAN/CPAN-Reporter. The only additional bit of code required would
> be to feed back the grade to YACSmoke, which I haven't figured out yet.
>
> If you have any suggestions for feeding back the grade, let me know.

That's tricky.  Because of the way that CPAN.pm and CPAN::Reporter
separate their concerns, CPAN never needs to know about the grade.  It
just stands in for the normal "make test" system() call.  It could be
patched in fairly easily, I suppose.

The best approach is probably for CPAN::Reporter to tack it onto the
CPAN::Distribution object:

  # hypothetical
  my $dist = CPAN::Shell->expandany("AUTHOR/Dist-Name-0.01.tar.gz");
  $dist->test;
  if ( $dist->{reporter_result}{grade} eq 'fail' ) ...

I already have a grade of "discard" for reports that aren't sent (e.g.
invalid prereqs).  Does that seems like a workable approach?  If
Andreas has no objections, that's probably as clean as it's going to
get (short of actually writing a CPAN::Reporter::Result class that
gives you a real API).

> Also (perhaps a question for Andreas), how do I get/set configuration
> values without commiting, so that the tester can temporary amend
> configuration details without affecting their regular configuration?

Set the "auto_commit" option to 0.  Then any changes won't be committed.

> > CPAN::Reporter::History.
>
> Is it possible to grab information from this programmatically while it's
> running? I thinking specifically of the grade.

Yes.  There are private functions in CPAN::Reporter::History that
handle this for CPAN::Reporter -- I need to add a public API to make
it clearer how to use this.

> Also with your history file do you update the history if a second run of
> a dist passes where it previous failed or didn't complete due to prereq
> failures?

The history file records every result sent with grade.  It's more of a
log file than a database.  If you run a distribution and it fails then
run it again (e.g. after installing some other modules), then both
results will be recorded.  The format more or less matches the subject
line from Test::Reporter, but with the the test phase and perl version
available for parsing.  Example line for version.pm:

    test PASS version-0.7203 (perl-5.8.7) cygwin-thread-multi-64int
1.5.18(0.13242)

(i.e. test phase on perl 5.8.7 -- passing report)

David

Reply via email to