Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 148087d

Browse files
PranshuSrivastavanehagup
andauthoredFeb 8, 2024
docs: updated documentation to segregate sections for docker and binary (keploy#66)
* docs: updated documentation to segregate sections for docker and binary Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com> * docs: change delay and buildDelay for fresh user Signed-off-by: Neha Gupta <gneha21@yahoo.in> --------- Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com> Signed-off-by: Neha Gupta <gneha21@yahoo.in> Co-authored-by: Neha Gupta <gneha21@yahoo.in>
1 parent d9ebe44 commit 148087d

File tree

1 file changed

+19
-25
lines changed

1 file changed

+19
-25
lines changed
 

‎spring-petclinic/README.md

+19-25
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@
33
This is a petclinic app where you can record testcases and mocks by interacting with the UI, and then test them using Keploy.
44
This project has two parts - the frontend and backend, since Keploy is a backend testing platform, we need to start the backend part of the project
55
using Keploy and run the frontend as it is.
6+
You can start the backend using Keploy in 2 ways:
7+
- Using Keploy's binary.
8+
- Using Keploy's docker image.
69

7-
Prerequisites:
10+
Prerequisites For Binary:
811
1. Node 20.11.0 LTS
9-
2. Docker Desktop 4.25.2 and above
12+
2. OpenJDK 17.0.9
1013
3. MVN version 3.6.3
1114

15+
Prerequisites For Docker:
16+
1. Docker Desktop 4.25.2 and above
17+
1218
## Setup the frontend
1319

1420
```
@@ -27,6 +33,8 @@ npm i
2733
npm run start
2834
```
2935

36+
# Instructions For Starting Using Binary
37+
3038
## Spin up the database
3139

3240
```
@@ -64,44 +72,30 @@ to
6472
spring.datasource.url=jdbc:postgresql://localhost:5432/petclinic
6573
```
6674

67-
## Run the backend with Keploy(binary)
75+
## Recording the testcases with Keploy
6876

6977
```
7078
keploy record -c "java -jar target/<name-of-your-jar>"
7179
```
80+
Now you can start interacting with the UI and Keploy will automatically create the testcases and mocks for it in a folder named 'keploy'.
7281

73-
Now when you interact with the UI, the tests should start getting created in a folder called 'keploy' in the directory where you started the backend. When you are done recording the testcases and mocks, you can run them using keploy.
74-
75-
## Starting the backend with Keploy(docker)
76-
Starting the backend with keploy requires just a small change in the script used to run Keploy. The command will look something like this:
77-
78-
### For docker on Mac
79-
80-
```
81-
alias keploy='sudo docker run --pull always --name keploy-v2 -e BINARY_TO_DOCKER=true -p 16789:16789 --privileged --pid=host -it -v " + os.Getenv("PWD") + ":/files -v /sys/fs/cgroup:/sys/fs/cgroup -v debugfs:/sys/kernel/debug:rw -v /sys/fs/bpf:/sys/fs/bpf -v /var/run/docker.sock:/var/run/docker.sock -v " + os.Getenv("HOME") + "/.keploy-config:/root/.keploy-config -v " + os.Getenv("HOME") + "/.keploy:/root/.keploy --rm ghcr.io/keploy/keploy'
82-
```
83-
84-
### For docker on Linux
85-
86-
```
87-
alias keploy='sudo docker run --pull always --name keploy-v2 -e BINARY_TO_DOCKER=true -p 16789:16789 --privileged --pid=host -it -v " + os.Getenv("PWD") + ":/files -v /sys/fs/cgroup:/sys/fs/cgroup -v /sys/kernel/debug:/sys/kernel/debug -v /sys/fs/bpf:/sys/fs/bpf -v /var/run/docker.sock:/var/run/docker.sock -v " + os.Getenv("HOME") + "/.keploy-config:/root/.keploy-config -v " + os.Getenv("HOME") + "/.keploy:/root/.keploy --rm ghcr.io/keploy/keploy'
88-
89-
```
82+
## Running the testcases using Keploy
9083

9184
```
92-
keploy record -c "docker compose up" --containerName javaApp --buildDelay 50s
85+
keploy test -c "java -jar target/<name-of-your-jar>" --delay 20
9386
```
9487

95-
## Running the testcases using Keploy(binary)
88+
# Instructions For Starting Using Docker
89+
Here we just need to change the command used to start the application and it should work correctly.
9690

9791
```
98-
keploy test -c "java -jar target/<name-of-your-jar>" --delay 10
92+
keploy record -c "docker compose up" --containerName javaApp --buildDelay 100s
9993
```
10094

101-
## Running the testcases using Keploy(docker)
95+
## Running the testcases using Keploy
10296

10397
```
104-
keploy test -c "docker compose up" --containerName javaApp --buildDelay 50s --delay 10
98+
keploy test -c "docker compose up" --containerName javaApp --buildDelay 50s --delay 20
10599
```
106100
Here `delay` is the time it takes for your application to get started, after which Keploy will start running the testcases. If your application takes longer than 10s to get started, you can change the `delay` accordingly.
107101
`buildDelay` is the time that it takes for the image to get built. This is useful when you are building the docker image from your docker compose file itself.

0 commit comments

Comments
 (0)
Please sign in to comment.