Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEVX-641] Fix Cucumber Tests #37

Closed
Closed
Show file tree
Hide file tree
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
21 changes: 19 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ jobs:
ruby-version: [2.6, 2.7, 3.0]
services:
postgres:
image: postgres:12.1-alpine
image: postgres:latest
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
options: >-
--health-cmd pg_isready
--health-interval 30s
--health-timeout 15s
--health-retries 5
steps:
- name: Checkout Project
uses: actions/checkout@v3
Expand Down Expand Up @@ -53,3 +57,16 @@ jobs:
POSTGRES_PASSWORD: postgres
run: |
bundle exec rspec

- name: Test with Cucumber
env:
RAILS_ENV: "test"
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
run: |
echo "Waiting for PostgreSQL to be ready..."
until pg_isready -h localhost; do
sleep 1
done
echo "PostgreSQL is ready!"
bundle exec cucumber
1 change: 1 addition & 0 deletions config/database.yml.github-actions
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ test:
encoding: unicode
database: github-actions
pool: 20
port: 5432
username: <%= ENV["POSTGRES_USER"] %>
password: <%= ENV["POSTGRES_PASSWORD"] %>
1 change: 1 addition & 0 deletions features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def update_config(filename, &block)
end

def self.setup!
puts '-------------- creating roles and databases --------------'
pg = Prodder::PG.new
pg.create_role 'prodder'
pg.create_role 'include_this', ['--no-login']
Expand Down
1 change: 1 addition & 0 deletions lib/prodder/pg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class PG
attr_reader :credentials

def initialize(credentials = {})
puts "-------------- initializing pg creds: #{credentials} --------------"
@credentials = credentials
end

Expand Down
Loading