Skip to content

Commit af2b69b

Browse files
authored
fix: Update CLI Commands in Python, Go, and Next.js (#700)
Signed-off-by: Achanandhi-M <[email protected]>
1 parent 4452de8 commit af2b69b

File tree

7 files changed

+9
-23
lines changed

7 files changed

+9
-23
lines changed

src/components/QuickStartList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ const quickstarts = [
299299
},
300300

301301
{
302-
title: "NextJS + SQL",
302+
title: "NextJS + Postgres",
303303
language: "JS/TS",
304304
server: "Local",
305305
description:

versioned_docs/version-2.0.0/quickstart/nextjs-postgres.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: samples-nextjs
33
title: NextJs Sample Application
4-
sidebar_label: NextJS + SQL
4+
sidebar_label: NextJS + PostgreSQL
55
description: The following sample app to test Keploy integration capabilities using NextJS,Drizzle and Postgres.
66
tags:
77
- NextJs

versioned_docs/version-3.0.0/quickstart/go-fasthttp-postgres.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,6 @@ keploy record -c "./app"
234234
Keep an eye out for the `-c` flag! It's the command charm to run the app. Whether you're using `go run main.go` or the binary path like `./app`, it's your call.
235235
If you're seeing logs that resemble the ones below, you're on the right track:
236236

237-
![Testcase](/img/fasthttp-postgress-test.png)
238-
239237
Alright! With the app alive and kicking, let's weave some test cases. Making some API calls! Postman, Hoppscotch,
240238

241239
or even the classic curl - take your pick!

versioned_docs/version-3.0.0/quickstart/nextjs-postgres.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: samples-nextjs
33
title: NextJs Sample Application
4-
sidebar_label: NextJS + SQL
4+
sidebar_label: NextJS + PostgreSQL
55
description: The following sample app to test Keploy integration capabilities using NextJS,Drizzle and Postgres.
66
tags:
77
- NextJs

versioned_docs/version-3.0.0/quickstart/python-fastapi-twilio.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ docker build -t fastapi-twilio:1.0 .
5959
Capture the test-cases-
6060

6161
```shell
62-
keploy record -c "docker run -p 8000:8000 --name fastapi-twilio fastapi-twilio:1.0"
62+
keploy record -c "docker run -p 8000:8000 --name fastapi-twilio --network keploy-network fastapi-twilio:1.0"
6363
```
6464

6565
🔥**Make some API calls**. Postman, Hoppscotch or even curl - take your pick!
@@ -222,7 +222,7 @@ Want to see if everything works as expected?
222222
Time to put things to the test 🧪
223223

224224
```shell
225-
keploy test -c "docker run -p 8000:8000 --name fastapi-twilio fastapi-twilio:1.0" --delay 10
225+
keploy test -c "docker run -p 8000:8000 --name fastapi-twilio --network keploy-network fastapi-twilio:1.0" --delay 10
226226
```
227227

228228
> The `--delay` flag? Oh, that's just giving your app a little breather (in seconds) before the test cases come knocking.

versioned_docs/version-3.0.0/quickstart/samples-echo.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,6 @@ Using the docker-compose file we will start our postgres instance:-
4646
docker compose up
4747
```
4848

49-
#### Creating Docker Volume
50-
51-
```bash
52-
docker volume create --driver local --opt type=debugfs --opt device=debugfs debugfs
53-
```
54-
5549
### Capture the Testcases
5650

5751
Now, we will create the binary of our application:-
@@ -159,12 +153,12 @@ Using the docker-compose file we will start our Postgres instance:-
159153
docker-compose up -d
160154
```
161155

162-
> **Since we are using docker to run the application, we need to update the `postgres` host on line 28 in `main.go`, update the host to `localhost`.**
156+
> **Since we are using docker to run the application, we need to update the `postgres` host on line 40 in `main.go`, update the host to `localhost`.**
163157
164158
Now, we will create the binary of our application:-
165159

166160
```go
167-
go build -cover
161+
go build echo-psql-url-shortener
168162
```
169163

170164
### Capture the Testcases
@@ -173,8 +167,6 @@ go build -cover
173167
sudo -E PATH=$PATH keploy record -c "./echo-psql-url-shortener"
174168
```
175169

176-
![Testcase](/img/echo-postgress-run-testcase.png?raw=true)
177-
178170
### Generate testcases
179171

180172
To genereate testcases we just need to make some API calls. You can use Postman, Hoppscotch, or simply curl
@@ -214,7 +206,7 @@ Now both these API calls were captured as a testcase and should be visible on th
214206
Now that we have our testcase captured, run the test file.
215207

216208
```shell
217-
sudo -E PATH=$PATH keploy record -c "./echo-psql-url-shortener" --delay 10
209+
sudo -E PATH=$PATH keploy test -c "./echo-psql-url-shortener"
218210
```
219211

220212
So no need to setup dependencies like mongoDB, web-go locally or write mocks for your testing.

versioned_docs/version-3.0.0/quickstart/samples-go-gin-mongo.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,7 @@ keploy record -c "go run main.go handler.go"
252252
Keep an eye out for the `-c `flag! It's the command charm to run the app. Whether you're using `go run main.go handler.go` or the binary path like `./test-app-url-shortener`, it's your call.
253253
If you're seeing logs that resemble the ones below, you're on the right track:
254254

255-
<img src="/docs/img/code-snippets/keploy-record-docker.png" alt="Keploy Record Test case" width="100%" />
256-
257-
Alright! With the app alive and kicking, let's weave some test cases. Making some API calls! Postman, Hoppscotch, or the classic curl - pick your wand.
255+
Alright! With the app alive and kicking, let's weave some test cases. Making some API calls! Postman, Hoppscotch, or the classic curl - pick your wand.
258256

259257
#### Generate shortened url
260258

@@ -386,8 +384,6 @@ keploy test -c "docker compose up" --container-name "ginMongoApp" --delay 10
386384
387385
Your results should be looking all _snazzy_, like this:
388386

389-
<img src="/docs/img/code-snippets/url-shortner-test-result.png" alt="Sample Keploy Test Result Gin MongoDB" width="100%" style={{ borderRadius: '5px' }}/>
390-
391387
Did you spot that, the ts (timestamp) is showing some differences? Yep, time has a way of doing that! 🕰️
392388

393389
Worry not, just add the ever-changing fields (like our **ts** here) to the **noise parameter** to **dodge those assertions**.

0 commit comments

Comments
 (0)