From 027ba54bd884b5cde8a53c7f9049a30dc8ea445c Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Fri, 5 May 2023 14:14:38 +0100 Subject: [PATCH 1/7] ci(test): test on ruby 3.2 and x-plat --- .github/workflows/release_gem.yml | 2 +- .github/workflows/test.yml | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release_gem.yml b/.github/workflows/release_gem.yml index cb29c11..6513f46 100644 --- a/.github/workflows/release_gem.yml +++ b/.github/workflows/release_gem.yml @@ -14,7 +14,7 @@ jobs: version: ${{ steps.release-gem.outputs.version }} increment: ${{ steps.release-gem.outputs.increment }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - id: release-gem diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index adde880..897b051 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,18 +4,14 @@ on: [push, pull_request] jobs: test: - runs-on: "ubuntu-latest" - continue-on-error: ${{ matrix.experimental }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - ruby_version: ["2.4", "2.7"] - experimental: [false] - include: - - ruby_version: "3.0" - experimental: true + ruby_version: ["2.4", "2.7", "3.0", "3.2"] + os: ["ubuntu-latest","windows-latest","macos-latest"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby_version }} From 9ac818f19ac0325dbf326f8ef1b71d5b5bdb48ee Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Fri, 5 May 2023 14:33:44 +0100 Subject: [PATCH 2/7] fix(deps): rack 2.2.6 + ruby 3 change to WEBrick.run for args --- spec/support/provider_with_self_signed_cert.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/spec/support/provider_with_self_signed_cert.rb b/spec/support/provider_with_self_signed_cert.rb index 5983bf1..b969a98 100644 --- a/spec/support/provider_with_self_signed_cert.rb +++ b/spec/support/provider_with_self_signed_cert.rb @@ -7,8 +7,16 @@ def run_provider_with_self_signed_cert port require 'webrick/https' webrick_opts = {:Port => port, :SSLEnable => true, :SSLCertName => [%w[CN localhost]]} - Rack::Handler::WEBrick.run(Provider, webrick_opts) do |server| - @server = server + # https://www.rubydoc.info/gems/rack/2.2.6/Rack%2FHandler%2FWEBrick.run + if RUBY_VERSION < "3" + # To work with Ruby 2.7.0, this needs an explicit ruby2_keywords + Rack::Handler::WEBrick.run(Provider, webrick_opts) do |server| + @server = server + end + else + Rack::Handler::WEBrick.run(Provider, **webrick_opts) do |server| + @server = server + end end end From d48a7746342f578c7987b830d95c716d09300013 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Fri, 5 May 2023 16:28:36 +0100 Subject: [PATCH 3/7] ci(test): drop testing of ruby 2.4 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 897b051..e989160 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - ruby_version: ["2.4", "2.7", "3.0", "3.2"] + ruby_version: ["2.7", "3.0", "3.2"] os: ["ubuntu-latest","windows-latest","macos-latest"] steps: - uses: actions/checkout@v3 From 22635af0535d42874d097269ed78a6d06c3d7a93 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Fri, 5 May 2023 16:37:19 +0100 Subject: [PATCH 4/7] chore: skip some verification tests on windows --- spec/integration_check_host_spec.rb | 2 +- spec/integration_spec.rb | 2 +- spec/integration_verify_message_pact_spec.rb | 2 +- spec/integration_with_custom_header_spec.rb | 2 +- spec/integration_with_custom_middleware_spec.rb | 2 +- spec/integration_with_monkeypatch_spec.rb | 2 +- spec/integration_with_prefix_spec.rb | 2 +- spec/integration_with_ssl_no_verify_spec.rb | 2 +- spec/integration_with_underscored_header_spec.rb | 2 +- spec/spec_helper.rb | 4 +++- 10 files changed, 12 insertions(+), 10 deletions(-) diff --git a/spec/integration_check_host_spec.rb b/spec/integration_check_host_spec.rb index 4fff4f6..8d8fdef 100644 --- a/spec/integration_check_host_spec.rb +++ b/spec/integration_check_host_spec.rb @@ -1,4 +1,4 @@ -describe "pact-provider-verifier" do +describe "pact-provider-verifier", skip_windows: true do before(:all) do @pipe = IO.popen("bundle exec rackup -p 4569 spec/support/provider-echo-host.ru") sleep 2 diff --git a/spec/integration_spec.rb b/spec/integration_spec.rb index 32e5ef5..f23916f 100644 --- a/spec/integration_spec.rb +++ b/spec/integration_spec.rb @@ -1,7 +1,7 @@ require 'json' require 'fileutils' -describe "pact-provider-verifier" do +describe "pact-provider-verifier", skip_windows: true do before(:all) do @pipe = IO.popen("bundle exec rackup -p 4567 spec/support/config.ru") sleep 2 diff --git a/spec/integration_verify_message_pact_spec.rb b/spec/integration_verify_message_pact_spec.rb index 28022ae..f3bbf1b 100644 --- a/spec/integration_verify_message_pact_spec.rb +++ b/spec/integration_verify_message_pact_spec.rb @@ -1,6 +1,6 @@ require 'pact/provider_verifier/app' -RSpec.describe "verifying a message pact" do +RSpec.describe "verifying a message pact", skip_windows: true do before(:all) do @pipe = IO.popen("rackup -p 9393 spec/support/message_producer_verifier.ru") diff --git a/spec/integration_with_custom_header_spec.rb b/spec/integration_with_custom_header_spec.rb index e61c454..eba4d14 100644 --- a/spec/integration_with_custom_header_spec.rb +++ b/spec/integration_with_custom_header_spec.rb @@ -1,4 +1,4 @@ -describe "pact-provider-verifier with basic auth" do +describe "pact-provider-verifier with basic auth", skip_windows: true do before(:all) do @pipe = IO.popen({'USE_BASIC_AUTH' => 'true'}, %w{bundle exec rackup -p 4570 spec/support/config.ru}) sleep 2 diff --git a/spec/integration_with_custom_middleware_spec.rb b/spec/integration_with_custom_middleware_spec.rb index 0d48602..34fa3cb 100644 --- a/spec/integration_with_custom_middleware_spec.rb +++ b/spec/integration_with_custom_middleware_spec.rb @@ -1,4 +1,4 @@ -describe "pact-provider-verifier with basic auth" do +describe "pact-provider-verifier with basic auth", skip_windows: true do before(:all) do @pipe = IO.popen({'USE_BASIC_AUTH' => 'true'}, %w{bundle exec rackup -p 4570 spec/support/config.ru}) sleep 2 diff --git a/spec/integration_with_monkeypatch_spec.rb b/spec/integration_with_monkeypatch_spec.rb index 697b20a..4cf984c 100644 --- a/spec/integration_with_monkeypatch_spec.rb +++ b/spec/integration_with_monkeypatch_spec.rb @@ -1,4 +1,4 @@ -describe "pact-provider-verifier with monkeypatch" do +describe "pact-provider-verifier with monkeypatch", skip_windows: true do before(:all) do @pipe = IO.popen({}, %w{bundle exec rackup -p 4870 spec/support/config.ru}) sleep 2 diff --git a/spec/integration_with_prefix_spec.rb b/spec/integration_with_prefix_spec.rb index e5cbe86..171e502 100644 --- a/spec/integration_with_prefix_spec.rb +++ b/spec/integration_with_prefix_spec.rb @@ -1,6 +1,6 @@ require 'json' -describe "pact-provider-verifier with a prefix path in the base URL" do +describe "pact-provider-verifier with a prefix path in the base URL", skip_windows: true do before(:all) do @pipe = IO.popen("bundle exec rackup -p 5837 spec/support/config_with_prefix.ru") sleep 2 diff --git a/spec/integration_with_ssl_no_verify_spec.rb b/spec/integration_with_ssl_no_verify_spec.rb index 41afa9e..ebd9eed 100644 --- a/spec/integration_with_ssl_no_verify_spec.rb +++ b/spec/integration_with_ssl_no_verify_spec.rb @@ -1,7 +1,7 @@ require 'support/provider_with_self_signed_cert' require 'find_a_port' -describe "verifying a provider that uses a self signed certificate" do +describe "verifying a provider that uses a self signed certificate", skip_windows: true do it "passes because it has SSL verification turned off" do begin diff --git a/spec/integration_with_underscored_header_spec.rb b/spec/integration_with_underscored_header_spec.rb index fa86580..501d909 100644 --- a/spec/integration_with_underscored_header_spec.rb +++ b/spec/integration_with_underscored_header_spec.rb @@ -1,6 +1,6 @@ require 'find_a_port' -describe "pact-provider-verifier with an underscored header" do +describe "pact-provider-verifier with an underscored header", skip_windows: true do before(:all) do @port = FindAPort.available_port @pipe = IO.popen({}, %W{ruby spec/support/provider_with_no_rack.rb #{@port}}) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 55c8087..b6a19a2 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,11 +1,13 @@ ENV['PACT_BROKER_USERNAME'] = nil ENV['PACT_BROKER_PASSWORD'] = nil ENV['PACT_BROKER_TOKEN'] = nil +is_windows = Gem.win_platform? RSpec.configure do | config | + if config.respond_to?(:example_status_persistence_file_path=) config.example_status_persistence_file_path = "./spec/examples.txt" end - + config.filter_run_excluding skip_windows: is_windows end \ No newline at end of file From faf17a218f18015a7c9ecf69570b01dc9f381eb6 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Thu, 11 May 2023 17:14:14 +0100 Subject: [PATCH 5/7] ci: add ruby 3.1 to matrix --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e989160..3b36912 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - ruby_version: ["2.7", "3.0", "3.2"] + ruby_version: ["2.7", "3.0", "3.1", "3.2"] os: ["ubuntu-latest","windows-latest","macos-latest"] steps: - uses: actions/checkout@v3 From 70c3a71d320a6995ca60ad6e406cfc6020ff2d35 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Thu, 11 May 2023 19:19:57 +0100 Subject: [PATCH 6/7] chore(examples): update example gem lockfile --- examples/Gemfile.lock | 81 ++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/examples/Gemfile.lock b/examples/Gemfile.lock index 1d4d413..abaaa30 100644 --- a/examples/Gemfile.lock +++ b/examples/Gemfile.lock @@ -5,7 +5,7 @@ GEM diff-lcs (1.5.0) expgen (0.1.1) parslet - faraday (1.10.0) + faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -21,8 +21,8 @@ GEM faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) faraday-httpclient (1.0.1) - faraday-multipart (1.0.3) - multipart-post (>= 1.2, < 3) + faraday-multipart (1.0.4) + multipart-post (~> 2) faraday-net_http (1.0.1) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) @@ -32,15 +32,15 @@ GEM faraday (~> 1.0) filelock (1.1.1) find_a_port (1.0.1) - json (2.6.2) + json (2.6.3) multi_json (1.15.0) - multipart-post (2.1.1) - mustermann (1.1.1) + multipart-post (2.3.0) + mustermann (3.0.0) ruby2_keywords (~> 0.0.1) - pact (1.62.0) + pact (1.63.0) pact-mock_service (~> 3.0, >= 3.3.1) pact-support (~> 1.16, >= 1.16.9) - rack-test (>= 0.6.3, < 2.0.0) + rack-test (>= 0.6.3, < 3.0.0) rspec (~> 3.0) term-ansicolor (~> 1.0) thor (>= 0.20, < 2.0) @@ -49,7 +49,7 @@ GEM pact-mock_service (~> 3.1) pact-support (~> 1.8) thor (>= 0.20, < 2.0) - pact-mock_service (3.10.0) + pact-mock_service (3.11.0) filelock (~> 1.1) find_a_port (~> 1.0.1) json @@ -69,57 +69,58 @@ GEM rack-reverse-proxy rspec (~> 3.5) rspec_junit_formatter (~> 0.3) - pact-support (1.17.0) + pact-support (1.19.0) awesome_print (~> 1.9) diff-lcs (~> 1.4) expgen (~> 0.1) - term-ansicolor (~> 1.0) + rainbow (~> 3.1.1) parslet (2.0.0) - rack (2.2.3.1) - rack-protection (2.2.0) + rack (2.2.7) + rack-protection (3.0.6) rack - rack-proxy (0.7.2) + rack-proxy (0.7.6) rack rack-reverse-proxy (0.12.0) rack (>= 1.0.0) rack-proxy (~> 0.6, >= 0.6.1) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rspec (3.11.0) - rspec-core (~> 3.11.0) - rspec-expectations (~> 3.11.0) - rspec-mocks (~> 3.11.0) - rspec-core (3.11.0) - rspec-support (~> 3.11.0) - rspec-expectations (3.11.0) + rack-test (2.1.0) + rack (>= 1.3) + rainbow (3.1.1) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-mocks (3.11.1) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-support (3.11.0) - rspec_junit_formatter (0.5.1) + rspec-support (~> 3.12.0) + rspec-support (3.12.0) + rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) ruby2_keywords (0.0.5) - sinatra (2.2.0) - mustermann (~> 1.0) - rack (~> 2.2) - rack-protection (= 2.2.0) + sinatra (3.0.6) + mustermann (~> 3.0) + rack (~> 2.2, >= 2.2.4) + rack-protection (= 3.0.6) tilt (~> 2.0) - sinatra-contrib (2.2.0) + sinatra-contrib (3.0.6) multi_json - mustermann (~> 1.0) - rack-protection (= 2.2.0) - sinatra (= 2.2.0) + mustermann (~> 3.0) + rack-protection (= 3.0.6) + sinatra (= 3.0.6) tilt (~> 2.0) sync (0.5.0) term-ansicolor (1.7.1) tins (~> 1.0) thor (1.2.1) - tilt (2.0.10) - tins (1.31.1) + tilt (2.1.0) + tins (1.32.1) sync - webrick (1.7.0) + webrick (1.8.1) PLATFORMS ruby @@ -130,4 +131,4 @@ DEPENDENCIES sinatra-contrib BUNDLED WITH - 1.17.3 + 2.4.10 From d38ee153e8125016f6125ce9f1b33b5cd9356b19 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Thu, 11 May 2023 19:22:39 +0100 Subject: [PATCH 7/7] chore(test): update test gem lockfile --- test/Gemfile.lock | 185 +++++++++++++++++++++++++++------------------- 1 file changed, 108 insertions(+), 77 deletions(-) diff --git a/test/Gemfile.lock b/test/Gemfile.lock index 4220d0a..8071386 100644 --- a/test/Gemfile.lock +++ b/test/Gemfile.lock @@ -1,95 +1,126 @@ GEM remote: https://rubygems.org/ specs: - awesome_print (1.7.0) - backports (3.18.1) - diff-lcs (1.3) - faraday (0.12.1) - multipart-post (>= 1.2, < 3) - faraday_middleware (0.10.1) - faraday (>= 0.7.4, < 1.0) + awesome_print (1.9.2) + diff-lcs (1.5.0) + expgen (0.1.1) + parslet + faraday (1.10.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) + faraday (~> 1.0) + filelock (1.1.1) find_a_port (1.0.1) - json (2.3.1) - multi_json (1.14.1) - multipart-post (2.0.0) - mustermann (1.1.1) + json (2.6.3) + multi_json (1.15.0) + multipart-post (2.3.0) + mustermann (3.0.0) ruby2_keywords (~> 0.0.1) - pact (1.11.0) - json (> 1.8.5) - pact-mock_service (~> 1.2) - pact-support (~> 0.6) - rack-test (~> 0.6.2) - randexp (~> 0.1.7) - rspec (>= 2.14) - term-ansicolor (~> 1.0) - thor - webrick - pact-mock_service (1.2.0) - find_a_port (~> 1.0.1) - json - pact-support (~> 0.6) - rack - rack-test (~> 0.6.2) - rspec (>= 2.14) + pact (1.63.0) + pact-mock_service (~> 3.0, >= 3.3.1) + pact-support (~> 1.16, >= 1.16.9) + rack-test (>= 0.6.3, < 3.0.0) + rspec (~> 3.0) term-ansicolor (~> 1.0) - thor - webrick - pact-provider-proxy (2.1.0) - pact (~> 1.0, >= 1.1.1) - rack (>= 1.0.0) - rack-proxy (~> 0.5) - pact-provider-verifier (0.0.11) - faraday (~> 0.9, >= 0.9.0) - faraday_middleware (~> 0.10.0) - pact (~> 1.9, >= 1.9.1) - pact-provider-proxy (~> 2.1, >= 2.1.0) - rake (~> 10.4, >= 10.4.2) - rspec (~> 2.14) - pact-support (0.6.1) - awesome_print (~> 1.1) + thor (>= 0.20, < 2.0) + webrick (~> 1.3) + pact-message (0.11.1) + pact-mock_service (~> 3.1) + pact-support (~> 1.8) + thor (>= 0.20, < 2.0) + pact-mock_service (3.11.0) + filelock (~> 1.1) find_a_port (~> 1.0.1) json - rack-test (~> 0.6.2) - randexp (~> 0.1.7) + pact-support (~> 1.16, >= 1.16.4) + rack (~> 2.0) rspec (>= 2.14) term-ansicolor (~> 1.0) - thor - rack (2.2.3.1) - rack-protection (2.0.8.1) + thor (>= 0.19, < 2.0) + webrick (~> 1.3) + pact-provider-verifier (1.36.1) + faraday (>= 0.9.0, <= 2.0) + faraday_middleware (>= 0.10, <= 2.0) + json (> 1.8) + pact (~> 1.59) + pact-message (~> 0.5) + rack (~> 2.1) + rack-reverse-proxy + rspec (~> 3.5) + rspec_junit_formatter (~> 0.3) + pact-support (1.19.0) + awesome_print (~> 1.9) + diff-lcs (~> 1.4) + expgen (~> 0.1) + rainbow (~> 3.1.1) + parslet (2.0.0) + rack (2.2.7) + rack-protection (3.0.6) rack - rack-proxy (0.6.1) + rack-proxy (0.7.6) rack - rack-test (0.6.3) - rack (>= 1.0) - rake (10.5.0) - randexp (0.1.7) - rspec (2.99.0) - rspec-core (~> 2.99.0) - rspec-expectations (~> 2.99.0) - rspec-mocks (~> 2.99.0) - rspec-core (2.99.2) - rspec-expectations (2.99.2) - diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.99.4) - ruby2_keywords (0.0.2) - sinatra (2.0.8.1) - mustermann (~> 1.0) - rack (~> 2.0) - rack-protection (= 2.0.8.1) + rack-reverse-proxy (0.12.0) + rack (>= 1.0.0) + rack-proxy (~> 0.6, >= 0.6.1) + rack-test (2.1.0) + rack (>= 1.3) + rainbow (3.1.1) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-support (3.12.0) + rspec_junit_formatter (0.6.0) + rspec-core (>= 2, < 4, != 2.12.0) + ruby2_keywords (0.0.5) + sinatra (3.0.6) + mustermann (~> 3.0) + rack (~> 2.2, >= 2.2.4) + rack-protection (= 3.0.6) tilt (~> 2.0) - sinatra-contrib (2.0.8.1) - backports (>= 2.8.2) + sinatra-contrib (3.0.6) multi_json - mustermann (~> 1.0) - rack-protection (= 2.0.8.1) - sinatra (= 2.0.8.1) + mustermann (~> 3.0) + rack-protection (= 3.0.6) + sinatra (= 3.0.6) tilt (~> 2.0) - term-ansicolor (1.6.0) + sync (0.5.0) + term-ansicolor (1.7.1) tins (~> 1.0) - thor (0.19.4) - tilt (2.0.10) - tins (1.13.2) - webrick (1.3.1) + thor (1.2.1) + tilt (2.1.0) + tins (1.32.1) + sync + webrick (1.8.1) PLATFORMS ruby @@ -100,4 +131,4 @@ DEPENDENCIES sinatra-contrib BUNDLED WITH - 1.14.6 + 2.4.12