-
Notifications
You must be signed in to change notification settings - Fork 7
Rfc pact ruby to rust transition #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
From Ruby to Rust - Improving the developer experience of Pact
|
consideration needed for cli api wrappers in
do we want to bring back client language wrappers at some point pact-ruby has a publishing interface |
|
Had a go at some sample docs with an overview of the tools and various installation methods. I think in a quick start, it might be good to show the central artefact, a pact file, and its differences between the specs (side by side tabs to switch between)
showcase mock server
user can now validate the output pact file against their the pacts in the getting started guide, either v1/v2/v3/v4 showcase pact verifier
showcase stub server
showcase pact broker
showcase pact dsl's - consumer
showcase pact dsl's - provider
Welcome to Pact CLI Tools🔗 Contract testing made simple - Get started with Pact tools across all platforms and architectures. Pact is a contract testing framework that enables consumer-driven contract testing, helping you build robust APIs and microservices. This document covers all available Pact tools and the multiple ways to install them on your system. 🛠️ Available ToolsUnified CLI (Recommended)pact - All-in-one CLI with extension support
Individual Toolspact-broker-client - Pact Broker interactions
pact-mock-server - Consumer testing
pact-verifier - Provider verification
pact-plugin - Protocol extensions
pact-stub-server - Integration testing
pact-legacy - Ruby-based tools
🚀 Installation MethodsScripts (Cross-Platform - Linux/MacOS/Windows ARM64/AMD64)*nix Users (including WSL/msys2/mingw)# Unified CLI
curl -fsSL https://raw.githubusercontent.com/you54f/pact-cli/main/install.sh | sh
# Aliased: curl -fsSL https://lin.get-pact.saf.dev | sh
# Broker Client
curl -fsSL https://raw.githubusercontent.com/you54f/pact-broker-cli/main/install.sh | shPowerShell (Windows)# Unified CLI
iwr -useb https://raw.githubusercontent.com/you54f/pact-cli/main/install.ps1 | iex
# Aliased: iwr -useb https://win.get-pact.saf.dev | iex
# Broker Client
iwr -useb https://raw.githubusercontent.com/you54f/pact-broker-cli/main/install.ps1 | iexCargo (Any Rust-supported target)# Unified CLI
cargo install pact
# Individual tools
cargo install pact-plugin-cli
cargo install pact-stub-server
cargo install pact_mock_server_cli
cargo install pact_verifier_cliHomebrew (MacOS/Linux ARM64/AMD64)# Unified CLI
brew install you54f/brew/pact
# Individual tools
brew tap pact-foundation/brew
brew install pact-foundation/brew/pact-mock-server
brew install pact-foundation/brew/pact-stub-server
brew install pact-foundation/brew/pact-verifier
brew install pact-foundation/brew/pact-plugin
brew install pact-foundation/brew/pact-broker-client
brew install pact-foundation/brew/pact-legacyScoop (Windows ARM64/AMD64)# Unified CLI
scoop bucket add pact https://github.com/you54f/scoop
scoop install pact
# Individual tools
scoop install pact-mock-server
scoop install pact-stub-server
scoop install pact-verifier
scoop install pact-plugin
scoop install pact-broker-client
scoop install pact-legacyGitHub Actions Example- name: Install Pact via Scoop
if: runner.os == 'Windows'
shell: powershell
run: |
scoop bucket add pact https://github.com/you54f/scoop
scoop install pact
scoop search pact
pact --helpChocolatey (Windows ARM64/AMD64)# Unified CLI
curl https://github.com/YOU54F/choco/releases/download/choco/pact.0.9.0.nupkg -OutFile pact.nupkg
choco install -y pact --source .
# Windows on ARM - requires ForceARM64 parameter
choco install pact --params "'/ForceARM64:true'"Individual Packageschoco install pact-broker-client
# Download: https://github.com/YOU54F/choco/releases/download/choco/pact-broker-client.0.4.1.nupkg
choco install pact-mock-server
# Download: https://github.com/YOU54F/choco/releases/download/choco/pact-mock-server.2.1.0.nupkg
choco install pact-verifier
# Download: https://github.com/YOU54F/choco/releases/download/choco/pact-verifier.1.3.0.nupkg
choco install pact-plugin
# Download: https://github.com/YOU54F/choco/releases/download/choco/pact-plugin.0.2.0.nupkg
choco install pact-stub-server
# Download: https://github.com/YOU54F/choco/releases/download/choco/pact-stub-server.0.7.0.nupkg
choco install pact-legacy
# Download: https://github.com/YOU54F/choco/releases/download/choco/pact-legacy.2.5.6.nupkgChocolatey GitHub Actions Example- name: Install Pact via Chocolatey
if: runner.os == 'Windows'
shell: powershell
run: |
curl https://github.com/YOU54F/choco/releases/download/choco/pact.0.9.0.nupkg -OutFile pact.nupkg
if ("${{ runner.arch }}" -eq "ARM64") {
choco install -y pact --source . --params "'/ForceARM64:true'"
} else {
choco install -y pact --source .
}
pact --helpGitHub ActionsDirect action installation available: # Unified CLI
- uses: you54f/pact-cli@main
- name: Show help
run: |
pact --help
pact broker --help
# Broker Client
- uses: pact-foundation/pact-broker-cli@main
- name: Show help
run: pact-broker-cli --helpDocker (ARM64/AMD64)# Unified CLI
docker run --rm -it you54f/pact:latest
# Individual tools
docker run --rm -it you54f/pact-broker-cli:latest
docker run --rm -it you54f/pact-mock-server:latest
docker run --rm -it you54f/pact-stub-server:latest
docker run --rm -it you54f/pact-verifier:latest🏗️ Platform Support
🚦 Quick Start Guide1. Choose Your Installation Method
2. Start with the Unified CLI (Recommended)# Install unified CLI (method varies by platform)
pact --version
pact --help
# List available extensions
pact extension list
# Install popular extensions
pact extension install pactflow-ai3. Basic Usage Examples# Mock server for consumer testing
pact mock --port 8080 --pact-dir ./pacts
# Verify provider
pact verify --pact-url ./consumer-provider.json --provider-base-url http://localhost:8080
# Publish to broker
pact broker publish ./pacts --broker-base-url https://broker.com
# Check deployment safety
pact broker can-i-deploy --pacticipant MyApp --version 1.0.0 --to production📚 Documentation & Resources
🤝 Community & Support
🎯 Which Tool Should I Use?For New Projects→ Unified CLI ( For Existing Workflows→ Individual tools - Drop-in replacements for existing Ruby tools For CI/CD Pipelines→ Docker images or GitHub Actions - Consistent, reproducible environments For Development→ Package managers (Homebrew, Scoop, Chocolatey) - Easy installation and updates Ready to get started? Choose your preferred installation method above and dive into contract testing with Pact! 🚀 |
Rendered view
linked work