Hi, pact-foundation team, I recently joined the co...
# general
h
Hi, pact-foundation team, I recently joined the community and need some blob help I see in the pact-ruby-standalone/releases/tag/v2.0.0 that breaking changes are mentioned for naming conventions and I can confirm that the old consumer tests that used to work with previous versions, are not passing any more with the latest version 2.0.0. 1. I would like to understand why the naming conventions change impacts the test execution 2. there is a way to specify the version for the brew install command line? currently, the latest version is pulled. there is any other solution/suggestion to fix this? thankyou
y
Hey @Hulia Iordache Please can you raise the exact errors you are seeing, as an issue on the pact-ruby-standalone repository, There is a link to a pull request on the release notes, that show the extent of the changes (major bump in ruby runtime from 2.4 -> 3.2 ) and the build system that packages it, hence the major version bump
2. there is a way to specify the version for the brew install command line? currently, the latest version is pulled. there is any other solution/suggestion to fix this? no there isn't it is a limitation with homebrew, you need to have different versions formulas and install different versions something like https://github.com/isen-ng/homebrew-dotnet-sdk-versions obviously that isn't helpful to you now if you check the previous releases, release notes, you will see instructions on how to install that fixed version 👍
assuming your are on osx
Copy code
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
h
@Yousaf Nabi (pactflow.io) thank you, we will try to figure it out, and come back if needed.
y
If you could just try and let us know by raising an issue, with at least the operating system, how you are using it, which tests are failing and what error messages you are seeing, that would be helpful, we have CI runs across several architectures at the moment that are saying it is working. I helped participate in the upgrade from 2.4 from 3.2 of Ruby and have an open pul l request on the build system that supports it, so it would be beneficial to share, so we can fix forward. For homebrew you could fork the repo, and revert the latest change installing it on any machine with
Copy code
brew tap yourgithubname/pact-ruby-standalone
brew install pact-ruby-standalone
You might need to
Copy code
brew untap pact-foundation/pact-ruby-standalone
h
now, we have encountered another issue with v1.91.0 - it is not working on the new m1 mac. are u aware of a possible issue?
y
yes you need rosetta on an non m1 mac for versions less than 2.0.0
thankyou 1
OSX ARM (M1/M2) Machines will require Rosetta tools, as the Ruby binaries as currently built for x86_64. If you don't already have it installed, you can use the following command
Copy code
sudo softwareupdate --install-rosetta --agree-to-license
it was in the readme for homebrew prior to having this PR merged https://github.com/pact-foundation/homebrew-pact-ruby-standalone/pull/92/files
hope that helps for the time being 🙂
could I ask how you are using the standalone in your tests? traditionally it would be used by client libraries, and anyone using the standalone tools have usually transitioned over to the rust based tools verifier https://docs.pact.io/implementation_guides/cli#native-binary-new mock server https://docs.pact.io/implementation_guides/rust/pact_mock_server_cli
h
I know, I am from crowdstrike, and we use the pact-go and as far as I can see, there is no stable version that implements the rust core
y
pact-go hasn't been updated to use the latest version
it's pinned to use less than 2.0.0
why or how have you installed that version?
in your pact-go tests? I'm not super familiar with v1 pact-go and how it downloads the right package, but that gives me more to go on 🙂
h
it was installed by a peer on his local machine
it is not used in the ci pipeline
y
ok so there is no issue
pact-go hasn't been updated to use the latest binaries
h
yes
thank you for your support
y
If your colleagues wishes to support the new binary packages in pact-go, they are welcome to raise an issue and/or pull request 👍 and pleasure
👍 1
Ahhh I see the issue for end users they are told to install the latest version via our install script which will pull the latest 2.0.0 version https://github.com/pact-foundation/pact-go#installation-on-nix Going to test this out now
🙏 1
working okay for me with latest of pact-go, pulling down the repo. Looks like it just shells out to the standalone tools on the path, so you should be able to run the tools outside of pact-go just on the path. It would be good to tell us what the error the user is seeing, that was with a fresh brew install of the standalone on an arm64 (m1) mac
h
did u have rosetta installed on this m1 mac?
y
Yes, Is this the issue your user is seeing https://github.com/pactflow/example-consumer-golang/actions/runs/4886667716/jobs/8722304524#step:4:43
Copy code
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 me
h
I fw your messages to our slack channel I will let u know tomorrow about the results, now it is already late for me thank you again for your help 🤗
ok, so, the consumer tests pass, but he is not able to publish the contract to local broker
Copy code
2023/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.
sorry, there was an invalid command executed… it may be ok now 😄
😆 1
y
Hey @Hulia Iordache, Just to let you know I am about to release a new version of homebrew-pact-ruby-standalone if you have any issues, you’ll be able to stick with the v1.x branch with the following command
brew install pact-ruby-standalone@1