[Rt-commit] rt branch, 3.9-fix-queue-caching, updated. rt-3.8.8-795-gee1a420

Kevin Falcone falcone at bestpractical.com
Thu Sep 23 17:45:26 EDT 2010


The branch, 3.9-fix-queue-caching has been updated
       via  ee1a4207cc6aed5d3a76a7a3c8315b88406e3bd8 (commit)
       via  5f4e797e5be115ec77dc6f6da5767f321015feb9 (commit)
       via  b50f3ffba9cb2cee90b41bce4f3693bbb5dbcfb9 (commit)
       via  687ca6ab7ab085382c7596fc71165c89e6728057 (commit)
      from  425c871101f3516d2aaa68e332bd9da3101c761d (commit)

Summary of changes:
 t/shredder/utils.pl                |   24 +++++++++++++++++++++++-
 t/web/dashboards.t                 |    6 +++---
 t/web/requestor_groups_edit_link.t |    2 +-
 3 files changed, 27 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 687ca6ab7ab085382c7596fc71165c89e6728057
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Sep 23 16:12:46 2010 -0400

    Start the server earlier, since it will flush an attribute cache

diff --git a/t/web/requestor_groups_edit_link.t b/t/web/requestor_groups_edit_link.t
index af5aafb..cc9467f 100644
--- a/t/web/requestor_groups_edit_link.t
+++ b/t/web/requestor_groups_edit_link.t
@@ -7,6 +7,7 @@ use RT::Test tests => 11;
 
 RT->Config->Set( ShowMoreAboutPrivilegedUsers    => 1 );
 
+my ( $url, $m ) = RT::Test->started_ok;
 my $user_a = RT::Test->load_or_create_user(
     Name     => 'user_a',
     Password => 'password',
@@ -31,7 +32,6 @@ my ($id) = $ticket->Create(
 ok( $id, 'created ticket' );
 
 
-my ( $url, $m ) = RT::Test->started_ok;
 ok( $m->login( user_a => 'password' ), 'logged in as user_a' );
 
 $m->get_ok( $url . '/Ticket/Display.html?id=' . $id );

commit b50f3ffba9cb2cee90b41bce4f3693bbb5dbcfb9
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Sep 23 16:49:45 2010 -0400

    Temporary fix for objects changing ID
    
    Now that we add a queue cache attribute, it bumps other things forward.

diff --git a/t/web/dashboards.t b/t/web/dashboards.t
index a816eb3..303d10f 100644
--- a/t/web/dashboards.t
+++ b/t/web/dashboards.t
@@ -93,7 +93,7 @@ $m->content_contains("Modify the dashboard different dashboard");
 $m->follow_link_ok({text => "Queries"});
 $m->content_contains("Modify the queries of dashboard different dashboard");
 $m->form_name('Dashboard-Searches-body');
-$m->field('Searches-body-Available' => ["search-2-RT::System-1"]);
+$m->field('Searches-body-Available' => ["search-3-RT::System-1"]);
 $m->click_button(name => 'add');
 $m->content_contains("Dashboard updated");
 
@@ -111,7 +111,7 @@ is(@searches, 1, "one saved search in the dashboard");
 like($searches[0]->Name, qr/newest unowned tickets/, "correct search name");
 
 $m->form_name('Dashboard-Searches-body');
-$m->field('Searches-body-Available' => ["search-1-RT::System-1"]);
+$m->field('Searches-body-Available' => ["search-2-RT::System-1"]);
 $m->click_button(name => 'add');
 $m->content_contains("Dashboard updated");
 
@@ -225,7 +225,7 @@ $m->content_contains("Saved dashboard system dashboard");
 $m->follow_link_ok({text => 'Queries'});
 
 $m->form_name('Dashboard-Searches-body');
-$m->field('Searches-body-Available' => ['search-7-RT::User-22']); # XXX: :( :(
+$m->field('Searches-body-Available' => ['search-8-RT::User-22']); # XXX: :( :(
 $m->click_button(name => 'add');
 $m->content_contains("Dashboard updated");
 

commit 5f4e797e5be115ec77dc6f6da5767f321015feb9
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Sep 23 17:08:14 2010 -0400

    This needs a cache flush
    
    We're forking and making a new dbh, so we need to destroy attributes.

diff --git a/t/shredder/utils.pl b/t/shredder/utils.pl
index b05b42a..f304311 100644
--- a/t/shredder/utils.pl
+++ b/t/shredder/utils.pl
@@ -293,6 +293,7 @@ sub restore_savepoint { return __cp_db( savepoint_name( shift ) => db_name() ) }
 sub __cp_db
 {
     my( $orig, $dest ) = @_;
+    delete $RT::System->{attributes};
     $RT::Handle->dbh->disconnect;
     # DIRTY HACK: undef Handles to force reconnect
     $RT::Handle = undef;

commit ee1a4207cc6aed5d3a76a7a3c8315b88406e3bd8
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Sep 23 17:45:23 2010 -0400

    Add a new method to exclude things from the shredder diff
    
    Attributes can change when you create a new queue, so ignore
    the specific Attributes.  We should really be testing that deleting a
    queue remotes the globally cached subjecttag too, but that was out of
    scope for this branch.

diff --git a/t/shredder/utils.pl b/t/shredder/utils.pl
index f304311..c95dcdd 100644
--- a/t/shredder/utils.pl
+++ b/t/shredder/utils.pl
@@ -338,7 +338,7 @@ sub dump_sqlite
     my $res = {};
     foreach my $t( @tables ) {
         next if lc($t) eq 'sessions';
-        $res->{$t} = $dbh->selectall_hashref("SELECT * FROM $t", 'id');
+        $res->{$t} = $dbh->selectall_hashref("SELECT * FROM $t".dump_sqlite_exceptions($t), 'id');
         clean_dates( $res->{$t} ) if $args{'CleanDates'};
         die $DBI::err if $DBI::err;
     }
@@ -347,6 +347,27 @@ sub dump_sqlite
     return $res;
 }
 
+=head3 dump_sqlite_exceptions
+
+If there are parts of the DB which can change from creating and deleting
+a queue, skip them when doing the comparison.  One example is the global
+queue cache attribute on RT::System which will be updated on Queue creation
+and can't be rolled back by the shredder.  It may actually make sense for
+Shredder to be updating this at some point in the future.
+
+=cut
+
+sub dump_sqlite_exceptions {
+    my $table = shift;
+
+    my $special_wheres = {
+        attributes => " WHERE Name != 'QueueCacheNeedsUpdate'"
+    };
+
+    return $special_wheres->{lc $table}||'';
+
+}
+
 =head3 dump_current_and_savepoint
 
 Returns dump of the current DB and of the named savepoint.

-----------------------------------------------------------------------


More information about the Rt-commit mailing list