Skip to content

gRPC TestifyPowerful gRPC Testing Framework

Test your gRPC services with ease. Simple syntax, powerful assertions, comprehensive coverage.

Quick Start

1. Install

bash
curl -LO https://github.com/gripmock/grpctestify/releases/latest/download/grpctestify.sh
chmod +x grpctestify.sh

2. Write Test

php
--- ADDRESS ---
localhost:4770

--- ENDPOINT ---
hello.HelloService/SayHello

--- REQUEST ---
{
  "name": "World"
}

--- RESPONSE ---
{
  "message": "Hello, World!"
}

Note: For unary RPC, use either RESPONSE OR ASSERTS, not both. Use RESPONSE with_asserts if you need both.

3. Run Test

bash
./grpctestify.sh test.gctf

What You Can Test

📡 gRPC Patterns

gRPC supports four main communication patterns, each with different testing approaches:

Unary RPC (Request-Response)

Simple one-to-one communication - perfect for basic operations

php
--- ENDPOINT ---
user.UserService/GetUser

--- REQUEST ---
{ "user_id": "123" }

--- RESPONSE ---
{ "user": { "id": "123", "name": "John" } }

Note: Use either RESPONSE OR ASSERTS for unary RPC.

Server Streaming (One-to-Many)

Server sends multiple responses to a single request - ideal for real-time data

php
--- ENDPOINT ---
monitor.DeviceService/StreamMetrics

--- REQUEST ---
{ "device_id": "sensor_001" }

--- ASSERTS ---
.metric_type == "temperature"
.metric_value > 0

--- ASSERTS ---
.metric_type == "humidity"
.metric_value <= 100

Client Streaming (Many-to-One)

Client sends multiple requests, server responds once - great for batch operations

php
--- ENDPOINT ---
upload.FileService/UploadChunks

--- REQUEST ---
{ "chunk": "data1", "sequence": 1 }

--- REQUEST ---
{ "chunk": "data2", "sequence": 2 }

--- RESPONSE ---
{ "status": "completed", "total_chunks": 2 }

Bidirectional Streaming (Many-to-Many)

Full duplex communication - perfect for real-time applications

php
--- ENDPOINT ---
chat.ChatService/StreamMessages

--- REQUEST ---
{ "message": "Hello", "user": "alice" }

--- ASSERTS ---
.message | contains("Hello")
.user == "alice"

--- REQUEST ---
{ "message": "Hi there!", "user": "bob" }

--- ASSERTS ---
.message | contains("Hi")
.user == "bob"

🔒 Security & Authentication

TLS, headers, and secure endpoints

php
--- TLS ---
ca_cert: ./certs/ca.pem
cert: ./certs/client.pem

--- REQUEST_HEADERS ---
authorization: Bearer token
x-api-key: your-secret-key

--- ENDPOINT ---
secure.SecureService/GetData

Documentation

🚀 Getting Started

🎯 Testing Patterns

📖 Reference

Learning Path

  1. Install & Setup - Get gRPC Testify running on your system → Start Here

  2. Write First Test - Create and run your first gRPC test → Learn More

  3. Master Patterns - Learn unary, streaming, and error testing → Explore

  4. Advanced Features - Parallel execution, plugins, and performance → Advanced

IDE Integration

📝 VS Code Extension

Enhanced .gctf editing with syntax highlighting, auto-completion, and validation → Install Extension

🌐 Web Generator

Interactive web interface for creating .gctf files with templates and examples → Try Generator

Ready to Start?

Begin your gRPC testing journey. Join thousands of developers who trust gRPC Testify for their testing needs.

Released under the MIT License.