server

command module
v2.3.0-beta41 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

README ΒΆ

keploy logo

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

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


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

Slack LinkedIn YouTube Twitter

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

Keploy not only records API calls, but also records database calls and replays them during testing, making it easy to use, powerful, and extensible.

Convert API calls to test cases

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

🚨 Here for Unit Test Generator (ut-gen)?

Keploy has newly launched the world's first unit test generator(ut-gen) implementation of Meta LLM research paper, it understands code semantics and generates meaningful unit tests, aiming to:

  • Automate unit test generation (UTG): Quickly generate comprehensive unit tests and reduce redundant manual effort.

  • Improve edge cases: Extend and improve the scope of automated tests to cover more complex scenarios, often missed manually.

  • Boost test coverage: As codebases grow, ensuring exhaustive coverage should become feasible, aligning with our mission.

πŸ“œ Follow Unit Test Generator README! βœ…

πŸ“˜ Documentation!

Become a Keploy pro with Keploy Documentation.

Record Replay Testing

πŸš€ Quick Installation (API test generator)

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

curl --silent -O -L https://keploy.io/install.sh && source install.sh

🎬 Recording Testcases

Start your app with 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 will bring a smile. πŸ˜„ πŸ‘

One-Click Setup πŸš€

Setup and run keploy quickly, with no local machine installation required:

GitHub Codescape

πŸ€” 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

🫰 Keploy Adopters 🧑

So you and your organisation are using Keploy? That’s great. Please add yourselves to this list, and we'll send you goodies! πŸ’–

We are happy and proud to have you all as part of our community! πŸ’–

🎩 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!

Here are Keploy's core features: πŸ› 

  • ♻️ 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!

πŸ‘¨πŸ»β€πŸ’» 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/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 handles all the outgoing network calls and captures/forwards the request and response messages.
Package proxy handles all the outgoing network calls and captures/forwards the request and response messages.
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 the MySQL integration.
Package mysql provides the MySQL integration.
core/proxy/integrations/mysql/recorder
Package recorder is used to record the MySQL traffic between the client and the server.
Package recorder is used to record the MySQL traffic between the client and the server.
core/proxy/integrations/mysql/replayer
Package replayer is used to mock the MySQL traffic between the client and the server.
Package replayer is used to mock the MySQL traffic between the client and the server.
core/proxy/integrations/mysql/utils
Package utils provides utility functions for MySQL packets
Package utils provides utility functions for MySQL packets
core/proxy/integrations/mysql/wire
Package wire provides encoding and decoding operation of MySQL packets.
Package wire provides encoding and decoding operation of MySQL packets.
core/proxy/integrations/mysql/wire/phase
Package phase contains the encoding and decoding functions for the different phases of the MySQL protocol.
Package phase contains the encoding and decoding functions for the different phases of the MySQL protocol.
core/proxy/integrations/mysql/wire/phase/conn
Package conn provides decoding and encoding of connection phase mysql packets
Package conn provides decoding and encoding of connection phase mysql packets
core/proxy/integrations/mysql/wire/phase/query
Package query provides functions to decode MySQL command phase packets.
Package query provides functions to decode MySQL command phase packets.
core/proxy/integrations/mysql/wire/phase/query/preparedstmt
Package preparedstmt provides functionality for decoding prepared statement packets.
Package preparedstmt provides functionality for decoding prepared statement packets.
core/proxy/integrations/mysql/wire/phase/query/rowscols
Package rowscols provides encoding and decoding of MySQL row & column packets.
Package rowscols provides encoding and decoding of MySQL row & column packets.
core/proxy/integrations/mysql/wire/phase/query/utility
Package utility provides encoding and decoding of utility command packets.
Package utility provides encoding and decoding of utility command packets.
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/redis
Package redis is the decode point for the redis application.
Package redis is the decode point for the redis application.
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/tls
Package tls provides functionality for handling tls connetions.
Package tls provides functionality for handling tls connetions.
core/proxy/util
Package util provides utility functions for the proxy package.
Package util provides utility functions for the proxy package.
core/tester
Package tester provides functionality for testing keploy with itself
Package tester provides functionality for testing keploy with itself
matcher
Package matcher for matching utilities
Package matcher for matching utilities
matcher/http
Package http for http matching
Package http for http matching
matcher/schema
Package schema for schema matching
Package schema for schema matching
models
Package models provides data models for the keploy.
Package models provides data models for the keploy.
models/mysql
Package mysql in models provides realted structs for mysql protocol
Package mysql in models provides realted structs for mysql protocol
platform/auth
Package auth defines methods for authenticating with GitHub.
Package auth defines methods for authenticating with GitHub.
platform/coverage
Package coverage defines the interface for coverage services.
Package coverage defines the interface for coverage services.
platform/coverage/golang
Package golang implements the methods for golang coverage services.
Package golang implements the methods for golang coverage services.
platform/coverage/java
Package java implements the methods for java coverage services.
Package java implements the methods for java coverage services.
platform/coverage/javascript
Package javascript implements the methods for javascript coverage services.
Package javascript implements the methods for javascript coverage services.
platform/coverage/python
Package python implements the methods for python coverage services.
Package python implements the methods for python coverage services.
platform/docker
Package docker provides functionality for working with Docker containers.
Package docker provides functionality for working with Docker containers.
platform/storage
Package storage defines methods for storage DB.
Package storage defines methods for storage DB.
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/testset
Package testset provides functionality for working with keploy testset level configs like templates, post/pre script.
Package testset provides functionality for working with keploy testset level configs like templates, post/pre script.
platform/yaml/configdb/user
Package user provides functionality for working with keploy user configs like installation id.
Package user provides functionality for working with keploy user configs like installation id.
platform/yaml/mockdb
Package mockdb provides a mock database implementation.
Package mockdb provides a mock database implementation.
platform/yaml/openapidb
Package openapidb provides a openAPI database implementation.
Package openapidb provides a openAPI 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
Package service provides the service interface for the service package.
Package service provides the service interface for the service package.
service/contract
Package contract provides the implementation of the contract service
Package contract provides the implementation of the contract service
service/contract/consumer
Package consumer is a package for consumer driven contract testing
Package consumer is a package for consumer driven contract testing
service/contract/provider
Package provider is a package for provider driven contract testing
Package provider is a package for provider driven contract testing
service/export
Package export contains the implementation of the export service which exports the curl commands from the YAML testcases to a Postman collection.
Package export contains the implementation of the export service which exports the curl commands from the YAML testcases to a Postman collection.
service/orchestrator
Package orchestrator acts as a main brain for both the record and replay services
Package orchestrator acts as a main brain for both the record and replay services
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 the hooks for the replay service
Package replay provides the hooks for the replay service
service/tools
Package tools provides utility functions for the service package.
Package tools provides utility functions for the service package.
service/utgen
Package utgen is a service that generates unit tests for a given source code file.
Package utgen is a service that generates unit tests for a given source code file.
service/utgen/assets
Package settings provides prompt settings for the test generation
Package settings provides prompt settings for the test generation
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