[Rt-commit] [rtir] 04/04: Run RT upgrade steps on the database snapshot in the upgrade test
Shawn Moore
shawn at bestpractical.com
Thu May 12 18:35:16 EDT 2016
This is an automated email from the git hooks/post-receive script.
shawn pushed a commit to branch 3.4/upgrade-test-failures
in repository rtir.
commit 6efbb14ce7920859a916e00c945330e5351d9139
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Thu May 12 22:31:33 2016 +0000
Run RT upgrade steps on the database snapshot in the upgrade test
Otherwise we're trying to run modern RT code with an ancient RT
database, which goes poorly.
Fixes: I#31745
---
t/upgrade/2.6.0-to-2.9.0.t | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/t/upgrade/2.6.0-to-2.9.0.t b/t/upgrade/2.6.0-to-2.9.0.t
index 6a9dac5..e7ee723 100644
--- a/t/upgrade/2.6.0-to-2.9.0.t
+++ b/t/upgrade/2.6.0-to-2.9.0.t
@@ -8,11 +8,30 @@ BEGIN { unless ( $ENV{RTIR_TEST_UPGRADE} ) {
Test::More->import( skip_all => "Skipping upgrade tests, it's only for developers" );
} }
+BEGIN { unless ( -d "../rt/etc/upgrade/" ) {
+ require Test::More;
+ Test::More->import( skip_all => "Skipping upgrade tests, must have a sibling ../rt/ directory for running upgrades" );
+} }
+
use RT::IR::Test tests => undef;
+use Sort::Versions;
+
{
RT::IR::Test->import_snapshot( 'rtir-2.6.after-rt-upgrade.sql' );
- my ($status, $msg) = RT::IR::Test->apply_upgrade( 'etc/upgrade/', '2.9.0' );
- ok $status, "applied upgrade" or diag "error: $msg";
+
+ # upgrade database for RT 4.2.0 on
+ for my $version (sort { versioncmp($a, $b) } map { m{upgrade/([\w.]+)/} && $1 } glob('../rt/etc/upgrade/4.*/')) {
+ next if versioncmp($version, '4.2.0') == -1;
+ next if versioncmp($version, $RT::VERSION) == 1;
+
+ my ($status, $msg) = RT::IR::Test->apply_upgrade( '../rt/etc/upgrade/', $version);
+ ok $status, "applied RT $version upgrade" or diag "error: $msg";
+ }
+
+ {
+ my ($status, $msg) = RT::IR::Test->apply_upgrade( 'etc/upgrade/', '2.9.0' );
+ ok $status, "applied RTIR 2.9.0 upgrade" or diag "error: $msg";
+ }
}
my @state_cf_ids;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the rt-commit
mailing list