Skip to content
Draft
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
144 changes: 136 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,93 @@ on:
workflow_dispatch:

jobs:
test:
test-with_and_without-v2:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ruby_version: ["2.7", "3.0", "3.1", "3.2", "3.3"]
ruby_version: ["3.2", "3.3", "3.4"]
os: ["ubuntu-latest","windows-latest","macos-latest"]
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- run: "bundle exec rake"
- run: "bundle install && bundle exec rake spec"
- name: Test Pact-Ruby Specs
run: "bundle exec rake"
- name: Test Pact-Ruby Zoo App Specs
run: "bundle install && bundle exec rake spec"
if: matrix.ruby_version > '3.0'
working-directory: example/zoo-app
- run: "bundle install && bundle exec rake pact:verify"
- name: Test Pact-Ruby Animal Service Specs
run: "bundle install && bundle exec rake pact:verify"
if: matrix.os != 'windows-latest' && matrix.ruby_version > '3.0'
working-directory: example/animal-service
- run: rm -rf Gemfile.lock
shell: bash
- run: "bundle install"
name: "bundle install - pact-ruby v2"
env:
PACT_RUBY_V2_ENABLE: 'true'
- name: Test Pact-Ruby v2 Specs
run: "bundle exec rake spec:v2"
env:
PACT_RUBY_V2_ENABLE: 'true'
- name: Test Pact-Ruby v2 Zoo App Specs
run: "bundle install && bundle exec rake spec:v2"
if: matrix.ruby_version > '3.0'
working-directory: example/zoo-app-v2
env:
PACT_RUBY_V2_ENABLE: 'true'
- name: Test Pact-Ruby v2 Animal Service Specs
run: "bundle install && bundle exec rake pact:v2:verify"
if: matrix.os != 'windows-latest' && matrix.ruby_version > '3.0'
working-directory: example/animal-service-v2
env:
PACT_RUBY_V2_ENABLE: 'true'

test-v2-only:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ruby_version: ["3.2", "3.3", "3.4"]
os: ["ubuntu-latest","windows-latest","macos-latest"]
env:
PACT_RUBY_V2_ENABLE: 'true'
PACT_RUBY_V1_ENABLE: 'false'
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- run: "bundle install"
name: "bundle install - pact-ruby v2"
- name: Test Pact-Ruby v2 Specs
run: "bundle exec rake spec:v2"
- name: Test Pact-Ruby v2 Zoo App Specs
run: "bundle install && bundle exec rake spec:v2"
if: matrix.ruby_version > '3.0'
working-directory: example/zoo-app-v2
- name: Test Pact-Ruby v2 Animal Service Specs
run: "bundle install && bundle exec rake pact:v2:verify"
if: matrix.os != 'windows-latest' && matrix.ruby_version > '3.0'
working-directory: example/animal-service-v2
- name: Test Mixed Pacts (Http/Kafaka/Grpc) - Pact-Ruby v2
run: "bundle exec rake pact:v2:spec"
if: matrix.os != 'windows-latest' && matrix.ruby_version > '3.0'
- name: Verify Mixed Pacts (Http/Kafaka/Grpc) - Pact-Ruby v2
run: "bundle exec rake pact:v2:verify"
if: matrix.os != 'windows-latest' && matrix.ruby_version > '3.0'

test-with-rack-2:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ruby_version: ["3.2"]
ruby_version: ["3.2", "3.3", "3.4"]
os: ["ubuntu-latest","windows-latest","macos-latest"]
steps:
- uses: actions/checkout@v4
Expand All @@ -45,12 +106,61 @@ jobs:
bundler-cache: true
- run: "bundle exec appraisal install"
- run: "bundle exec appraisal rack-2 rake"
name: "test with rack 2 - pact-ruby v1"
- run: rm -rf Gemfile.lock gemfiles
shell: bash
- run: "bundle install"
name: "bundle install - pact-ruby v2"
env:
PACT_RUBY_V2_ENABLE: 'true'
- run: "bundle exec appraisal install"
env:
PACT_RUBY_V2_ENABLE: 'true'
- run: "bundle exec appraisal rack-2 rake spec:v2"
env:
PACT_RUBY_V2_ENABLE: 'true'
- name: Test Mixed Pacts (Http/Kafaka/Grpc) - Pact-Ruby v2
run: "bundle exec appraisal rack-2 rake pact:v2:spec"
if: matrix.os != 'windows-latest' && matrix.ruby_version > '3.0'
env:
PACT_RUBY_V2_ENABLE: 'true'
- name: Verify Mixed Pacts (Http/Kafaka/Grpc) - Pact-Ruby v2
run: "bundle exec appraisal rack-2 rake pact:v2:verify"
if: matrix.os != 'windows-latest' && matrix.ruby_version > '3.0'
env:
PACT_RUBY_V2_ENABLE: 'true'

test-v2-only-with-rack-2:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ruby_version: ["3.2", "3.3", "3.4"]
os: ["ubuntu-latest","windows-latest","macos-latest"]
env:
PACT_RUBY_V2_ENABLE: 'true'
PACT_RUBY_V1_ENABLE: 'false'
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- run: "bundle exec appraisal install"
- run: "bundle exec appraisal rack-2 rake spec:v2"
- name: Test Mixed Pacts (Http/Kafaka/Grpc) - Pact-Ruby v2
run: "bundle exec appraisal rack-2 rake pact:v2:spec"
if: matrix.os != 'windows-latest' && matrix.ruby_version > '3.0'
- name: Verify Mixed Pacts (Http/Kafaka/Grpc) - Pact-Ruby v2
run: "bundle exec appraisal rack-2 rake pact:v2:verify"
if: matrix.os != 'windows-latest' && matrix.ruby_version > '3.0'

test-with-active-support:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ruby_version: ["2.7", "3.0", "3.1", "3.2"]
ruby_version: ["3.2", "3.3", "3.4"]
os: ["ubuntu-latest","windows-latest","macos-latest"]
defaults:
run:
Expand All @@ -62,4 +172,22 @@ jobs:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- run: "bundle exec appraisal install"
- run: "bundle exec appraisal activesupport rake spec_with_active_support"
name: "install active support - pact-ruby"
env:
PACT_RUBY_V2_DISABLE: 'true'
- run: "bundle exec appraisal activesupport rake spec_with_active_support"
name: "test with active support - pact-ruby"
env:
PACT_RUBY_V2_DISABLE: 'true'
- run: rm -rf Gemfile.lock gemfiles
shell: bash
- run: "bundle install"
name: "bundle install - pact-ruby v2"
env:
LOAD_ACTIVE_SUPPORT: 'true'
PACT_RUBY_V2_ENABLE: 'true'
- run: "bundle exec rake spec:v2"
name: "test with active support - pact-ruby v2"
env:
LOAD_ACTIVE_SUPPORT: 'true'
PACT_RUBY_V2_ENABLE: 'true'
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ _yardoc
coverage
lib/bundler/man
pkg
# grpc generated files required for testing
!spec/internal/pkg
rdoc
spec/reports
test/tmp
Expand All @@ -28,8 +30,9 @@ log
.idea
reports
Gemfile.lock
example/**/Gemfile.lock
*.gemfile.lock
gemfiles/*.gemfile.lock
gemfiles
reports/pacts
spec/examples.txt
*bethtest*
Expand Down
1 change: 0 additions & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
--color
--format progress
--require spec_helper
4 changes: 4 additions & 0 deletions .rspec_v2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--color
--format progress
--require spec_helper_v2
--require rails_helper_v2
5 changes: 5 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ end

appraise "activesupport" do
gem "activesupport", "~> 5.1"
if RUBY_VERSION >= "3.4"
gem "csv"
gem "mutex_m"
gem "base64"
end
end
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ gemspec

gem "rspec-mocks", "3.10.2"
gem "appraisal", "~> 2.5"
gem "pact-support", github: "pact-foundation/pact-support", branch: "fix/json_load_regression"

if ENV['X_PACT_DEVELOPMENT']
gem "pact-support", path: '../pact-support'
Expand All @@ -26,5 +27,7 @@ end
group :test do
gem 'faraday', '~>2.0', '<3.0'
gem 'faraday-retry', '~>2.0'
gem 'rackup', '~> 2.1'
gem 'rackup'
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
end

Loading
Loading