Skip to content

Commit

Permalink
Test Matrix: Use Ruby 3.2 to test against all Postgres versions; add …
Browse files Browse the repository at this point in the history
…PG 15, remove PG 10 (#828)

* Use Ruby 3.2 to test against all PG versions

Ruby 3.2 tests are ~2 min vs ~6 min for Ruby 3.0

* Mock out Scheduler, etc in Adapter async tests

* Test against Postgres 15, remove EOL PG 10
  • Loading branch information
bensheldon authored Feb 6, 2023
1 parent d58d888 commit 2cc1529
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
DISABLE_SPRING: 1
services:
postgres:
image: postgres:14
image: postgres:15
env:
POSTGRES_USER: good_job
POSTGRES_DB: good_job_test
Expand Down Expand Up @@ -77,24 +77,24 @@ jobs:
strategy:
matrix:
ruby: [2.6, 2.7, "3.0", 3.1, 3.2, jruby-9.3]
pg: [14]
pg: [15]
include:
- ruby: "3.0"
pg: 10
- ruby: "3.0"
- ruby: 3.2
pg: 11
- ruby: "3.0"
- ruby: 3.2
pg: 12
- ruby: "3.0"
- ruby: 3.2
pg: 13
- ruby: jruby-9.3
pg: 10
- ruby: 3.2
pg: 14
- ruby: jruby-9.3
pg: 11
- ruby: jruby-9.3
pg: 12
- ruby: jruby-9.3
pg: 13
- ruby: jruby-9.3
pg: 14
env:
PGHOST: localhost
PGUSER: good_job
Expand Down
14 changes: 14 additions & 0 deletions spec/lib/good_job/adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,20 @@ def perform
context 'when execution mode async_server' do
let(:adapter) { described_class.new(execution_mode: :async_server) }

before do
scheduler = instance_double(GoodJob::Scheduler)
allow(GoodJob::Scheduler).to receive(:new).and_return(scheduler)

notifier = instance_double(GoodJob::Notifier, recipients: [])
allow(GoodJob::Notifier).to receive(:new).and_return(notifier)

poller = instance_double(GoodJob::Poller, recipients: [])
allow(GoodJob::Poller).to receive(:new).and_return(poller)

cron_manager = instance_double(GoodJob::CronManager)
allow(GoodJob::CronManager).to receive(:new).and_return(cron_manager)
end

context 'when Rails::Server is defined' do
before do
stub_const("Rails::Server", Class.new)
Expand Down

0 comments on commit 2cc1529

Please sign in to comment.