Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHILIP/Test-Spec-0.47.tar.gz fails with 1.301001071 #474

Closed
andk opened this issue Nov 2, 2014 · 5 comments
Closed

PHILIP/Test-Spec-0.47.tar.gz fails with 1.301001071 #474

andk opened this issue Nov 2, 2014 · 5 comments

Comments

@andk
Copy link

andk commented Nov 2, 2014

Seems to fails since 1.301001_051 or thereabouts. Sample fail report:

http://www.cpantesters.org/cpan/report/47392685 # 5.21.5
http://www.cpantesters.org/cpan/report/47392754 # 5.20.1

HTH&&Thanks

@exodist
Copy link
Member

exodist commented Nov 3, 2014

Looks like a conflict. Test::More now exports a context function, looks like this module also uses something with that name.

Not sure best solution here. Will look deeper when I can get to a computer.

@andk
Copy link
Author

andk commented Nov 3, 2014

Maybe releated: ADAMK/Aspect-1.04.tar.gz

The diag there is:

#   Failed test 'no warnings'
#   at /home/sand/src/perl/repoperls/installed-perls/perl/v5.21.5-114-g03d05f6/a2da/lib/site_perl/5.21.6/Test/NoWarnings.pm line 45.
# There were 1 warning(s)
#       Previous test 0 ''
#       Subroutine context redefined at t/00_context.t line 57.
#  at t/00_context.t line 57.

@exodist
Copy link
Member

exodist commented Nov 4, 2014

Aspect is fixed simply by moving 'context()' to not be exported by default, which is fine since it is new. This change also removes a warning from Test-Spec, but it does not fix it. I have dug deeper and found the problem.

define.t:

116 {   
117   no warnings 'once';
118   my $stub = Stub->new;
119   local *A::builder          = sub { $stub };
120   local *Test::More::builder = sub { $stub };
121   A->runtests;
122 } 

The test that fails tries to hide 2 tests by replacing the Test::Builder singleton with a stub class that simply returns on all sub calls (autoload).

This is a problem because one of the key goals of the alphas is to kill the singleton and the problems having a monolithic singleton caused. Instead there is a single minimal singleton that has 1 job, funnel results to the right place. It also has a built-in api that lets you do the kinds of thing this test wants to do, ie hide or intercept results.

Basically the fact that authors had to do this kind of hackery at all is the very limitation of Test::Builder that we are hoping to overcome with the alphas.

I can think of one possible fix on our end, but I am not sure if it might cause other issues. The fix would be to have Test::Stream 'notice' that the singleton has been replaced with an object that is not a subclass or instance of Test::Builder, if it detects this it can try to go through it... But I am pretty sure this would do the following:

  • Make the logic very complicated and hard to maintain
  • Break a lot of things
  • Slow Test::* down enough that blead might reject it again.

I think the better option would be to ask the author to make a small change to their code:

define.t:

116 {
117   if ($INC{"Test/Stream.pm"}) {
118     Test::Stream->intercept(sub { A->runtests });
119   }
120   else {
121     no warnings 'once';
122     my $stub = Stub->new;
123     local *A::builder          = sub { $stub };
124     local *Test::More::builder = sub { $stub };
125     A->runtests;
126   }
127 }

I have confirmed this solves the problem. I will submit it to the author.

exodist pushed a commit to exodist/perl-Test-Spec that referenced this issue Nov 4, 2014
The Alpha branch of Test-Simple and friends is quickly approaching
stable status. It is already merged into blead perl to find issues like
this.

This patch makes your test suite pass with both old and new versions of
Test::Builder.

Please see Test-More/test-more#474  for the
discussion of this issue.
@exodist
Copy link
Member

exodist commented Nov 4, 2014

Closing this ticket in favor of the module specific pull request: kingpong/perl-Test-Spec#18

@exodist exodist closed this as completed Nov 4, 2014
@exodist
Copy link
Member

exodist commented Nov 4, 2014

https://rt.cpan.org/Ticket/Display.html?id=100034

Added an RT ticket since it is their prefered tracker method. I forgot pull requests were glorified issues

@exodist exodist modified the milestone: Stabilize alphas Nov 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants