I created this page to collect all ideas how to improve
testenv script in a way it will solve all problems for us and will automagically answer all questions
OK. Simple question which are easy to detect. If
testenv script grows too big, we could possibly to split part of it, expecting that issues detected by previous run are fixed, into
testenvadv (as for advanced) or something. I linked this page to pages before reporting bug or asking for support. Supposedly, downloading newest
testenv from
CVSget:bin/testenv
will be in time able to detect all common problems.
Driving idea is: Maybe [put your problem here] is obvious for gurus, but we have a program to check for it - so even newbie admins will be able to install TWiki. If it was asked as support question and
could be automated, it
should.
Suggested
Test the environment
Catch incorrect permissions in /data
I don't know if I missed a line in the instructions or not, but I spent quite a while troubleshooting a permissions problem. After some real-time troubleshooting, Martin Cleaver (thanks Martin!) correctly suggested I issue this command:
chmod a+x /home/httpd/twiki/data/*
Seems like testenv could usefully check for this.
TimothyMansfield - 05 Oct 2003
Testenv does try to create a file in the
data directory to check that it's writeable - did that not produce an error message? It's tough to automatically correct permissions problems, as they depend on the particular environment you are in (e.g. with
SecureSetup using
suexec, a similar command could introduce a security hole) and on the site's security policy.
--
RichardDonkin - 06 Oct 2003
Test for installed Net::SMTP and the existance of /usr/bin/sendmail
I was working on Cygwin and hadn't got either installed... --
MartinCleaver - 11 Jul 2003
- Testing for Net::SMTP should already happen, near the top where all modules are tested - Net::SMTP is considered mandatory on Windows but not on other platforms. --RD
test a working mail-out
It would be useful to test that the mailing out functions are working properly. To do this, testenv could present a link that calls the
TWikiFunc mail sub in such a way that any errors encountered are made visible on screen. I suspect that my mail outs are failing because I need to authenticate with the mail server, but I currently get no feedback, not even in debug.txt or warning.txt
--
MartinCleaver - 09 Jul 2003
- You mean actually send email? That will certainly be useful. -- PeterMasiar - 10 Jul 2003
- Good idea, but would have to be done through a form, or perhaps by a URL to Edit a page in Sandbox, with instructions (to testenv user) to register a new user. If it's just done through a normal GET URL, web crawlers could very easily generate emails... [ RichardDonkin 10 Jul 2003 ]
- ...like "click a button to send email to WIKWEBMASTER" -- PeterMasiar - 11 Jul 2003
Execute & compare test vectors
- testenv could incorporate a simple web client and fetch the WebHome or other pages, then compare to the golden version.
- this would "close the loop" on the system test: actually using a browser to verify pages are loaded properly.
- The release could include a few pre-rendered pages as the 'golden standard' test vector.
- Likely error detection would use diff, but the differences would really be obvious (i.e. either a 404, 401, or the correct page rendering).
--
JonathanCline - 11 Sep 2003
- Excellent idea - see UnitTesting for discussion of automated testing from developer perspective. This would be best implemented as a separate tool, since you don't necessarily want to run it from a browser and the tests could take some time - however,
testenv could link to a browser-based version of the test tool (i.e. reporting results to a browser page). Since some web hosts don't provide Telnet/SSH access, this might be useful.
--
RichardDonkin - 11 Sep 2003
Support detection of modules required by plugins
At the moment when I do a fresh install, I always edit testenv and add the modules required by the plugins I'm installing to the optionalModules list. Help a lot when debugging. it would be nice if there was some way to automate this, for example if a plugin installs a
pluginname.testenv file somewhere (bin/plugins?)
--
CrawfordCurrie - 23 Jan 2004
Hook Plugins to testenv
Looks like it would be beneficial to add a
PluginHookToTestenv - this would allow people to innovate functionality for testenv and for plugins to indicate that they are starting up properly. It could also be used to invoke plugins test harnesses.
--
MartinCleaver - 23 Jan 2004
i would put this proposed
pluginname.testenv file somewhere within
lib/TWiki/Plugins or better yet (?) within the actual plugin .pm file. the standardized test function name (say,
testenv() ?) should be in its own namespace ( eg,
TWiki::Plugins::ImageGalleryPlugin::TestEnv ), especially as the
testenv() function may need support functions, and they shouldn't be visible within the normal namespace of the plugin.
--
WillNorris - 24 Jan 2004
Please, please, please can we get this done some time soon? --
CC
Detect missing setlib.cfg
I copied beta code without setlib.cfg and spent some time figuring out what is wrong, because testenv run OK. Now I know better. Hope testenv will soon be able to detect stupid mistakes like this.
I checked code and it does check for the presence of setlib.cfg, but if not there, does not report any warning. But standard scripts do require it: my modules are in ../lib as in
AthensRelease, and Twiki does not run without setlib.cfg.
--
PeterMasiar - 13 May 2003
- Good idea, but the reason for this is so that testenv can run on pre-Feb 2003 releases of TWiki, where this file doesn't exist. The betas should always include the setlib.cfg file so I think this is not a very common problem, and the scripts themselves should give an error in the browser due to the library path being wrong. -- RichardDonkin - 14 May 2003
- Can testenv give a warning? script crashes without nice error message. At least for me it was not obvious that cause is missing
setlib -- PeterMasiar - 14 May 2003, 11 Jul 2003
- Also, I bet a common gotcha is LibsNotFound - that the user has a relative path in setlib.cfg; testenv should warn against this.
- If its supposed to exist, then a log message should appear somewhere (e.g. warning.txt) if authentication is tried but fails. -- MartinCleaver - 11 Jul 2003
Indicate what to do if the path info test fails
If this has been a problem for you, please log a question in
TWiki:Support
- I haven't seen any problems in this area recently, but it would require a code fix to TWiki so putting a resolution into
testenv would not really be possible.
UPDATE:
Support.DirectoryDoesNotExist, which prompted this suggestion, was not in fact a PATHINFO problem, as the testenv output quickly established

So I don't think there's a need for a new feature here - the testenv output showed that PATHINFO was working but the person installing thought that it was not, due to unrelated errors.
--
RichardDonkin - 17 Jul 2003
For the longest time (over a year) I thought my path_info was failing because I was looking at the
address bar and expecting
it to change to
http://example.com/foo/bar
which of course it never did. I've tried reworking the explanatory paragraph to avoid this confusion but didn't come up with anything better than you have already. Maybe others will have better luck.
--
MattWilkie - 24 Jul 2003
Any suggestions on improved text are welcome... The test is really just to see how frequent PATHINFO bugs are - the code fix in TWiki.pm a while back seemed to fix virtually all of these, so it's not a live issue these days (as far as I can tell).
--
RichardDonkin - 25 Jul 2003
Improve detection of diff that's used by RCS
Should do a
strings `which ci` | grep /diff to get something like
/usr/bin/diff and then run that program to detect GNU diff.
RCS has a built-in path to
diff so checking the PATH environment variable is misleading (though this could be used as a fallback if not on Unix/Linux/Cygwin).
--
RichardDonkin - 03 Sep 2003
Determine if data files are locked by correct user
Several people have been bitten by the fact that
RCS files are shipped locked by "nobody". Testenv should be able to detect this, and direct the user to the correct script to run in case a problem is found. --
CrawfordCurrie - 28 Apr 2004 (on behalf of a lot of people)
Describe the environment
Display version of testenv
so we can ask to add full testenv output and be sure that correct/most recent version is used
Include a summary of the information required for support questions by SupportGuidelines
When raising a question on the support web, there is some standard information requested.
- TWiki version:
- Perl version:
- Web server & version:
- Server OS:
- Web browser & version:
- Client OS:
It would be nice if the testenv output had a support info section that had all of this information ready to be cut-and-paste'd into a support question.
--
ScottGargash - 27 Jun 2003
Scott, this is a very good idea. I strongly second the request.
--
MattWilkie - 28 Jun 2003
Show (link to?) debug.txt and warning.txt
This would encourage people to look at these files and maybe manage them when they get too big
--
MartinCleaver - 09 Jul 2003
- Will it be a security risk to place debug.txt in
pub directory and link to it from some page like AdminTools?
- Martin, you are right! Mine was > 1MB
-- PeterMasiar - 10 Jul 2003
- It may be more useful to do something like AdminTools that makes it easy to navigate to the debug.txt and so on. [ RichardDonkin 10 Jul 2003 ]
Show whether you are using RcsLite
- Indeed, it could show a summary of all these variables (it would be much easier if they were stored in a hash) -- MartinCleaver - 11 Jul 2003
- Maybe even viewauth/pub/symlink-to-twiki.cfg? Or is it too much, too convenient for crackers? -- PeterMasiar - 11 Jul 2003
- On some systems (TWikiDotOrg for example), the admin has removed the testenv script. I think that is the way to go, or make it require the TWikiAdminGroup user or an equiv testable by .htaccess. Have testenv capable of showing TWiki.cfg (and debug.txt, warnings.txt) and also have a button to clean those 8,500 data/.session files sat on your machine. -- MartinCleaver - 15 Jul 2003
- It is useful to be able to see how the variables end up getting expressed. TWikiVariables shows useful variables such as , guest and TWikiGuest. -- MartinCleaver - 11 Jul 2003
Give a 'passed' or 'with warnings' or 'failed' response
Reading
BinaryFilesDifferMessage, I think it would be good to have testenv be completely explicit as to the state of whether
testenv passed.
--
MartinCleaver - 24 Jul 2003
I'm not sure this is really possible - some of the warnings can be ignored (e.g. if you don't want
I18N) depending on the administrator's goals. Also, the 're-lock your files' test can't be made to pass in most cases - it just warns you to do the re-locking if you haven't already done it. I suppose we could put in a test
TWiki:TWiki
page that is the canary - if it's been re-locked then we assume the whole thing is re-locked. It would be cleaner to just get rid of locking as in
RcsNonStrictLocking, though.
--
RichardDonkin - 25 Jul 2003
Test for the presence of the named .htpasswd file
If it is named incorrectly then all attempts to login fail, but registration works. Seems very mysterious until one realises their (my) stupid mistake
--
MartinCleaver - 15 Jul 2004
Implemented
CGI script user is sometimes wrong
On my site
http://maphew.freeshell.org/
testenv reports that scripts run as
root ,however they actually run as
nobody. I always thought this was a peculiarity of that hosting service, however at least two others have a similar experience with different server setups:
RCSRelatedWarningOnXpforTestenv.
--
MattWilkie - 07 Jul 2003
Solved - seems to mainly occur on Unix variants. I've also commented on
RCSRelatedWarningOnXpforTestenv, which I think is a different issue.
--
RichardDonkin - 07 Jul 2003
Append .exe bug fixed
See
OnWindowsShouldAppendDotExe - a bug relating to users of
ActivePerl with non-upgrade installs of TWiki was fixed recently in CVS. See
CVSget:bin/testenv
for latest version, as always.
--
RichardDonkin - 25 Jul 2003
mod_perl version detected and CGI.pm version recommended
Implemented as part of recommending
CGI.pm for mod_perl 2.0 users on Apache 2.0 - see
ModPerlOnRedHat80.
--
RichardDonkin - 30 Jul 2003
A very small addition, but a big usability win, would be to link to the front page of the twiki from somewhere in the testenv output page. Next to the link to the installation docs looks like a good place to me. --
MattWilkie - 14 Jan 2005
Implemented in
SVN Develop with some typo fixes. Hope this doesn't make people click through to
WebHome too quickly, but we shall see. BTW this patch was reversed - you need to specify old file first on command line to get a 'forward' patch, but
patch automatically detects this so it's not a big deal.
--
RichardDonkin - 14 Jan 2005
Have now done an
ImproveTestenv in
SVN to check for GNU patch, as well as egrep, fgrep and diff. All you
TWikiOnSolaris users, please try
SVNget:bin/testenv
(
DevelopBranch but will work fine on mainline TWikis including all older ones, I hope).
I have also put a comment in on the
$lsCmd test for TWikis post 01 Sep 2004 saying it's no longer needed - need to be able to check
TWikiVersion string, so it's important it is simple and fixed format...
--
RichardDonkin - 14 Jan 2005
To move to suggestions:
don't try to set Locale if $useLocale is 0
I have $useLocal set to 0; Twiki.cfg claims that $SiteLocale is "Ignored if $useLocale is 0.". However, testenv isn't ignoring it and I get a warning:
Warning: Unable to set locale to en_US.ISO-8859-1, actual locale is C - please test your locale settings.
I shouldn't get a warning; testenv should print "This test is ignored" --
SomeoneElse (Peter Masiar?)
This needs to mirror the code in
TWiki.pm - some of the logic is different. However, I don't want to stop giving a warning on broken locales, as this is useful information and might get some ISPs or corporate administrators to fix broken locales, which are very prevalent unfortunately. I should say 'this warning can be ignored' though.
By the way, I'm very happy for people to submit
patches following
PatchGuidelines for this or any other testenv improvements! Get your coding fingers into action...
--
RichardDonkin - 03 Sep 2003
Implemented in modified form, but still need to support
$localeRegexes = 0 mode. I've clarified the wording on the locale test - it still produces a warning but says you can ignore the error if you are not using locales. Now in CVS (
TWikiAlphaRelease).
--
RichardDonkin - 06 Oct 2003
At least warn that debug.txt is being written to.
I've just deleted four debug.txt files of sizes 2573573, 4131257, 903332 and 376942
Whilst it would be nice to have a proper management console the minimum to do is to warn on testenv that debug can be off for production systems!
Not a bad idea, but I'd rather start creating even a simple management console tool rather than put operational checks into testenv - it's already quite bloated and should really stay focused on installation issues IMO.
--
RichardDonkin - 07 Oct 2003
Diagnostics are available for plugins - testenv should point to them
See
InstalledPlugins for details via the %!FAILEDPLUGINS% directive.
Moved
Discussion of testing the user/password setup has been moved to
SecurityTestScript.
--
RichardDonkin - 15 May 2003
Discussion
Small bug in the add-view patch: if the "right here" link is clicked after the path-info test is done the link goes to ./foo/view instead ./view.
--
MattWilkie - 20 Jan 2005
I recently install 2 twikis (2 boxes Ubuntu Dapper & SUSE 9) and both have problem because doesn't instantiate Maketext. I read in some place that TWiki run in SUSE out of the box but I've 3 days trying to resolve Maketext problems. I believe that testenv may help detecting this kind of dependency problems, I actually receive All Modules OK (
MaketextUndefinedAtAccess)
--
ManuelSoto - 26 Apr 2006
testenv is deprecated (and actually removed) in TWiki4. It was replaced by
configure that has the same functionality and more
--
RafaelAlvarez - 27 Apr 2006