From 3a23a71aa0adf217693782802f4c9b52a23cb7d7 Mon Sep 17 00:00:00 2001 From: Felipe Andrade Date: Mon, 18 Nov 2024 20:50:33 -0300 Subject: [PATCH] ci: fix cucumber tests --- .github/workflows/ci.yml | 37 ++++++++++++---------- config/database.yml.github-actions | 8 ----- features/step_definitions/prodder_steps.rb | 2 +- 3 files changed, 21 insertions(+), 26 deletions(-) delete mode 100644 config/database.yml.github-actions diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00a3072..5835513 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,38 +18,41 @@ jobs: ruby-version: [2.6, 2.7, 3.0] services: postgres: - image: postgres:12.1-alpine + image: postgres:15 ports: - 5432:5432 env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + POSTGRES_HOST_AUTH_METHOD: trust + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 steps: - name: Checkout Project - uses: actions/checkout@v3 - + uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true - - name: Install Library Dependencies run: sudo apt-get install libpq-dev - - - name: Setup Database - run: | - cp config/database.yml.github-actions config/database.yml - env: - RAILS_ENV: test - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - - name: Test with RSpec env: - RAILS_ENV: "test" - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres + PGHOST: localhost + PGPORT: 5432 + PGUSER: postgres + PGPASSWORD: postgres run: | bundle exec rspec + - name: Test with Cucumber + env: + PGHOST: localhost + PGPORT: 5432 + PGUSER: postgres + PGPASSWORD: postgres + run: | + bundle exec cucumber diff --git a/config/database.yml.github-actions b/config/database.yml.github-actions deleted file mode 100644 index 0724691..0000000 --- a/config/database.yml.github-actions +++ /dev/null @@ -1,8 +0,0 @@ -test: - adapter: postgresql - host: localhost - encoding: unicode - database: github-actions - pool: 20 - username: <%= ENV["POSTGRES_USER"] %> - password: <%= ENV["POSTGRES_PASSWORD"] %> diff --git a/features/step_definitions/prodder_steps.rb b/features/step_definitions/prodder_steps.rb index 7dd315c..520683e 100644 --- a/features/step_definitions/prodder_steps.rb +++ b/features/step_definitions/prodder_steps.rb @@ -90,7 +90,7 @@ db: name: prodder__#{name}_prod host: localhost - user: prodder + user: postgres tables: - posts - authors