[libdbix-class-perl] 01/02: Add patch from upstream Git repo
gregor herrmann
gregoa at debian.org
Sun Nov 15 22:31:25 UTC 2015
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to branch master
in repository libdbix-class-perl.
commit c86c6b55454059c81f77b1f1fef8484f9b2b1bd3
Author: gregor herrmann <gregoa at debian.org>
Date: Sun Nov 15 23:28:28 2015 +0100
Add patch from upstream Git repo
which fixes the test on newer libsqlite versions, and demotes it to an
author test.
Closes: #805233
---
...-dependency-tests-to-work-on-newer-libsql.patch | 253 +++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 254 insertions(+)
diff --git a/debian/patches/0001-Adjust-view-dependency-tests-to-work-on-newer-libsql.patch b/debian/patches/0001-Adjust-view-dependency-tests-to-work-on-newer-libsql.patch
new file mode 100644
index 0000000..204c910
--- /dev/null
+++ b/debian/patches/0001-Adjust-view-dependency-tests-to-work-on-newer-libsql.patch
@@ -0,0 +1,253 @@
+From 26c663f123032941cb3f61d6cd11869b86716d6d Mon Sep 17 00:00:00 2001
+From: Peter Rabbitson <ribasushi at cpan.org>
+Date: Tue, 3 Nov 2015 14:35:35 +0100
+Subject: [PATCH] Adjust view-dependency tests to work on newer libsqlite
+
+The test and mechanism behind it is largely useless in these cases, but old
+sqlite installations will lurk around for ever, so keep the check while moving
+it to xt/
+
+
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=107852
+Origin: https://github.com/dbsrgits/dbix-class/commit/26c663f1
+Bug-Debian: https://bugs.debian.org/805233
+
+--- a/t/105view_deps.t
++++ /dev/null
+@@ -1,115 +0,0 @@
+-#!/usr/bin/perl
+-
+-use strict;
+-use warnings;
+-
+-use Test::More;
+-use Test::Exception;
+-use Test::Warn;
+-use lib qw(t/lib);
+-use DBICTest;
+-use ViewDeps;
+-use ViewDepsBad;
+-
+-BEGIN {
+- require DBIx::Class;
+- plan skip_all => 'Test needs ' .
+- DBIx::Class::Optional::Dependencies->req_missing_for('deploy')
+- unless DBIx::Class::Optional::Dependencies->req_ok_for('deploy');
+-}
+-
+-use_ok('DBIx::Class::ResultSource::View');
+-
+-#################### SANITY
+-
+-my $view = DBIx::Class::ResultSource::View->new;
+-
+-isa_ok( $view, 'DBIx::Class::ResultSource', 'A new view' );
+-isa_ok( $view, 'DBIx::Class', 'A new view also' );
+-
+-can_ok( $view, $_ ) for qw/new from deploy_depends_on/;
+-
+-#################### DEPS
+-{
+- my $schema
+- = ViewDeps->connect( DBICTest->_database (quote_char => '"') );
+- ok( $schema, 'Connected to ViewDeps schema OK' );
+-
+-#################### DEPLOY
+-
+- $schema->deploy;
+-
+-#################### DOES ORDERING WORK?
+-
+- my $sqlt_object = $schema->{sqlt};
+-
+- is_deeply(
+- [ map { $_->name } $sqlt_object->get_views ],
+- [qw/
+- a_name_artists
+- track_number_fives
+- year_2010_cds
+- ab_name_artists
+- year_2010_cds_with_many_tracks
+- aba_name_artists
+- aba_name_artists_and_2010_cds_with_many_tracks
+- /],
+- "SQLT view order triumphantly matches our order."
+- );
+-
+-#################### AND WHAT ABOUT USING THE SCHEMA?
+-
+- lives_ok( sub { $schema->resultset($_)->next }, "Query on $_ succeeds" )
+- for grep {
+- $schema->resultset($_)
+- ->result_source->isa('DBIx::Class::ResultSource::View')
+- } @{ [ $schema->sources ] };
+-}
+-
+-#################### AND WHAT ABOUT A BAD DEPS CHAIN IN A VIEW?
+-
+-{
+- my $schema2
+- = ViewDepsBad->connect( DBICTest->_database ( quote_char => '"') );
+- ok( $schema2, 'Connected to ViewDepsBad schema OK' );
+-
+-#################### DEPLOY2
+-
+- warnings_exist { $schema2->deploy }
+- [qr/no such table: main.aba_name_artists/],
+- "Deploying the bad schema produces a warning: aba_name_artists was not created.";
+-
+-#################### DOES ORDERING WORK 2?
+-
+- my $sqlt_object2 = $schema2->{sqlt};
+-
+- is_deeply(
+- [ map { $_->name } $sqlt_object2->get_views ],
+- [qw/
+- a_name_artists
+- track_number_fives
+- year_2010_cds
+- ab_name_artists
+- year_2010_cds_with_many_tracks
+- aba_name_artists_and_2010_cds_with_many_tracks
+- aba_name_artists
+- /],
+- "SQLT view order triumphantly matches our order."
+- );
+-
+-#################### AND WHAT ABOUT USING THE SCHEMA2?
+-
+- lives_ok( sub { $schema2->resultset($_)->next }, "Query on $_ succeeds" )
+- for grep {
+- $schema2->resultset($_)
+- ->result_source->isa('DBIx::Class::ResultSource::View')
+- } grep { !/AbaNameArtistsAnd2010CDsWithManyTracks/ }
+- @{ [ $schema2->sources ] };
+-
+- throws_ok { $schema2->resultset('AbaNameArtistsAnd2010CDsWithManyTracks')->next }
+- qr/no such table: aba_name_artists_and_2010_cds_with_many_tracks/,
+- "Query on AbaNameArtistsAnd2010CDsWithManyTracks throws, because the table does not exist"
+- ;
+-}
+-
+-done_testing;
+--- /dev/null
++++ b/xt/extra/sqlite_view_deps.t
+@@ -0,0 +1,118 @@
++use DBIx::Class::Optional::Dependencies -skip_all_without => 'deploy';
++
++use strict;
++use warnings;
++
++use Test::More;
++use Test::Exception;
++use Test::Warn;
++use lib qw(t/lib);
++use DBICTest;
++use ViewDeps;
++use ViewDepsBad;
++
++#################### SANITY
++
++my $view = DBIx::Class::ResultSource::View->new;
++
++isa_ok( $view, 'DBIx::Class::ResultSource', 'A new view' );
++isa_ok( $view, 'DBIx::Class', 'A new view also' );
++
++can_ok( $view, $_ ) for qw/new from deploy_depends_on/;
++
++#################### DEPS
++{
++ my $schema
++ = ViewDeps->connect( DBICTest->_database (quote_char => '"') );
++ ok( $schema, 'Connected to ViewDeps schema OK' );
++
++#################### DEPLOY
++
++ $schema->deploy;
++
++#################### DOES ORDERING WORK?
++
++ my $sqlt_object = $schema->{sqlt};
++
++ is_deeply(
++ [ map { $_->name } $sqlt_object->get_views ],
++ [qw/
++ a_name_artists
++ track_number_fives
++ year_2010_cds
++ ab_name_artists
++ year_2010_cds_with_many_tracks
++ aba_name_artists
++ aba_name_artists_and_2010_cds_with_many_tracks
++ /],
++ "SQLT view order triumphantly matches our order."
++ );
++
++#################### AND WHAT ABOUT USING THE SCHEMA?
++
++ lives_ok( sub { $schema->resultset($_)->next }, "Query on $_ succeeds" )
++ for grep {
++ $schema->resultset($_)
++ ->result_source->isa('DBIx::Class::ResultSource::View')
++ } @{ [ $schema->sources ] };
++}
++
++#################### AND WHAT ABOUT A BAD DEPS CHAIN IN A VIEW?
++
++{
++ my $schema2
++ = ViewDepsBad->connect( DBICTest->_database ( quote_char => '"') );
++ ok( $schema2, 'Connected to ViewDepsBad schema OK' );
++
++ my $lazy_view_validity = !(
++ $schema2->storage->_server_info->{normalized_dbms_version}
++ <
++ 3.009
++ );
++
++#################### DEPLOY2
++
++ warnings_exist { $schema2->deploy }
++ [ $lazy_view_validity ? () : qr/no such table: main.aba_name_artists/ ],
++ "Deploying the bad schema produces a warning: aba_name_artists was not created.";
++
++#################### DOES ORDERING WORK 2?
++
++ my $sqlt_object2 = $schema2->{sqlt};
++
++ is_deeply(
++ [ map { $_->name } $sqlt_object2->get_views ],
++ [qw/
++ a_name_artists
++ track_number_fives
++ year_2010_cds
++ ab_name_artists
++ year_2010_cds_with_many_tracks
++ aba_name_artists_and_2010_cds_with_many_tracks
++ aba_name_artists
++ /],
++ "SQLT view order triumphantly matches our order."
++ );
++
++#################### AND WHAT ABOUT USING THE SCHEMA2?
++
++ lives_ok( sub { $schema2->resultset($_)->next }, "Query on $_ succeeds" )
++ for grep {
++ $schema2->resultset($_)
++ ->result_source->isa('DBIx::Class::ResultSource::View')
++ } grep { !/AbaNameArtistsAnd2010CDsWithManyTracks/ }
++ @{ [ $schema2->sources ] };
++
++ $schema2->storage->dbh->do(q( DROP VIEW "aba_name_artists" ))
++ if $lazy_view_validity;
++
++ throws_ok { $schema2->resultset('AbaNameArtistsAnd2010CDsWithManyTracks')->next }
++ qr/no such table: (?:main\.)?aba_name_artists/,
++ sprintf(
++ "Query on AbaNameArtistsAnd2010CDsWithManyTracks throws, because the%s view does not exist",
++ $lazy_view_validity ? ' underlying' : ''
++ )
++ ;
++}
++
++done_testing;
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..2fa035e
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Adjust-view-dependency-tests-to-work-on-newer-libsql.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdbix-class-perl.git
More information about the Pkg-perl-cvs-commits
mailing list