Running
perl ../bin/TestRunner.pl AccessControlTests.pm
gives one warning per test case like this:
AccessControlTests::test_SetInText
[Sun Jun 22 12:46:52 2014] TestRunner.pl: readdir() attempted on invalid dirhandle $DIR at /media/haj/linuxdevel/twiki/trunk/core/lib/TWiki/Store/RcsFile.pm line 376.
[Sun Jun 22 12:46:52 2014] TestRunner.pl: closedir() attempted on invalid dirhandle $DIR at /media/haj/linuxdevel/twiki/trunk/core/lib/TWiki/Store/RcsFile.pm line 378.
Tests pass, though. But how can we be sure that they tested the right thing if invalid dirhandles are around?
This is my second try to get the unit tests running. The first was running the full suite which ended up in a desaster: perl used all the RAM, then all the swap, requiring a power off of the machine. The console had a lot of warnings, at least one of them apparently deadly. I'm afraid these need to be eliminated one by one.
I wonder... years ago I had commit rights for TWiki. Are they still active? I could give it a try...
--
TWiki:Main/HaraldJoerg
- 2014-06-22
Ok, commit doesn't work, so here's the patch:
Index: TWikiFnTestCase.pm
===================================================================
--- TWikiFnTestCase.pm (revision 27670)
+++ TWikiFnTestCase.pm (working copy)
@@ -61,8 +61,8 @@
$TWiki::Plugins::SESSION = $this->{twiki};
@mails = ();
$this->{twiki}->net->setMailHandler(\&TWikiFnTestCase::sentMail);
+ $this->{twiki}->{store}->createWeb( $this->{twiki}->{user}, $this->{users_web} );
$this->{twiki}->{store}->createWeb( $this->{twiki}->{user}, $this->{test_web} );
- $this->{twiki}->{store}->createWeb( $this->{twiki}->{user}, $this->{users_web} );
$this->{test_user_forename} = 'Scum';
$this->{test_user_surname} = 'Bag';
$this->{test_user_wikiname} = $this->{test_user_forename}.$this->{test_user_surname};
Rationale:
TWiki:Plugins.WatchlistPlugin
is installed and activated per default. On creation of the
test_web
it tries to check whether someone has a watchlist for that. Hm. You can set a watch on a not-yet-existing web? Okaaay.... Anyway, to check for watchlists the plugin needs to read the users_web, which has not yet been created in the right place.
The patch simply reverts the order of web creation:
users_web
first, then
test_web
. This is a sensible order in any case.
--
TWiki:Main.HaraldJoerg
- 2014-06-23
Committed under
Item7535 - closing this one as a duplicate.
--
TWiki:Main.HaraldJoerg
- 2014-07-18