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
Let's use the [expresss-mongoose](https://github.com/keploy/samples-typescript/tree/main/express-mongoose) application to test dedup feature. In our `src/app.js` file we need to have imported and initialized `@keploy/sdk` package, so now let's run the de-duplication command to check : -
48
+
Update the go build command in Dockerfile to add new flags which is required for deduplication (this is not required for native)
keploy test -c "docker compose up" --containerName containerName --dedup
110
62
```
111
63
112
-
Voila! Keploy will now detect duplicate tests .
113
-
114
-
### For Python Applications
115
-
116
-
Deduplication works only on test mode there are no special instructions to record your tests.
117
-
118
-
**1. Pre-requsite**
119
-
120
-
Put the latest keploy-sdk in your file : -
64
+
For Native, run:
121
65
122
66
```bash
123
-
pip install keploy coverage requests fastapi
67
+
keploy test -c ./main --dedup
124
68
```
125
69
126
-
In your main app file add the following with along with the other imports. And add Keploy's middleware along with the other middlewares for your app based on your framework:
127
-
128
-
1. In FastAPI -
70
+
where `./main` is the binary produced by doing `go build -cover -covermode=atomic -coverpkg=./... -o ./main .`
'keploy.DjangoCoverageMiddleware', # Add keploy middleware here
161
-
],
162
-
163
-
# Other settings
164
-
```
165
-
166
-
**2. Run Deduplication**
167
-
168
-
Run keploy with test-sets in which you want to check for the duplicate testcases :
169
-
170
-
```sh
171
-
keploy dedup -c "<command to run your Python app>" --delay "<time required for your application to start>"
172
-
```
173
-
174
-
#### Example
175
-
176
-
Let's use the [flask-mongo](https://github.com/keploy/samples-python/tree/main/flask-mongo) application to test dedup feature. In our `app.py` file we need to have imported and initialized `keploy` package, since this is a flask application we can follow above flask approach. Once we have added package, let's run the de-duplication command to check : -
0 commit comments