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

Item7525: All PluginHandlerTests fail with bad shell syntax

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension UnitTests Low New   n/a  

Edit Form Data

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


When running PluginHandlerTests, every testcase fails with:
/bin/cp: cannot stat /media/haj/linuxdevel/twiki/trunk/core/data/TWiki/{WebPreferences,TWikiPreferences}.txt: No such file or directory

Maybe some operating systems have a cp command which evaluates {WebPreferences,TWikiPreferences} as a list, but Ubuntu doesn't.

The shell commands have been added for Item6870 as a fix to the symptom that unit tests fail to copy the TWiki web. Ouch. I just reported that in Item7523. Unfortunately, the fix only treats the symptom and not the root cause, and it doesn't work for me.

The idea to have a "minimal" copy of the TWiki web for test purposes is quite fine, but I suggest that the implementation abandons the system call.

  • Minimal improvement: Use File::Copy instead of bin/cp and use an explicit loop over the files needed instead of non-portable shell syntax.
  • Better: Have a unit test utility function which copies the relevant parts of the TWiki web. According to Item6870 quite a couple of test cases want to do this, so it is a candidate for factoring into TWikiTestCase.pm.

I'm currently going through the unit tests alphabetically, but from the SVN reports I assume that the same problem will hit me with PrefsTests and RegisterTests, too. -- TWiki:Main/HaraldJoerg - 2014-06-22

Ok, this patch is too long for a comment - it is attached (%ATTACHURL%/item7525.patch). In addition to PluginHandlerTests, PrefsTests and RegisterTests it also covers EmptyTests, so that Item7523 can no longer be tested by using the example code.

-- TWiki:Main.HaraldJoerg - 2014-06-23

Summary All PluginHandlerTests fail with bad shell syntax
ReportedBy TWiki:Main.HaraldJoerg
Codebase ~twiki4
SVN Range TWiki-6.0.1-trunk, Sun, 15 Jun 2014, build 27651
AppliesTo Extension
Component UnitTests
Priority Low
CurrentState New

Checkins TWikirev:27854
TargetRelease n/a

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatpatch item7525.patch r1 manage 6.9 K 2014-06-23 - 21:30 HaraldJoerg This patch creates a test fixture for copying the TWiki web and uses this fixture in four unit tests
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r2 - 2014-06-23 - HaraldJoerg
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback