Skip to main content
Version: 3.0.0

Contribution Guide πŸš€β€‹

Welcome to the world of Keploy development! This guide will help you set up Keploy locally.

1. Setting Up Your Platform:​

If you want to try Keploy on macOS or Windows, no worries β€” you’ll just need to set up a Linux VM.

  • For macOS, install Lima.
  • If you're on Windows, install WSL.

Note: Linux Users are good to go.

2. Pre-requisites:​

First things first, ensure you have Golang installed.

3. Clone Keploy Repository:​

Time to get your hands on Keploy!:

git clone https://github.com/keploy/keploy.git && cd keploy
go mod download

Once done, build the binary

go build -race -tags=viper_bind_struct -o keploy .
sudo mv keploy /usr/local/bin/
sudo chmod +x /usr/local/bin/keploy

Now we have successfully set up Keploy. Let’s test it with the sample app.

Keploy operates in two modes:​

  • record: Capture Keploy test cases from API calls.
  • test: Execute recorded test cases and validate assertions.

The Keploy CLI operates by capturing all network traffic between your application and its dependencies.

It meticulously records API calls, database queries, and any other interactions your application engages in.

Once the recording phase is complete, Keploy can effortlessly generate test cases and data mocks in YAML format.

If you don't have any samples app, you can use the gin-mongo URL Shortener sample application:

Let's clone sample app repo:​

git clone https://github.com/keploy/samples-go.git && cd samples-go/gin-mongo
go mod download # Download dependencies:
go build -o gin-mongo-binary # Generate binary of the application:

4. Now let's try running keploy:​

Capturing Test Cases:​

sudo keploy record -c "path/to/go/binary"

Running Test Cases:​

sudo keploy test -c "path/to/go/binary" --delay 10

Note: Use the --debug flag to run Keploy in debug mode for detailed logs.

Also you can Test Locally Built Docker Image:​

Build Docker Image:​

Note: Run the below command inside the keploy respository and make sure there is no directory by the name of keploy inside the main keploy repository.

sudo docker image build -t ghcr.io/keploy/keploy:v2-dev .

Remember setting up the Keploy binary. See Setup Keploy using Binary for details.​

Capture Test Cases:​

sudo keploy record -c "docker run -p -p <appPort>:<hostPort>  --name <containerName> --network keploy-network --rm <imageName>"

Running Test Cases:​

sudo keploy test -c "docker run -p -p <appPort>:<hostPort>  --name <containerName> --network keploy-network --rm <imageName>" --delay 10

There you have it! With this guide, you're all set to dive into Keploy development.

Happy testing! πŸ§ͺπŸ”πŸ’»

Note :- Run go run github.com/99designs/gqlgen generate --config pkg/graph/gqlgen.yml to generate the graphql server stubs which can be used when working with unit testing libraries like JUnit, PyTest, etc..

Hope this helps you out, if you still have any questions, reach out to us on slack .

Questions? πŸ€”πŸ’­

For any support please join keploy slack community to get help from fellow users, or book a demo if you're exploring enterprise use cases.