fix upgrade tests
This commit is contained in:
parent
7e5d3627e1
commit
b5542c9902
7 changed files with 9 additions and 9 deletions
|
|
@ -346,7 +346,7 @@ sub runUpgradeFile {
|
|||
my ($configFile, $version, $filename) = @_;
|
||||
my $has_run = $self->_files_run->{ Cwd::realpath($filename) } ++;
|
||||
|
||||
try {
|
||||
return try {
|
||||
my $upgrade_class = $self->classForFile($filename);
|
||||
my $upgrade_file = $upgrade_class->new(
|
||||
version => $version,
|
||||
|
|
@ -361,12 +361,12 @@ sub runUpgradeFile {
|
|||
catch {
|
||||
when (/^No upgrade package/) {
|
||||
warn $_;
|
||||
return;
|
||||
}
|
||||
default {
|
||||
die $_;
|
||||
}
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
=head2 classForFile ( $file )
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ use Capture::Tiny qw(capture);
|
|||
local *WebGUI::Paths::siteConfigs;
|
||||
local *WebGUI::Paths::upgrades;
|
||||
|
||||
our $configFile = WebGUI::Test->config->getFilename;
|
||||
our $configFile = WebGUI::Test->config->pathToFile;
|
||||
{
|
||||
no warnings 'redefine';
|
||||
*WebGUI::Paths::siteConfigs = sub { $configFile };
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
::is config->getFilename, $::configFile, 'config function works correctly';
|
||||
::is config->pathToFile, $::configFile, 'config function works correctly';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
report 'Simple Output';
|
||||
start_step 'Simple Output';
|
||||
|
||||
done;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
::addToCleanup(version_tag);
|
||||
::addToCleanup('WebGUI::VersionTag', version_tag->getId);
|
||||
|
||||
import_package('test-template.wgpkg');
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ WebGUI::Asset->getRoot(session)->addChild({
|
|||
});
|
||||
my $vt = WebGUI::VersionTag->getWorking(session, 'nocreate');
|
||||
if ($vt) {
|
||||
::addToCleanup($vt);
|
||||
::addToCleanup('WebGUI::VersionTag', $vt->getId);
|
||||
}
|
||||
$vt;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use WebGUI::Upgrade::Script;
|
||||
my $vt = version_tag;
|
||||
::addToCleanup($vt);
|
||||
::addToCleanup('WebGUI::VersionTag', $vt->getId);
|
||||
|
||||
::isa_ok $vt, 'WebGUI::VersionTag';
|
||||
::is $vt->get('name'), 'Upgrade to 8.3.0 - versiontag', 'auto-naming with short name works';
|
||||
|
|
@ -9,7 +9,7 @@ my $vt = version_tag;
|
|||
::ok ! $vt->get('isCommitted'), '... and doesn\'t commit version tag';
|
||||
|
||||
my $vt2 = version_tag 'Adding This Stuff';
|
||||
::addToCleanup($vt);
|
||||
::addToCleanup('WebGUI::VersionTag', $vt2->getId);
|
||||
::ok $vt->get('isCommitted'), 'Request for new version tag commits previous tag';
|
||||
::is $vt2->get('name'), 'Upgrade to 8.3.0 - Adding This Stuff', 'explicit name used correctly';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue