server

command module
v2.1.0-alpha5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README ΒΆ

keploy logo

⚑️ Backend tests faster than unit tests, from user traffic ⚑️

🌟 The must-have tool for developers in the AI-Gen era 🌟


Join our Community!

Keploy Twitter Help us reach 4k stars! Keploy CNCF Landscape

🎀 Introducing Keploy 🐰

Keploy is a developer-centric API testing tool that creates backend tests along with built-in-mocks, faster than unit tests.

Keploy record API calls and replays them during testing, making it easy to use, powerful, and extensible. Here are Keploy's core features: πŸ› 

Convert API calls to test cases
  • ♻️ Combined Test Coverage: Merge your Keploy Tests with your fave testing libraries(JUnit, go-test, py-test, jest) to see a combined test coverage.

  • πŸ€– EBPF Instrumentation: Keploy uses EBPF like a secret sauce to make integration code-less, language-agnostic, and oh-so-lightweight.

  • 🌐 CI/CD Integration: Run tests with mocks anywhere you likeβ€”locally on the CLI, in your CI pipeline (Jenkins, Github Actions..) , or even across a Kubernetes cluster.

  • πŸ“½οΈ Record-Replay Complex Flows: Keploy can record and replay complex, distributed API flows as mocks and stubs. It's like having a time machine for your testsβ€”saving you tons of time!

  • 🎭 Multi-Purpose Mocks: You can also use keploy Mocks, as server Tests!

🐰 Fun fact: Keploy uses itself for testing! Check out our swanky coverage badge: Coverage Status  

🎩 How's the Magic Happen?

Keploy proxy captures and replays ALL(CRUD operations, including non-idempotent APIs) of your app's network interactions.

Take a journey to How Keploy Works? to discover the tricks behind the curtain!

Record Replay Testing

πŸ“˜ Documentation!

Become a Keploy pro with Keploy Documentation.

πŸ› οΈ Platform-Specific Requirements for Keploy

Below is a table summarizing the tools needed for both native and Docker installations of Keploy on MacOS, Windows, and Linux:

Operating System Without Docker Docker Installation Prerequisites
MacOS MacOS Not Supported Supported Docker Desktop version must be 4.25.2 or above
Windows Windows Supported Supported - Use WSL wsl --install
- Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11
Linux Linux Supported Supported Linux kernel 5.15 or higher

On MacOS and Windows, additional tools are required for Keploy due to the lack of native eBPF support.

πŸš€ Quick Installation

Integrate Keploy by installing the agent locally. No code-changes required.

curl -O https://raw.githubusercontent.com/keploy/keploy/main/keploy.sh && source keploy.sh

🎬 Recording Testcases

Start your app wit Keploy to convert API calls as Tests and Mocks/Stubs.

keploy record -c "CMD_TO_RUN_APP" 

For example, if you're using a simple Python app the CMD_TO_RUN_APP would resemble to python main.py, for Golang go run main.go, for java java -jar xyz.jar, for node npm start..

keploy record -c "python main.py"

πŸ§ͺ Running Tests

Shut down the databases, redis, kafka or any other services your application uses. Keploy doesn't need those during test.

keploy test -c "CMD_TO_RUN_APP" --delay 10

βœ… Test Coverage Integration

To integrate with your unit-testing library and see combine test coverage, follow this test-coverage guide.

If You Had Fun: Please leave a 🌟 star on this repo! It's free, and you'll bring a smile. πŸ˜„ πŸ‘

πŸ€” Questions?

Reach out to us. We're here to help!

Slack LinkedIn YouTube Twitter

🌐 Language Support

From Go's gopher 🐹 to Python's snake 🐍, we support:

Go Java NodeJS Rust Python

🫰 Let's Build Together! 🧑

Whether you're a newbie coder or a wizard πŸ§™β€β™€οΈ, your perspective is golden. Take a peek at our:

πŸ“œ Contribution Guidelines

❀️ Code of Conduct

🐲 Current Limitations!

  • Unit Testing: While Keploy is designed to run alongside unit testing frameworks (Go test, JUnit..) and can add to the overall code coverage, it still generates integration tests.
  • Production Lands: Keploy is currently focused on generating tests for developers. These tests can be captured from any environment, but we have not tested it on high volume production environments. This would need robust deduplication to avoid too many redundant tests being captured. We do have ideas on building a robust deduplication system #27

✨ Resources!

πŸ€” FAQs

πŸ•΅οΈβ€οΈ Why Keploy

βš™οΈ Installation Guide

πŸ“– Contribution Guide

Documentation ΒΆ

Overview ΒΆ

Package main is the entry point for the keploy application.

Directories ΒΆ

Path Synopsis
cli
Package cli provides functionality for the command-line interface of the application.
Package cli provides functionality for the command-line interface of the application.
provider
Package provider provides functionality for the keploy provider.\
Package provider provides functionality for the keploy provider.\
Package config provides configuration structures for the application.
Package config provides configuration structures for the application.
pkg
Package pkg provides utility functions for Keploy.
Package pkg provides utility functions for Keploy.
core
Package core provides functionality for managing core functionalities in Keploy.
Package core provides functionality for managing core functionalities in Keploy.
core/app
Package app provides functionality for managing applications.
Package app provides functionality for managing applications.
core/app/docker
Package docker provides functionality for working with Docker containers.
Package docker provides functionality for working with Docker containers.
core/hooks
Package hooks provides functionality for managing hooks.
Package hooks provides functionality for managing hooks.
core/hooks/conn
Package conn provides functionality for handling connections.
Package conn provides functionality for handling connections.
core/hooks/structs
Package structs provides data structures for hooks.
Package structs provides data structures for hooks.
core/proxy
Package proxy provides functionality for handling proxies.
Package proxy provides functionality for handling proxies.
core/proxy/integrations
Package integrations provides functionality for integrating different types of services.
Package integrations provides functionality for integrating different types of services.
core/proxy/integrations/generic
Package generic provides functionality for decoding generic dependencies.
Package generic provides functionality for decoding generic dependencies.
core/proxy/integrations/grpc
Package grpc provides functionality for integrating with gRPC outgoing calls.
Package grpc provides functionality for integrating with gRPC outgoing calls.
core/proxy/integrations/http
Package http provides functionality for handling HTTP outgoing calls.
Package http provides functionality for handling HTTP outgoing calls.
core/proxy/integrations/mongo
Package mongo provides functionality for working with MongoDB outgoing calls.
Package mongo provides functionality for working with MongoDB outgoing calls.
core/proxy/integrations/mysql
Package mysql provides integration with MySQL outgoing.
Package mysql provides integration with MySQL outgoing.
core/proxy/integrations/postgres/v1
Package v1 provides functionality for decoding Postgres requests and responses.
Package v1 provides functionality for decoding Postgres requests and responses.
core/proxy/integrations/scram
Package scram provides functionality for SCRAM authentication.
Package scram provides functionality for SCRAM authentication.
core/proxy/integrations/util
Package util provides utility functions for the integration package.
Package util provides utility functions for the integration package.
core/proxy/util
Package util provides utility functions for the proxy package.
Package util provides utility functions for the proxy package.
graph
Package graph provides the resolver implementation for the GraphQL schema.
Package graph provides the resolver implementation for the GraphQL schema.
models
Package models provides data models for the keploy.
Package models provides data models for the keploy.
platform/telemetry
Package telemetry provides functionality for telemetry data collection.
Package telemetry provides functionality for telemetry data collection.
platform/yaml
Package yaml provides utility functions for working with YAML files.
Package yaml provides utility functions for working with YAML files.
platform/yaml/configdb
Package configdb provides functionality for working with keploy configuration databases.
Package configdb provides functionality for working with keploy configuration databases.
platform/yaml/mockdb
Package mockdb provides a mock database implementation.
Package mockdb provides a mock database implementation.
platform/yaml/reportdb
Package reportdb provides functionality for managing test reports in a database.
Package reportdb provides functionality for managing test reports in a database.
platform/yaml/testdb
Package testdb provides functionality for working with test databases.
Package testdb provides functionality for working with test databases.
service/record
Package record provides functionality for recording and managing test cases and mocks.
Package record provides functionality for recording and managing test cases and mocks.
service/replay
Package replay provides functions for replaying requests and comparing responses.
Package replay provides functions for replaying requests and comparing responses.
service/tools
Package tools provides utility functions for the service package.
Package tools provides utility functions for the service package.
Package utils provides utility functions for the Keploy application.
Package utils provides utility functions for the Keploy application.
log
Package log provides utility functions for logging.
Package log provides utility functions for logging.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL