public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-ruby/pg/, dev-ruby/pg/files/
@ 2018-04-16 18:32 Hans de Graaff
  0 siblings, 0 replies; only message in thread
From: Hans de Graaff @ 2018-04-16 18:32 UTC (permalink / raw
  To: gentoo-commits

commit:     41dead08409594e7fb4efb3918c19760ed58c882
Author:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 16 18:32:04 2018 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Mon Apr 16 18:32:43 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41dead08

dev-ruby/pg: fix tests with postgresql 10

Backport the upstream changes to tests.

Closes: https://bugs.gentoo.org/648778
Package-Manager: Portage-2.3.24, Repoman-2.3.6

 dev-ruby/pg/files/postgresql10-tests.patch | 49 ++++++++++++++++++++++++++++++
 dev-ruby/pg/pg-0.18.4-r1.ebuild            |  2 ++
 dev-ruby/pg/pg-0.21.0.ebuild               |  2 ++
 3 files changed, 53 insertions(+)

diff --git a/dev-ruby/pg/files/postgresql10-tests.patch b/dev-ruby/pg/files/postgresql10-tests.patch
new file mode 100644
index 00000000000..f9b7c1579a9
--- /dev/null
+++ b/dev-ruby/pg/files/postgresql10-tests.patch
@@ -0,0 +1,49 @@
+# HG changeset patch
+# User Lars Kanis <kanis@comcard.de>
+# Date 1508756565 -7200
+# Node ID fe63160e8a9803e257231d879fab2841ba44c37a
+# Parent  d6d5533dfca85b618232fe3e9e56e59dbee99de6
+Adjust tests for PostgreSQL-10
+
+diff --git a/spec/helpers.rb b/spec/helpers.rb
+--- a/spec/helpers.rb
++++ b/spec/helpers.rb
+@@ -251,7 +251,7 @@
+ 
+ 	def check_for_lingering_connections( conn )
+ 		conn.exec( "SELECT * FROM pg_stat_activity" ) do |res|
+-			conns = res.find_all {|row| row['pid'].to_i != conn.backend_pid }
++			conns = res.find_all {|row| row['pid'].to_i != conn.backend_pid && ["client backend", nil].include?(row["backend_type"]) }
+ 			unless conns.empty?
+ 				puts "Lingering connections remain:"
+ 				conns.each do |row|
+diff --git a/spec/pg/connection_spec.rb b/spec/pg/connection_spec.rb
+--- a/spec/pg/connection_spec.rb
++++ b/spec/pg/connection_spec.rb
+@@ -232,7 +232,7 @@
+ 		described_class.connect(@conninfo).finish
+ 		sleep 0.5
+ 		res = @conn.exec(%[SELECT COUNT(*) AS n FROM pg_stat_activity
+-							WHERE usename IS NOT NULL])
++							WHERE usename IS NOT NULL AND application_name != ''])
+ 		# there's still the global @conn, but should be no more
+ 		expect( res[0]['n'] ).to eq( '1' )
+ 	end
+@@ -1537,9 +1537,14 @@
+ 		end
+ 
+ 		it "shouldn't type map params unless requested" do
+-			expect{
+-				@conn.exec_params( "SELECT $1", [5] )
+-			}.to raise_error(PG::IndeterminateDatatype)
++			if @conn.server_version < 100000
++				expect{
++					@conn.exec_params( "SELECT $1", [5] )
++				}.to raise_error(PG::IndeterminateDatatype)
++			else
++				# PostgreSQL-10 maps to TEXT type (OID 25)
++				expect( @conn.exec_params( "SELECT $1", [5] ).ftype(0)).to eq(25)
++			end
+ 		end
+ 
+ 		it "should raise an error on invalid encoder to put_copy_data" do

diff --git a/dev-ruby/pg/pg-0.18.4-r1.ebuild b/dev-ruby/pg/pg-0.18.4-r1.ebuild
index 8e25f7eeb65..76ca7c11e05 100644
--- a/dev-ruby/pg/pg-0.18.4-r1.ebuild
+++ b/dev-ruby/pg/pg-0.18.4-r1.ebuild
@@ -23,6 +23,8 @@ RDEPEND+=" dev-db/postgresql:*"
 DEPEND+=" dev-db/postgresql
 	test? ( >=dev-db/postgresql-9.4[server,threads] )"
 
+RUBY_PATCHES=( "${FILESDIR}/postgresql10-tests.patch" )
+
 ruby_add_bdepend "
 	doc? (
 		dev-ruby/hoe

diff --git a/dev-ruby/pg/pg-0.21.0.ebuild b/dev-ruby/pg/pg-0.21.0.ebuild
index c459b80a910..24430c4f459 100644
--- a/dev-ruby/pg/pg-0.21.0.ebuild
+++ b/dev-ruby/pg/pg-0.21.0.ebuild
@@ -23,6 +23,8 @@ RDEPEND+=" dev-db/postgresql:*"
 DEPEND+=" dev-db/postgresql
 	test? ( >=dev-db/postgresql-9.4[server,threads] )"
 
+PATCHES=( "${FILESDIR}/postgresql10-tests.patch" )
+
 all_ruby_prepare() {
 	# hack the Rakefile to make it sure that it doesn't load
 	# rake-compiler (so that we don't have to depend on it and it


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-16 18:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-16 18:32 [gentoo-commits] repo/gentoo:master commit in: dev-ruby/pg/, dev-ruby/pg/files/ Hans de Graaff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox