[Support] Package Manager mod install, Test Failed error

Started by Rumbaar, March 15, 2009, 05:42:27 PM

Previous topic - Next topic

Rumbaar

So you're installing that new mod and all things are going well, then you get a Test Failed warning on one or more files on your forum and the Package Manager advices you not to proceed.  This can make the automated process longer, but it isn't the end of the world and more importantly doesn't mean you possible can't run/install that mod into your forum.

Now there are a few Test Failed errors you can safely ignore, which in an ideally configured mod you shouldn't see in the first place, and these related to alternate language files that you might not use on your forum.  So if you get a Test Failed error relating to a language you don't use, will never use or don't have installed then you can safely ignore and proceed with installation.  The Package Manager will just ignore that file and proceed with the normal installation without affecting the rest of the mod.

Example:
1.  Execute Modification  ./Sources/ManageRegistration.php  Test successful
2. Execute Modification ./Sources/Register.php Test Failed
3. Execute Modification ./Themes/default/Register.template.php Test successful
4. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
5. Execute Modification ./Themes/default/languages/Modifications.english-utf8.php Test Failed
6. Execute Modification ./Themes/default/languages/Modifications.english_british.php Skipping file

1. 3. 4. Test passed no problems, 2. Test Failed issue to manually fix, 5. Test failed but if not using that language can be ignored, 6. Skipped and correct way for a mod creator to handle no standard language files.

It helps to understand why you get these Test Failed errors as well, so you can know how to deal with any other errors you might get in the future.  The Package Manager takes an installation file for the modifications it needs to make and uses a defined section of code usually present in the base install of the file to find the appropriate place to make the needed changes.  Now if via a previous mod install or manual edit to that file the section of code has been changed then the Package Manager can no longer find it to perform the automated process.

Now this fail can be on a single character different or even an extra space, as the Package Manager can't roughly guess when dealing with your forums code, it has to be exact or it will err on the side of caution and not proceed for that file/s.  As you may install more and more mods, this kind of situation will become more regular as common sections of code and files are modified from their original base code.

Okay now on to how to deal with this situation.  Currently for 1.1.x Mods only (as standard) install into the default CORE theme and core files, but with 2.x it will at time of install try and make the changes to all applicable themes installed at the time.  Either way this can still result in Test Fail errors on custom themes or core files that can be dealt with the same way.

At that Test Failed stage make a note of the file/s in question, and then cancel the installation process at this point.  These will need to be manually edited to include the mod code.  This can be the tricky part, but it's not that tricky in most cases.  Via FTP (FileZilla is a free FTP client) connect to your host and download all the noted Test Failed files to your local computer.  This will allow you to back them up and edit them directly.  When editing your forums files be sure to use a decent text editor, and there are a few out there, though I recommend Notepad++.

You can actually look at the installation .mod/.xml file for the mod, via download, unzip and view in a text editor but the next process of using a parser is easier and more straight forward.

For the mod in question go to the download section for it on the Customize section of this site and run the it through the (parser) Manual Install Instructions for SMF for the version of SMF you are running.  This will give you step by step instructions on all the files affected by that mod.  Now you only have to concentrate on the files that you have had a Test Failed warning for, as all the others will be handled by the Package Managers automated installation process once we proceed with installation again.

This thread can also help with instructions on manual editing of files: Manual Installation of Mods.

The tricky part might be finding exactly where the code needs to be added, as if the sections have been modified so much the automated process can't find it you might not be able too yourself.  Also due to the random nature of this there can't be a definite solution to this, just use best judgment and try to see where it's trying to put in into the fresh version of the file.  You can compare the correct location in an unedited file (download Large Upgrade version and extract) to help you find the correct location in your current file.  This can help when dealing with a custom theme as well, look to see how it's done in the Default CORE theme and then try and find the correct location based on that guide.

Now once you've added the appropriate code to those locally downloaded Test Failed file/s, and you've checked them 100% for correct coding, you can proceed.  It's best to keep a backup of the old files for ease of restore if anything goes wrong.  Timing is the key to the next part.

Run the apply installation part for the mod in question again and make sure the same files have the Test Failed error and no new ones have popped up.  If all is the same proceed with the installation ignoring the error. It will install the mod into all those passed files and do nothing with the Test Failed ones.  If you have new error files you'll need to make the manual edits to those files as well, using the previous instructions.  Then immediately via your FTP client upload all those manually edited files to override the current files.

Now as long as all the automated installation has been 100% successful and you've uploaded those manual files the mod in questions will now be fully functional for your forum and you'll be able to use it's new functionality.

This is also the same process, though in reverse, you need to do if you are trying to uninstall a mod and get the Test Failed error on file/s.

Note:  The order of installation is important if Test Failed errors are encounted.  As the package manager may still attempt to install partial code into those files that fail.  With 2.0 the Package Manager is able to highlight the exact code it is having issues with.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Advertisement: