Closed Bug 370120 Opened 17 years ago Closed 17 years ago

Install doesn't support $PROJECT variable

Categories

(Testopia :: General, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: david, Assigned: gregaryh)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/418.9.1 (KHTML, like Gecko) Safari/419.3
Build Identifier: 1.1.3

Testopia needs to support the $PROJECT environment variable as used within Bugzilla 2.22.2. This permits multiple database setups, localconfig, and template entries from a single Bugzilla install. Testopia currently has variables for a single database and templates. See http://www.bugzilla.org/docs/2.22/html/x763.html for more information.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Severity: normal → major
OS: Mac OS X → All
Hardware: Macintosh → All
Testopia doesn't access localconfig directly. It also doesn't create template files. This is done during the untarring of the installation files. I don't understand how Testopia would use the $PROJECT variable, but then I was not aware that this option existed. 

If you copy the template files from template/en/default/testopia to your project location, that should be the only necessary step as far as I can tell.
If you look into the use of the $PROJECT variable, you'll see that it's used to support a single codebase with multiple configurations. Note that the tr_install.pl script looks for a copy of "localconfig" at line 39 which will fail in this case. I don't know if there are any other assumptions in the code on things like database definition. With this variable defined, it's common to have multiple databases, user, passwords, etc.

Also, there is not a single place to copy the templates. My Bugzilla template directory looks like:

template/en/project1
template/en/project2
template/en/project3
...
I fixed tr_install.pl to work as I described. Here are the changed lines starting from line 39. I have not made any changes for handling the template files.

# use localconfig file default or as specified by $PROJECT variable
our $project;
our $localconfig;
if ($ENV{'PROJECT'} && $ENV{'PROJECT'} =~ /^(\w+)$/) {
    $project = $1;
    $localconfig = "localconfig.$project";
} else {
    $localconfig = "localconfig";
}

if (! -e "$localconfig") {
  DieWithStyle("Can't find file: $localconfig\nBugzilla is not installed in this directory.\n".
    "Can't continue.\n");
}

##############################################################################
print "Now installing Testopia using $localconfig...\n\n";
do "$localconfig";
##############################################################################
This looks good. I see now what you were talking about. After digging around a bit I think this is the only place that localconfig would be accessed directly by Testopia. 

Can you attach the above code as a unified diff (diff -u)? I can then patch it in.
As for the templates, I think it would be a simple matter of copying the files to the appropriate location. This would be simple to add to the script. If you don't want to take the time then I will look into it after this is patched in.

Thanks for putting in the effort.
Code still needs to be patched to support template loading using $PROJECT variable.
It appears that checksetup does not copy templates either. We could check for the existence of a project template directory, but I think it will be assumed you need to copy them manually as you did with the initial bugzilla setup if you want to customize them. 

patch by David Multer r=ghendricks a=ghendricks
    Checking in tr_install.pl;
    /cvsroot/mozilla/webtools/testopia/tr_install.pl,v  <--  tr_install.pl
    new revision: 1.19; previous revision: 1.18
    done
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: