You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Keploy CLI operates by capturing all network traffic between your application and its dependencies.
40
-
It meticulously records API calls, database queries, and any other interactions your application engages in.
39
+
```shell
40
+
go build -race -tags=viper_bind_struct -o keploy .
41
+
sudo mv keploy /usr/local/bin/
42
+
sudo chmod +x /usr/local/bin/keploy
43
+
```
41
44
42
-
Once the recording phase is complete, Keploy can effortlessly generate test cases and data mocks in YAML format.
45
+
**_Now we have successfully set up Keploy. Let’s test it with the sample app._**
43
46
44
47
#### Keploy operates in two modes:
45
48
46
49
-`record`: Capture Keploy test cases from API calls.
47
50
-`test`: Execute recorded test cases and validate assertions.
48
51
49
-
To dive into Keploy, you can use the [gin-mongo URL Shortener](https://github.com/keploy/samples-go/tree/main/gin-mongo) sample application:
52
+
The Keploy CLI operates by capturing all network traffic between your application and its dependencies.
53
+
54
+
It meticulously records API calls, database queries, and any other interactions your application engages in.
55
+
56
+
Once the recording phase is complete, Keploy can effortlessly generate test cases and data mocks in YAML format.
57
+
58
+
If you don't have any samples app, you can use the [gin-mongo URL Shortener](https://github.com/keploy/samples-go/tree/main/gin-mongo) sample application:
50
59
51
60
#### Let's clone sample app repo:
52
61
@@ -56,110 +65,50 @@ go mod download # Download dependencies:
56
65
go build -o gin-mongo-binary # Generate binary of the application:
57
66
```
58
67
59
-
### Now let's try running keploy:
60
-
61
-
#### Capturing Test Cases:
62
-
63
-
```shell
64
-
go run -exec "sudo -E env 'PATH=$PATH'" -tags=viper_bind_struct main.go record -c "path/to/go/binary/of/application"
65
-
```
66
-
67
-
After entering record mode, send requests to your application to generate test cases.
68
-
69
-
#### Running Test Cases:
70
-
71
-
```shell
72
-
go run -exec "sudo -E env 'PATH=$PATH'" -tags=viper_bind_struct main.go test -c "path/to/go/binary/of/application" --delay 10
73
-
```
74
-
75
-
Run Keploy server to expose test APIs:
76
-
77
-
```shell
78
-
go run -exec "sudo -E env 'PATH=$PATH'" -tags=viper_bind_struct main.go test -c "path/to/go/binary/of/application" --delay 10 --coverage
79
-
```
80
-
81
-
Generated test cases can be found inside the Keploy directory.
#### Remember setting up the Keploy binary. See [Setup Keploy using Binary](#5-setup-keploy-using-binary) for details.
94
+
#### Remember setting up the Keploy binary. See [Setup Keploy using Binary](#3-clone-keploy-repository) for details.
148
95
149
96
#### Capture Test Cases:
150
97
151
98
```shell
152
-
sudo -E env PATH="$PATH" keployV2 record -c "docker run -p 8080:8080 --name <containerName>--network keploy-network --rm <imageName>"" --containerName <containerName>
99
+
sudo keploy record -c "docker run -p -p <appPort>:<hostPort> --name <containerName> --network keploy-network --rm <imageName>"
153
100
```
154
101
155
102
#### Running Test Cases:
156
103
157
104
```shell
158
-
sudo -E env PATH="$PATH" keployV2 test --c "docker run -p 8080:8080 --name <containerName> --network keploy-network --rm <imageName>" --delay 10
105
+
sudo keploy test -c "docker run -p -p <appPort>:<hostPort> --name <containerName> --network keploy-network --rm <imageName>" --delay 10
159
106
```
160
107
161
-
There you have it! With this guide, you're all set to dive into Keploy development. Happy testing! 🧪🔍💻
108
+
There you have it! With this guide, you're all set to dive into Keploy development.
109
+
110
+
Happy testing! 🧪🔍💻
162
111
163
112
> **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..
164
113
165
-
Hope this helps you out, if you still have any questions, reach out to us .
114
+
Hope this helps you out, if you still have any questions, reach out to us on [slack](https://keploy.slack.com/join/shared_invite/zt-357qqm9b5-PbZRVu3Yt2rJIa6ofrwWNg).
Copy file name to clipboardExpand all lines: versioned_docs/version-3.0.0/keploy-explained/docs-dev-guide.md
+17-11Lines changed: 17 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,35 +1,41 @@
1
1
---
2
2
id: docs-dev-guide
3
-
title: docs-dev-guide
3
+
title: Keploy Docs Contribution Guide
4
4
sidebar_label: Docs Dev Guide
5
5
tags:
6
6
- dev guide
7
7
- explanation
8
8
- contributing
9
9
---
10
10
11
-
# How to contribute
11
+
We welcome and appreciate contributions from the community. There are several ways you can help improve the documentation:
12
12
13
-
We encourage contributions from the community.
13
+
### Ways to Contribute:
14
14
15
-
**Create a [GitHub issue](https://github.com/keploy/docs/issues) for any changes beyond typos and small fixes.**
15
+
**1. Code Contribution**.
16
16
17
-
If you do create a pull request (PR), please follow our style guidance.
17
+
**2. Report bugs or suggest improvements**.
18
18
19
-
We review GitHub issues and PRs on a regular schedule.
19
+
**3. Suggest UI/UX enhancements**.
20
+
21
+
**4. Contribute to translations**.
22
+
23
+
Your contributions help strengthen the documentation and support the Keploy community
24
+
25
+
**Note: Create a [GitHub issue](https://github.com/keploy/keploy/issues/new/choose) for any changes beyond typos and small fixes.**
26
+
27
+
If you do create a pull request (PR) or Github issues, please follow our style guidance.
20
28
21
-
To ensure that each change is relevant and properly peer reviewed, please adhere to best practices for open-source contributions.
22
-
This means that if you are outside the Keploy organization, you must fork the repository and create PRs from branches on your own fork.
23
29
The README in GitHub's [first-contributions repo](https://github.com/firstcontributions/first-contributions) provides an example.
24
30
25
31
## How to set up the docs website locally?
26
32
27
-
The Keploy documentation site uses Docusaurus 2 which is a static website generator.
33
+
The Keploy documentation site uses Docusaurus which is a static website generator.
28
34
29
35
You can make changes locally without previewing them in the browser.
30
-
However, if you want to build the site and preview changes in the browser, you need to have Docusaurus 2 dependencies installed.
36
+
However, if you want to build the site and preview changes in the browser, you need to have Docusaurus dependencies installed.
31
37
32
-
Initialize Docusaurus 2 in the repo by running [`yarn`](https://classic.yarnpkg.com/en/docs/cli/) or [`npm`](https://docs.npmjs.com/cli/v10) once in the root directory of the repo.
38
+
Initialize Docusaurus in the repo by running [`yarn`](https://classic.yarnpkg.com/en/docs/cli/) or [`npm`](https://docs.npmjs.com/cli/v10) once in the root directory of the repo.
0 commit comments