• 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.

Item4800: Multiple bugs in RegisterTests.pm unit test suite

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine UnitTests Urgent Closed   n/a  

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


The unit test suite RegisterTests.pm have a bunch of bugs:

  • In set_up, it attempts to set $this->{new_user_login} to $this->{new_user_wikiname} if $TWiki::cfg{AllowLoginName} is false.
    • ...but the correct config variable would have been $TWiki::cfg{Register}{AllowLoginName}, so login is always set identical to wikiname.
    • But it is the wrong place anyway, because the settings for AllowLoginName are supposed to be done individually in the test matrix.
    • So simply junk the lines.
  • sub AllowLoginName and sub DontAllowLoginName both set the wrong configuration variable $TWiki::cfg{AllowLoginName} as well, making all tests use the unmodified setting from the "real" installation.
    • And of course, this would be the right place to set the login name to wikiname if no login names are allowed.
  • Finally, the bulk registration test verify_BulkRegister is broken because it is relying on the ScumBag ( scum) user, as pre-registered in the base class TWikiFnTestCase.pm setup routine. This user is always pre-registered with login names allowed, so no test case with login names disallowed is able to correctly map this user, once the bugs above are fixed.

I'll commit a patch for the first two issues soon, the third is left as an exercise to the reader. Unfortunately, three out of 121 test cases in RegisterTests.pm now break.

-- TWiki:Main/HaraldJoerg - 11 Oct 2007

Well spotted, Harald! Regrouping this in UnitTests, and set to "being worked on" by you.


If you wish.... but don't hold your breath. Actually I've been trying to construct a test case for Item4771 when I had to find out that a) the information in TWiki:Codev.TestCasesTutorial isn't up to date and b) the test cases work totally different than they used to. It took me way too long to figure out what was wrong, just finding the files belonging to the unit test environment turned out to be tedious.

I really love the new reporting style and easier debugging with the new environment, yet it is a real nuisance if you end up with 20 undocumented source files in your editor as you trace through the unit test environment, the suite, and finally TWiki.

-- TWiki:Main.HaraldJoerg - 12 Oct 2007

I've solved the issue with ScumBag by no longer using it, but running the bulk registration test cases as TWikiAdminGroup instead. Closing the item, with a bad taste regarding the value of the "automatically" registered user ScumBag.

-- TWiki:Main.HaraldJoerg - 14 Oct 2007

Summary Multiple bugs in RegisterTests.pm unit test suite
ReportedBy TWiki:Main.HaraldJoerg
Codebase 4.2.0
SVN Range TWiki-4.3.0, Sat, 06 Oct 2007, build 15172
AppliesTo Engine
Component UnitTests
Priority Urgent
CurrentState Closed

Checkins TWikirev:15233 TWikirev:15281 TWikirev:15282
TargetRelease n/a

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r7 - 2007-10-14 - HaraldJoerg
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback