Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions spec/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ def initialize(name, port: 23456, postgresql_conf: '')

def create_test_db
trace "Creating the test DB"
log_and_run @logfile, pg_bin_path('psql'), '-p', @port.to_s, '-e', '-c', 'DROP DATABASE IF EXISTS test', 'postgres'
log_and_run @logfile, pg_bin_path('createdb'), '-p', @port.to_s, '-e', 'test'
end

Expand All @@ -276,12 +275,10 @@ def ca_file
private

def setup_cluster(postgresql_conf)
return if (@pgdata+"ruby-pg-server-cert").exist?

FileUtils.rm_rf(@pgdata, verbose: $DEBUG)

trace "Running initdb"
log_and_run @logfile, pg_bin_path('initdb'), '-E', 'UTF8', '--no-locale', '-D', @pgdata.to_s
log_and_run @logfile, pg_bin_path('initdb'), '-E', 'UTF8', '--no-locale', '--no-sync', '-D', @pgdata.to_s

trace "Enable SSL"
# Enable SSL in server config
Expand All @@ -291,6 +288,7 @@ def setup_cluster(postgresql_conf)
ssl_ca_file = 'ruby-pg-ca-cert'
ssl_cert_file = 'ruby-pg-server-cert'
ssl_key_file = 'ruby-pg-server-key'
fsync = off
#{postgresql_conf}
EOT
end
Expand Down
Loading