Fix tests failing due to unspecified resultset retrieval order
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest.pm
index 589f82b..f95c8e7 100644 (file)
@@ -187,6 +187,9 @@ sub _database {
         # no fsync on commit
         $dbh->do ('PRAGMA synchronous = OFF');
 
+        $dbh->do ('PRAGMA reverse_unordered_selects = ON')
+          if $ENV{DBICTEST_SQLITE_REVERSE_DEFAULT_ORDER};
+
         # set a *DBI* disconnect callback, to make sure the physical SQLite
         # file is still there (i.e. the test does not attempt to delete
         # an open database, which fails on Win32)
@@ -328,6 +331,9 @@ sub deploy_schema {
     my $schema = shift;
     my $args = shift || {};
 
+    local $schema->storage->{debug}
+      if ($ENV{TRAVIS}||'') eq 'true';
+
     if ($ENV{"DBICTEST_SQLT_DEPLOY"}) {
         $schema->deploy($args);
     } else {
@@ -356,6 +362,9 @@ sub populate_schema {
     my $self = shift;
     my $schema = shift;
 
+    local $schema->storage->{debug}
+      if ($ENV{TRAVIS}||'') eq 'true';
+
     $schema->populate('Genre', [
       [qw/genreid name/],
       [qw/1       emo  /],