Skip to content

Commit eac7341

Browse files
committed
migrate last reference to postgres
1 parent 18bd865 commit eac7341

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.github/workflows/ruby.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ jobs:
9393
env:
9494
POSTGRES_USER: jruby
9595
POSTGRES_PASSWORD: jruby
96-
POSTGRES_HOST_AUTH_METHOD: trust
96+
POSTGRES_DB: postgres
9797
ports:
9898
- 5432:5432
99-
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
99+
options: --health-cmd "pg_isready -U jruby" --health-interval 10s --health-timeout 5s --health-retries 5
100100

101101
env:
102102
DB: ${{ matrix.db }}
@@ -237,7 +237,7 @@ jobs:
237237
env:
238238
POSTGRES_USER: jruby
239239
POSTGRES_PASSWORD: jruby
240-
POSTGRES_HOST_AUTH_METHOD: trust
240+
POSTGRES_DB: postgres
241241
ports:
242242
- 5432:5432
243243
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

rakelib/db.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ GRANT ALL PRIVILEGES ON `test\_%`.* TO #{MYSQL_CONFIG[:username]}@localhost;
3939
task :postgresql do
4040
require File.expand_path('../../test/shared_helper', __FILE__)
4141
fail 'could not create test database: psql executable not found' unless psql = which('psql')
42-
fail 'could not create test database: missing "postgres" role' unless PostgresHelper.postgres_role?
42+
fail 'could not create test database: missing "jruby" role' unless PostgresHelper.postgres_role?
4343

4444
load 'test/db/postgres_config.rb' # rescue nil
4545
puts POSTGRES_CONFIG.inspect if $VERBOSE

test/shared_helper.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ module PostgresHelper
2525
class << self
2626
def postgres_role?(warn = nil)
2727
if psql = which('psql')
28-
if `#{psql} -c '\\l' -U jruby #{psql_params}2>&1` && $?.exitstatus == 0
28+
cmd = "PGPASSWORD=#{ENV['PGPASSWORD'] || 'jruby'} #{psql} -c '\\l' -U jruby #{psql_params}2>&1"
29+
if `#{cmd}` && $?.exitstatus == 0
2930
true
3031
else
3132
if warn.nil?

0 commit comments

Comments
 (0)