Opened 4 years ago

Closed 4 years ago

#846 closed defect (fixed)

padre fails t/14-warnings.t with "Can't locate object method "ide" via package "Padre"" under AUTOMATED_TESTING=1

Reported by: rhebus Owned by:
Priority: major Milestone:
Component: editor Version: trunk
Keywords: Cc: Sewi

Description

C:\src\Padre>dmake test
Installing blib\lib\auto\share\dist\Padre\locale\de.po
Installing blib\lib\auto\share\dist\Padre\locale\he.po
Installing blib\lib\auto\share\dist\Padre\locale\messages.pot
blib\lib\auto\share\dist\Padre\locale -> blib\lib\auto\share\dist\Padre\locale
-blib\lib\auto\share\dist\Padre\locale\messages.pot
C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0,
'inc', 'blib\lib', 'blib\arch')" t/*.t t/win32/*.t xt/*.t
t/01-load.t ........................ # Tests find Wx: 0.96 wxWidgets 2.8.10
t/01-load.t ........................ ok
t/02-new.t ......................... ok
t/03-wx.t .......................... skipped: Windows currently has problems wit
h Unicode files
t/04-config.t ...................... ok
t/05-project.t ..................... ok
t/06-utils.t ....................... ok
t/08-style.t ....................... ok
t/14-warnings.t .................... 1/207 Can't locate object method "ide" via
package "Padre" at C:\src\Padre\blib\lib/Padre/Document/Perl/Beginner.pm line 90
.
# Looks like you planned 207 tests but ran 2.
# Looks like your test exited with 255 just after 2.
t/14-warnings.t .................... Dubious, test returned 255 (wstat 65280, 0x
ff00)
Failed 205/207 subtests
t/15-locale.t ...................... ok

is the main issue. Fuller transcript attached.

Attachments (2)

padre-ide-transcript.txt (5.0 KB) - added by rhebus 4 years ago.
fix-14-warnings.patch (2.2 KB) - added by rhebus 4 years ago.
Patch to fake the Padre class and allow calls to Padre->ide->config

Download all attachments as: .zip

Change History (12)

Changed 4 years ago by rhebus

comment:1 Changed 4 years ago by rhebus

I saw azawawi's message in IRC that he couldn't reproduce this. That's very odd.

It seems on my machine that t/14-warnings.t simply isn't requiring Padre and initializing the Padre singleton object. If I put "require Padre" into Padre::Document::Perl::Beginner::check then I just get this:
t/14-warnings.t .................... 1/207 Padre->new has not been called yet at

C:\src\Padre\blib\lib/Padre/Document/Perl/Beginner.pm line 91

Should t/14-warnings.t call Padre->new like 15-locale.t and other tests do? I tried this but the script complained that Wx::gettext was being redefined in t/14-warnings.t.

I've just tried on the 0.56 release and I get the same issue. It seems like perhaps my test environment isn't configured correctly in some way, because I didn't get any issues installing 0.56 through CPAN. Not really sure where to go from here, any ideas?

comment:2 Changed 4 years ago by rhebus

  • Version changed from 0.55 to 0.56

It seems this is only reproducible with AUTOMATED_TESTING=1.

I tried from within a cpan shell "test Padre" and from a downloaded distribution "dmake test" and in both cases, tests all pass without AUTOMATED_TESTING=1 but t/14-warnings.t fails with AUTOMATED_TESTING=1.

I also tried "dmake test" with RELEASE_TESTING=1 but t/14-warnings.t passed.

It seems that only AUTOMATED_TESTING will do to reproduce this bug.

comment:3 Changed 4 years ago by rhebus

  • Summary changed from padre fails t/14-warnings.t with "Can't locate object method "ide" via package "Padre"" to padre fails t/14-warnings.t with "Can't locate object method "ide" via package "Padre"" under AUTOMATED_TESTING=1

Ah yes, the reason it only works if AUTOMATED_TESTING=1 is because t/14-warnings.t exits early unless AUTOMATED_TESTING is set.

comment:4 Changed 4 years ago by rhebus

Okay, here's a possible patch to fix this problem. I create a mockup of Padre which enables Padre->ide->config to work as expected. This fixes the problem in the title of the ticket, but then the tests fail because the Padre codebase doesn't pass the P::D::P::Beginner tests. That's a problem for another ticket though.

I have one worry: should the test use its own config file rather than relying on the one that Padre::Config->read finds?

Changed 4 years ago by rhebus

Patch to fake the Padre class and allow calls to Padre->ide->config

comment:5 Changed 4 years ago by waxhead

You know I had a crack at this, but whatever I did... wouldn't work.

I'll try this patch tomorrow night.

comment:6 Changed 4 years ago by waxhead

Rhebus,

Nice job.. The patch applied fine and the testing works.. even finds errors in the code.

I think it's fine to commit... !! :)

comment:7 Changed 4 years ago by waxhead

  • Version changed from 0.56 to trunk

Rhebus,

If you don't commit the fix I'll do it tonight to get it in so we can test it before the next release.

comment:8 Changed 4 years ago by rhebus

If you think it's fine to commit, then either I need a commit bit, or someone else needs to commit it.

comment:9 Changed 4 years ago by waxhead

  • Cc Sewi added

Oh.. do you want to commit it?

I thought you already had permission to svn, sorry.

Drop into #padre and get Sewi to give you the commit bit.

comment:10 Changed 4 years ago by rhebus

  • Resolution set to fixed
  • Status changed from new to closed

patch applied in r11147

Note: See TracTickets for help on using tickets.