Hulia Iordache
05/04/2023, 5:33 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
export PACKAGE_VERSION=1.92.0
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v$PACKAGE_VERSION/pact-$PACKAGE_VERSION-osx.tar.gz>
tar xzf pact-$PACKAGE_VERSION-osx.tar.gz
cd pact/bin
./pact-mock-service --help start
Hulia Iordache
05/04/2023, 6:00 PMYousaf Nabi (pactflow.io)
brew tap yourgithubname/pact-ruby-standalone
brew install pact-ruby-standalone
You might need to
brew untap pact-foundation/pact-ruby-standalone
Hulia Iordache
05/04/2023, 6:22 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
sudo softwareupdate --install-rosetta --agree-to-license
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Hulia Iordache
05/04/2023, 6:37 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Hulia Iordache
05/04/2023, 6:40 PMHulia Iordache
05/04/2023, 6:40 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Hulia Iordache
05/04/2023, 6:41 PMHulia Iordache
05/04/2023, 6:41 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Hulia Iordache
05/04/2023, 7:27 PMYousaf Nabi (pactflow.io)
2023/05/04 19:44:25 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0
2023/05/04 19:44:25 [INFO] checking pact-provider-verifier within range >= 1.31.0, < 2.0.0
2023/05/04 19:44:25 [INFO] checking pact-broker within range >= 1.22.3
2023/05/04 19:44:26 [INFO] mock WARN: Please note: we are tracking events anonymously to gather important usage statistics like Pact-Ruby version and operating system. To disable tracking, set the 'PACT_DO_NOT_TRACK' environment variable to 'true'.
2023/05/04 19:44:26 [INFO] INFO WEBrick 1.8.1
2023/05/04 19:44:26 [INFO] INFO ruby 3.2.2 (2023-03-30) [x86_64-linux]
2023/05/04 19:44:26 [INFO] INFO WEBrick::HTTPServer#start: pid=3796 port=41789
2023/05/04 19:44:26 [INFO] INFO: Writing pact before shutting down
2023/05/04 19:44:26 [INFO]
2023/05/04 19:44:26 [INFO] Writing pact for pactflow-example-provider-golang to /home/runner/work/example-consumer-golang/example-consumer-golang/pacts/pactflow-example-consumer-golang-pactflow-example-provider-golang.json
2023/05/04 19:44:26 [INFO] ERROR ThreadError: can't be called from trap context\n\t/home/runner/work/example-consumer-golang/example-consumer-golang/pact/lib/ruby/lib/ruby/3.2.0/timeout.rb:184:in `synchronize'
2023/05/04 19:44:26 [INFO] INFO going to shutdown ...
2023/05/04 19:44:27 [INFO] INFO WEBrick::HTTPServer#start done.
--- PASS: TestConsumer (1.95s)
PASS
ok <http://github.com/pactflow/example-consumer-golang|github.com/pactflow/example-consumer-golang> 1.958s
The tests pass but it fails to write the pact file,
It looks be a change in ruby behaviour in 3.1+
https://github.com/rapid7/metasploit-framework/issues/17593
which is causing this issue, I can recreate that above issue on my mac.
It isn't clear if that is the issue you are seeing as you haven't provided the error message, but that is a good start for meYousaf Nabi (pactflow.io)
Hulia Iordache
05/04/2023, 7:52 PMHulia Iordache
05/04/2023, 8:03 PM2023/05/04 13:28:49 [ERROR] service: Could not load existing consumer contract from /...../pacts/xxxxxx.json due to undefined method `key?' for nil:NilClass. Creating a new file.
Hulia Iordache
05/04/2023, 8:53 PMYousaf Nabi (pactflow.io)
brew install pact-ruby-standalone@1