more upgrades progress
This commit is contained in:
parent
00b3113031
commit
adf3dbbe04
17 changed files with 90 additions and 24 deletions
20
t/Upgrade.t
20
t/Upgrade.t
|
|
@ -14,11 +14,6 @@ use Test::MockObject::Extends;
|
|||
use File::Temp;
|
||||
use File::Path qw(make_path);
|
||||
|
||||
BEGIN {
|
||||
$INC{'WebGUI.pm'} = 1;
|
||||
$WebGUI::VERSION = '8.4.3';
|
||||
}
|
||||
|
||||
use WebGUI::Paths;
|
||||
use WebGUI::Upgrade;
|
||||
use WebGUI::Session::Id;
|
||||
|
|
@ -37,6 +32,13 @@ our $configFile = WebGUI::Test->config->getFilename;
|
|||
|
||||
my $upgrade = Test::MockObject::Extends->new('WebGUI::Upgrade');
|
||||
$upgrade->set_always('getCurrentVersion', '8.0.0');
|
||||
$upgrade->set_always('getCodeVersion', '8.4.3');
|
||||
|
||||
{
|
||||
no warnings 'redefine';
|
||||
*WebGUI::Paths::upgrades = sub { collateral('Upgrade', 'non-existant') } ;
|
||||
}
|
||||
ok ! try { $upgrade->calcUpgradePath('8.0.0', '8.4.3'); 1 }, "calcUpgradePath dies when upgrades path doesn't exist";
|
||||
|
||||
{
|
||||
no warnings 'redefine';
|
||||
|
|
@ -65,9 +67,11 @@ capture {
|
|||
};
|
||||
|
||||
$upgrade->called_pos_ok(1, 'getCurrentVersion');
|
||||
$upgrade->called_pos_ok(2, 'runUpgradeFile');
|
||||
my $upgradeFile = $upgrade->call_args_pos(2, 4);
|
||||
ok $upgradeFile =~ /\b00_simple\.pl$/, 'correct upgrade file run';
|
||||
SKIP: {
|
||||
$upgrade->called_pos_ok(2, 'runUpgradeFile') || skip 'upgrade not run', 1;
|
||||
my $upgradeFile = $upgrade->call_args_pos(2, 4);
|
||||
ok $upgradeFile =~ /\b00_simple\.pl$/, 'correct upgrade file run';
|
||||
}
|
||||
|
||||
$upgrade->clear;
|
||||
$upgrade->unmock('runUpgradeFile');
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
my $c = collateral;
|
||||
|
||||
::isa_ok $c, 'Path::Class::Dir';
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
::is config->getFilename, $::configFile, 'config function works correctly';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
my $totalAssets = dbh->selectrow_array('SELECT COUNT(*) FROM asset');
|
||||
::is $totalAssets, $::totalAssets, 'dbh function working correctly';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
die "Upgrade failure\n";
|
||||
|
||||
|
|
|
|||
0
t/supporting_collateral/Upgrade/impossible/.exists
Normal file
0
t/supporting_collateral/Upgrade/impossible/.exists
Normal file
|
|
@ -1,3 +1,4 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
report 'Simple Output';
|
||||
|
||||
done;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
::addToCleanup(version_tag);
|
||||
|
||||
import_package('test-template.wgpkg');
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
rm_lib 'WebGUI::Upgrade::Test::Module';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
my $s = session;
|
||||
::isa_ok $s, 'WebGUI::Session';
|
||||
::is $s, session, 'session properly cached';
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
$variable = "value";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
report "Simple Upgrade Step";
|
||||
done;
|
||||
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::Asset::Snippet;
|
||||
WebGUI::Asset->getRoot(session)->addChild({
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
my $vt = version_tag;
|
||||
::addToCleanup($vt);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue