• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

If HTML::TreeBuilder is not installed, running perl ../bin/TestRunner.pl InitFormTests.pm throws very noisy errors instead of just warning that the tests can not be run. This is distracting when I run the whole TWikiSuite.pm.


Why didn't you just install HTML::TreeBuilder?

I hate tests that just tell you they can't be run. It just gives people an excuse to ignore the test. To me, that's a test failure. Looking at the code for this test, it does bottle out if HTML::TreeBuilder isn't installed, which IMHO is wrong.

If that bugs you, why not recode the test to eliminate HTML::TreeBuilder? From glancing at those tests, they should be recoded to use $this->assert_html_equals anyway, which is tolerant to changing parameter orders in HTML tags.

CC


To be honest: Before I ran the tests on one of my systems, I would have sworn that I have HTML::TreeBuilder installed, because I use to have it in all my installations.

In InitFormTests.pm, setup_formtests returns undef if HTML::TreeBuilder isn't installed, but test_form ignores that. This gives an error message for every test in the summary, which is anything but helpful:

1) /home/haj/public_html/TWikiRelease04x00/test/unit/InitFormTests.pm:152 - test_form(InitFormTests)
Can't call method "content_list" on an undefined value

I'll hack around this to produce a better message for now (and therefore setting to "Actioning").

But there's another gotcha lurking, which deserves a Codev brainstorming. When the tests failed, it occurred to me that TWiki's unit test mechanism lacks a decent way to cope with missing "non-TWiki" CPAN libraries in general. What if I'd like to use Acme::This::Very::Strange::Module for a particular unit test? But should I insist on every tester installing it?

haj

I seem to be unable to eliminate HTML::TreeBuilder, so the current checkin just improves the diagnostics. Back to "Waiting for Feedback".

haj


Guys, writing test cases is hard enough. Let me at least use something to make my life easier.

It is not very hard to install HTML::TreeBuilder. Anybody who can run test suites can do so, I think. It sure is easier to dissect the HTML that way. I am willing to rewrite if we use another HTML parser, but I am not going to do this all with regexes. -- TW

I'm inclined to agree. If we start imposing too many constraints, we will never get people to write tests; it's hard enough already!

Discarding for that reason.

CC


Fair enough. I never intended to impose a constraint. But please don't rollback r11677, because with better diagnostics we will probably get people to actually run the tests before doing their checkins.

haj

ItemTemplate
Summary InitFormTests fail unless HTML::TreeBuilder is installed
ReportedBy TWiki:Main.HaraldJoerg
Codebase ~twiki4
SVN Range TWiki-4.1, Wed, 04 Oct 2006, build 11657
AppliesTo Engine
Component BuildScripts
Priority Low
CurrentState No Action Required
WaitingFor

Checkins 11677
TargetRelease n/a
Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r9 - 2006-11-01 - HaraldJoerg
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback