This queue is for tickets about the Test-DBIx-Class-Stats CPAN distribution.

Report information
The Basics
Id:
109785
Status:
rejected
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
abraxxa [...] cpan.org
Cc:
AdminCc:

BugTracker
Severity:
Normal
Broken in:
0.01
Fixed in:
(no value)



Subject: subtest names incorrect
When running subtest_with in a loop the subtest name is kept from the first iteration for the second one and then shifted by one on the other iterations, for example: [ahartmai@ahartmai-nb:~/perl5/git/NAC-Logging$ (master)]$ prove -vl t/02_filter_addmetadata.t t/02_filter_addmetadata.t .. # With stats: Simple empty hash ok 1 - parsing ok 2 - no more database queries on subsequent messages 1..2 ok 1 - With stats: Simple empty hash # With stats: Cisco ASA & context ok 1 - parsing ok 2 - no more database queries on subsequent messages 1..2 ok 2 - With stats: Cisco ASA & context # With stats: Cisco Router ok 1 - parsing ok 2 - no more database queries on subsequent messages 1..2 ok 3 - With stats: Cisco Router # With stats: Cisco IOS Switch ok 1 - parsing ok 2 - no more database queries on subsequent messages 1..2 This can be seen when running under prove -vl. And by the way, Test::Builder 1.001003 has already been released which means you can remove your workaround from subtest_with.
Subject: Re: [rt.cpan.org #109785] subtest names incorrect
Date: Fri, 27 Nov 2015 17:24:49 +0000
To: bug-Test-DBIx-Class-Stats@rt.cpan.org
From: Hakim C <hakim.cassimally@gmail.com>
Hmm, isn't this just the slightly counter-intuitive behaviour of subtest?  e.g. this is a single subtest:

      # With stats: Simple empty hash
      ok 1 - parsing
      ok 2 - no more database queries on subsequent messages
      1..2
  ok 1 - With stats: Simple empty hash

The diag is done at the top of the subtest, and is echoed by the final 'ok 1' which gives the status of the whole subtest.
(e.g. I'd be expecting to see an 'ok 4 - With stats: Cisco Router' ending that 4th iteration.

Thanks for reminding me to update the module btw -- I'll have a look this weekend if I get time (or ping me if you'd like co-maint!)

On 27 November 2015 at 15:47, Alexander Hartmaier via RT <bug-Test-DBIx-Class-Stats@rt.cpan.org> wrote:
Show quoted text
Fri Nov 27 10:47:33 2015: Request 109785 was acted upon.
Transaction: Ticket created by ABRAXXA
       Queue: Test-DBIx-Class-Stats
     Subject: subtest names incorrect
   Broken in: 0.01
    Severity: Normal
       Owner: Nobody
  Requestors: abraxxa@cpan.org
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=109785 >


When running subtest_with in a loop the subtest name is kept from the first iteration for the second one and then shifted by one on the other iterations, for example:

[ahartmai@ahartmai-nb:~/perl5/git/NAC-Logging$ (master)]$ prove -vl t/02_filter_addmetadata.t
t/02_filter_addmetadata.t ..
    # With stats: Simple empty hash
    ok 1 - parsing
    ok 2 - no more database queries on subsequent messages
    1..2
ok 1 - With stats: Simple empty hash
    # With stats: Cisco ASA & context
    ok 1 - parsing
    ok 2 - no more database queries on subsequent messages
    1..2
ok 2 - With stats: Cisco ASA & context
    # With stats: Cisco Router
    ok 1 - parsing
    ok 2 - no more database queries on subsequent messages
    1..2
ok 3 - With stats: Cisco Router
    # With stats: Cisco IOS Switch
    ok 1 - parsing
    ok 2 - no more database queries on subsequent messages
    1..2

This can be seen when running under prove -vl.

And by the way, Test::Builder 1.001003 has already been released which means you can remove your workaround from subtest_with.

Oh, you might be right! It just reads odd when the name of one subtest is immediately followed by the next one. Is there a way to disable the first line?
On Fri Nov 27 16:49:38 2015, ABRAXXA wrote:
Show quoted text
> Oh, you might be right! > It just reads odd when the name of one subtest is immediately followed > by the next one. > Is there a way to disable the first line?
I think it's done automatically by `subtest` - because TAP is a streaming protocol, you don't get the current-level `ok` until all the subtests are complete, so outputting the comment at the beginning is really helpful to be able to tell what's going on. (This is why Test::Pretty seems appealing, though I never have much luck with it).
Closing, as I think this is Not A Bug, and this is how TAP subtests work.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.