ModelSEED / Model-SEED-core

The Model SEED is a tool for building, curating, and analyzing gonome-scale metabolic models. Visit the Model SEED homepage for installation instructions and full feature documentation.
http://bionet.mcs.anl.gov/index.php/Model_SEED_Homepage
Other
19 stars 10 forks source link

Problem with TestingHelper.pm in windows #30

Closed cshenry closed 12 years ago

cshenry commented 13 years ago

So the code below does not work in windows for a variety of reasons. I am proposing we include ModelDB.db in the test data directory instead of the sql file. Would this cause problems? I also suggest adding the test directory to the standard flatfile install so it's immediately in place for tests to be performed on a fresh installation. We'll need some way of indicating when an data update would be run. This is something to think about.

TestingHelper.pm: line 182... if ( !-d $TestDataDir ) {

If we don't have the database try to download it

    # Fail if we are still unable to get the database.
    if ( !-f "$dataDir/TestDB.tgz") {
        system("curl $TestDbURL 2> /dev/null > $dataDir/TestDB.tgz");#Note, this does not work in windows...
        if (!-f "$dataDir/TestDB.tgz") {
            ModelSEED::FIGMODEL::FIGMODELERROR("Unable to copy TestDB.tgz from $TestDbURL");
        }
    }
    mkdir $TestDataDir;
    system("tar -xzf $dataDir/TestDB.tgz -C $TestDataDir");#Note, this does not work in windows...
    if( !-d "$TestDataDir/data/ModelDB" || !-f "$TestDataDir/data/ModelDB/ModelDB.sqlite") {
        ModelSEED::FIGMODEL::FIGMODELERROR("TestDB.tgz does not look like I expected!");
    }
    system("sqlite3 $TestDataDir/data/ModelDB/ModelDB.db < $TestDataDir/data/ModelDB/ModelDB.sqlite");
} 
devoid commented 13 years ago

@cshenry For tar: Archive::Tar is a core module; does it work in Windows?

For curl: LWP::Simple is already required by FIGMODEL; I'm assuming it works?

cshenry commented 13 years ago

It's the "2> /dev/null " part that doesn't work in windows.

For some reason, tar doesn't work because it want's to spawn a child process... it's a pain... not sure how to resolve it.

devoid commented 13 years ago

I've created a test branch using Archive::Tar and LWP::Simple at https://github.com/devoid/Model-SEED-core/tree/TestingHelper-win-fix

Try checking that out and let me know if it works.

devoid commented 12 years ago

Closing this issue because TestingHelper will no longer dl a ModelDB database.