mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-23 09:26:30 +00:00
Connection to the CI databases is viewed by Postgres as coming from localhost. The pg_hba.conf file generated by the docker image uses trust for these connections, that's why we had no test coverage on SASL and md5 branches. This PR fixes this issue. There was also an issue with under-reporting code coverage. This should be fixed now
22 lines
446 B
Ruby
22 lines
446 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'pg'
|
|
require_relative 'helpers/pgcat_helper'
|
|
|
|
QUERY_COUNT = 300
|
|
MARGIN_OF_ERROR = 0.35
|
|
|
|
def with_captured_stdout_stderr
|
|
sout = STDOUT.clone
|
|
serr = STDERR.clone
|
|
STDOUT.reopen("/tmp/out.txt", "w+")
|
|
STDERR.reopen("/tmp/err.txt", "w+")
|
|
STDOUT.sync = true
|
|
STDERR.sync = true
|
|
yield
|
|
return File.read('/tmp/out.txt'), File.read('/tmp/err.txt')
|
|
ensure
|
|
STDOUT.reopen(sout)
|
|
STDERR.reopen(serr)
|
|
end
|