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
26 changes: 25 additions & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,31 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
bundler-cache: true

- name: Run tests
run: bundle exec rake

pact:
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true

- name: Run pact tests
run: bundle exec rspec spec/pact/

- name: Publish pacts
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
env:
PACT_BROKER_BASE_URL: ${{ secrets.PACT_BROKER_BASE_URL }}
PACT_BROKER_USERNAME: ${{ secrets.PACT_BROKER_USERNAME }}
PACT_BROKER_PASSWORD: ${{ secrets.PACT_BROKER_PASSWORD }}
run: bundle exec rake pact:publish
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@

# rspec failure tracking
.rspec_status

# pact logs
spec/pact_logs/

/log/
89 changes: 88 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ GEM
specs:
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
awesome_print (1.9.2)
base64 (0.3.0)
bigdecimal (3.1.8)
coderay (1.1.3)
concurrent-ruby (1.0.3)
crack (0.4.5)
rexml
csv (3.3.5)
diff-lcs (1.5.0)
dig_rb (1.0.1)
dotenv (2.8.1)
dry-configurable (1.0.0)
dry-core (~> 1.0, < 2)
Expand All @@ -44,18 +47,87 @@ GEM
dry-inflector (~> 1.0)
dry-logic (~> 1.4)
zeitwerk (~> 2.6)
expgen (0.1.1)
parslet
faraday (2.7.10)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
find_a_port (1.0.1)
hashdiff (1.0.1)
httparty (0.24.2)
csv
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
ice_nine (0.11.2)
io-console (0.8.2)
json (2.18.1)
jsonpath (1.1.5)
multi_json
logger (1.7.0)
method_source (1.0.0)
mini_mime (1.1.5)
mize (0.6.1)
multi_json (1.19.1)
multi_xml (0.8.1)
bigdecimal (>= 3.1, < 5)
ostruct (0.6.3)
pact (1.67.4)
pact-mock_service (~> 3.0, >= 3.3.1)
pact-support (~> 1.21, >= 1.21.2)
rack
rack-proxy
rack-test (>= 0.6.3, < 3.0.0)
rainbow (~> 3.1)
rspec (~> 3.0)
thor (>= 0.20, < 2.0)
webrick (~> 1.8)
zeitwerk (~> 2.3)
pact-mock_service (3.12.4)
find_a_port (~> 1.0.1)
json
logger (< 2.0)
pact-support (~> 1.16, >= 1.16.4)
rack (>= 3.0, < 4.0)
rackup (~> 2.0)
rspec (>= 2.14)
thor (>= 0.19, < 2.0)
webrick (~> 1.8)
pact-support (1.21.2)
awesome_print (~> 1.9)
diff-lcs (~> 1.5)
expgen (~> 0.1)
jsonpath (~> 1.0)
rainbow (~> 3.1.1)
string_pattern (~> 2.0)
pact_broker-client (1.77.0)
base64 (~> 0.2)
dig_rb (~> 1.0)
httparty (>= 0.21.0, < 1.0.0)
ostruct
rake (~> 13.0)
table_print (~> 1.5)
term-ansicolor (~> 1.7)
thor (>= 0.20, < 2.0)
parslet (2.0.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.3)
rack (3.2.4)
rack-proxy (0.7.7)
rack
rack-test (2.2.0)
rack (>= 1.3)
rackup (2.3.1)
rack (>= 3)
rainbow (3.1.1)
rake (13.0.1)
readline (0.0.4)
reline
regexp_parser (2.11.3)
reline (0.6.3)
io-console (~> 0.5)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
Expand All @@ -71,11 +143,24 @@ GEM
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
ruby2_keywords (0.0.5)
vcr (6.2.0)
string_pattern (2.3.0)
regexp_parser (~> 2.5, >= 2.5.0)
sync (0.5.0)
table_print (1.5.7)
term-ansicolor (1.11.3)
tins (~> 1)
thor (1.5.0)
tins (1.51.1)
bigdecimal
mize (~> 0.6)
readline
sync
vcr (6.4.0)
webmock (3.19.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.9.2)
zeitwerk (2.6.11)

PLATFORMS
Expand All @@ -86,6 +171,8 @@ DEPENDENCIES
bundler (~> 2.0)
dotenv (~> 2.0)
kickplan-sdk!
pact (~> 1.64)
pact_broker-client (~> 1.75)
pry (~> 0.14)
rake (~> 13.0)
rspec (~> 3.0)
Expand Down
17 changes: 17 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,20 @@ require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)

task default: :spec

begin
require "pact_broker/client/tasks"

PactBroker::Client::PublicationTask.new do |task|
task.consumer_version = `git rev-parse --short HEAD`.strip
task.pact_broker_base_url = ENV.fetch("PACT_BROKER_BASE_URL", "http://localhost:9292")
task.pact_broker_basic_auth = {
username: ENV.fetch("PACT_BROKER_USERNAME", "pact"),
password: ENV.fetch("PACT_BROKER_PASSWORD", "pact")
}
task.branch = `git rev-parse --abbrev-ref HEAD`.strip
task.tag_with_git_branch = true
end
rescue LoadError
# pact_broker-client not available outside dev
end
2 changes: 2 additions & 0 deletions kickplan.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "webmock", "~> 3.5"
spec.add_development_dependency "vcr", "~> 6.0"
spec.add_development_dependency "pact", "~> 1.64"
spec.add_development_dependency "pact_broker-client", "~> 1.75"
end
2 changes: 1 addition & 1 deletion lib/kickplan/adapters/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Adapters
class HTTP < Adapter
extend Forwardable

delegate %i(get post put delete) => :connection
delegate %i(get post put patch delete) => :connection

# @deprecated
def configure_account(params)
Expand Down
Loading