Happy November everyone! I'm sure holidays for most are fast approaching, and as it's the season for giving, we'll be sharing all the updates across the Pact community and giving you a heads-up about our latest webinar where you can see all of SmartBears open source tools in action, including yours truly, Pact.
OSS Updates
- Pact Compatibility Suite
- Pact Reference
- Pact PHP
- Pact Python
- Pact Broker Client
- Pact MSW Adapter
Pact Compatibility Suite
Tien Vo (Pact-PHP), and Josh Ellis (Pact-Python), have both been working on verifying their Pact client implementations against the new Pact Compatibility Suite.
It will help root out inconsistencies in implementations and ensure feature parity. If you are interested in checking it out, or contributing, please jump in. You can retrospectively apply the tests against existing implementations to ascertain their completeness/correctness.
This will be a massive boost to end users, so we would appreciate any help!
Pact Reference
As Tien as been working through the compatibility suite, he has noted some improvements that can be made to the Pact-FFI, which would otherwise has been found sporadically usually through end-user issues.
- fix: Fallback to always generate a value to fix 'Could not generate a random TYPE from null'
- chore: Add compatability-suite V4 tests to CI
- feat: Apply generators to message's contents
- feat: Apply generators to message's metadata
- feat: Apply generators to message's contents and metadata
- feat: Add pactffi_message_with_metadata_v2
- refactor: Reuse matching rules and generators processing code
Pact-PHP
Tien brings more features to the ffi
branch of pact-php
- feat: Support inheritance for body
- feat: Allow capture verifier output
- feat: Allow capture mock server mismatches
Pact Python
Josh implemented the Pact (Consumer) Compatibility Suite (V1) in this PR utilizing the pact_ffi core, great steps in progress towards full specification compatibility, and that juicy V3 and V4 Pact Spec goodness, you Pythonista's have been waiting for.
Pact Broker Client
Two new features arrive in the Pact-Broker Client.
pact-broker publish PACT_DIRS_OR_FILES --auto-detect-version-properties
- When publishing Pacts, by setting
--auto-detect-version-properties
, you can now automatically detect the repository commit, branch and build URL from known CI environment variables or git CLI. - Supports Buildkite, Circle CI, Travis CI, GitHub Actions, Jenkins, Hudson, AppVeyor, GitLab, CodeShip, Bitbucket and Azure DevOps.
--auto-detect-version-properties
is aliased to-r
to ease of use- The recent feature improvement introduces the detection of the
commit
andbuildUrl
, rather than only the branch, greatly simplifying our recommended Pact Nirvana workflows for users
- When publishing Pacts, by setting
delete-branch
- Users now can delete branches from the CLI
Pact MSW Adapter
Mock Service Worker (MSW) has fast been becoming the industry standard API mocking for JavaScript, we heard that cry, and created a project to help you leverage the contract testing goodness of Pact, with the power of MSW.
At the end of October, Artem, MSW's creator announced the launch of MSW v2.0, with a raft of changes to improve the life of end-users and plugin authors.
Not long after, Jakub Riedl from CultureAmp, long time friends of Pact, helped bring our adapter in line with MSW v2.0. You can check out the PR here. This is actually his third contribution to the adapter, which is awesome to see.
Not only that, Joel Whalen has been working on support for GraphQL, in the adapter. Already supported by MSW, this would allow for MSW gql interactions to generate Pact contracts. You can check out his progress here.
I also noted whilst I was npm surfing, a new pact-msw package has been launched, this isn't an officially supported version but it's always great to see people working with Pact in the wild, so it might be worth your time checking it out.
Maintainer Meets
Want to help shape the future of Pact? Why not join us?
We catch up every week with alternating times for the sessions, to aid with syncing with Europe / Austrailian members
- 9am-9:45am UTC
- 9pm-9:45pm UTC
You can download a calender invite from our DevRel repository, see Pact Community Meeting.ics
A google document holds our agenda which is openly editable and where anyone can table ideas for discussion.
Pact in the wild
Bazel + Pact
We spoke with Olivier Picaud back in July, about the work he was doing with Bazel & Pact, and why it was so important, personally for him.
We have an update
Hello,
I have worked to associate Pact within Bazel by providing rules_pact The good news is that rules_pact has been accepted to be part of the official Bazel Central Registry
Happy to share this contribution with you guys and again thanks to help teams to facilitate their testing journey :)
Voilà :)
Olivier
You can check out the GitHub repo https://github.com/opicaud/rules_pact and a full worked example in https://github.com/opicaud/monorepo
Community Events
Are you hosting a Pact event? Let us know and we can feature it in the blog and list it on our events section.
Show and Tell: Discover the Benefits SmartBear’s Open-Source Tools Bring to the SDLC
On Tuesday Dec 5th 2023 at 10am ET, the SmartBear Dev-Rel team will be showcasing OpenAPI, Swagger, Stoplight, Pact and SoapUI and how they can be used across your SDLC, along with tips, links and pointers on how to get involved with these open-source tools and communities.
You can register here, where if you can't make it, you'll be sent an recording for on-demand viewing.
Community Corner
Omer Morad introduces Automock
We spoke to Omer Morad back in June 2022, where he introduced NestJS-Pact into the Pact Foundation fold. We caught up with him this week, to find out what he's been up to.
Welcome Omer, we heard from you around a year ago in one of our community corner updates. I hear you’ve been working on a new open source project, would you like to tell our readers a little about it?
I've been working on Automock, an open-source mocking framework. Much of my time has been spent manually mocking for unit tests in dependency injection environments like NestJS. It may cause test suites to become unmanageably large and convoluted. For this reason, I made Automock. By creating mock objects for class dependencies automatically, it simplifies the unit testing procedure. Compatibility across multiple DI and testing frameworks will make the unit testing process easier by allowing developers to focus on writing test cases rather than manually configuring mock configurations.
Awesome! Thanks for sharing with us, hopefully this Automock is useful to others. You can find Omer in our Pact Slack group where you can talk about all things open source.
Thats a wrap
That’s it for this month. Stay safe and carry on coding!
- Yousaf Nabi — Developer Advocate at PactFlow and Community Shepherd at Pact.