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
> **Note: if you are using `arm_64` as runner use below to download keploy binary**
45
45
46
46
`curl --silent --location "https://github.com/keploy/keploy/releases/latest/download/keploy_linux_arm64.tar.gz" | tar xz --overwrite -C /tmp`
47
47
48
-
Now that we have Keploy installed, and all ready, we need switch to path where `keploy` folder is present in our application and install all the application related dependencies. Since we are using [express-mongoose](https://github.com/keploy/samples-typescript/tree/main/express-mongoose) sample-application, steps in our `script:` would look like below:-
48
+
Now that we have Keploy installed, and all ready, we need switch to path where `keploy` folder is present in our application and install all the application related dependencies. Since we are using [flask-mongo](https://github.com/keploy/samples-python) sample-application, steps in our `script:` would look like below:-
- mount -t debugfs nodev /sys/kernel/debug || true
58
+
- mount -t tracefs nodev /sys/kernel/tracing || true
59
+
60
+
# Run Keploy tests
61
+
- pip3 install -r requirements.txt
62
+
- keploy test -c "python3 app.py" --delay 50
57
63
```
58
64
59
65
In your `.gitlab-ci.yml file`, in last step we have `keploy test` command to run your keploy generated test suite, this sets up Keploy to replay the interactions it has generated and perform CI Testing.
60
66
67
+
### 📝 Note
68
+
69
+
Did you notice some weird stuff in the pipeline? Like `kmod`, `linux-headers`, `/sys/kernel/debug`...and thought, _"Wait, am I hacking the kernel or something?"_ 😅
70
+
71
+
Don’t worry — these are just there because **Keploy uses eBPF** (a cool Linux feature) to trace your app’s behavior.
72
+
73
+
So we install `kmod`, `linux-headers-generic`, and `bpfcc-tools` to make that tracing possible.
74
+
75
+
Some CI systems don’t have `/sys/kernel/debug` and `/sys/kernel/tracing` by default, so we create them and mount `debugfs` and `tracefs` — it’s like giving Keploy the **backstage pass** it needs to watch your app in action.
76
+
77
+
No black magic. Just some low-level Linux stuff helping your tests run like magic! 🪄✨
78
+
61
79
We will get to see output : -
62
80
63
81
```sh
64
-
$ keploy test -c "npm start"
82
+
$ keploy test -c "python3 app.py" --delay 50
65
83
▓██▓▄
66
84
▓▓▓▓██▓█▓▄
67
85
████████▓▒
@@ -71,46 +89,64 @@ $ keploy test -c "npm start"
71
89
▓▓▓▓▀▀▀▀▓▓▓▓▓▓▌ ██ █▓ ▓▌▄▄ ▐█▓▄▓█▀ █▓█ ▀█▄▄█▀ █▓█
72
90
▓▌ ▐█▌ █▌
73
91
▓
92
+
version: 2.5.1
93
+
🐰 Keploy: 2025-04-14T16:22:12Z WARN python language detected. please use --language to manually set the language if needed
94
+
🐰 Keploy: 2025-04-14T16:22:13Z INFO keploy initialized and probes added to the kernel.
95
+
🐰 Keploy: 2025-04-14T16:22:14Z INFO starting UDP DNS server at addr :26789
96
+
🐰 Keploy: 2025-04-14T16:22:14Z INFO Keploy has taken control of the DNS resolution mechanism, your application may misbehave if you have provided wrong domain name in your application code.
97
+
🐰 Keploy: 2025-04-14T16:22:14Z INFO Proxy started at port:16789
98
+
🐰 Keploy: 2025-04-14T16:22:14Z INFO running {"test-set": "[test-set-0]"}
99
+
🐰 Keploy: 2025-04-14T16:22:14Z INFO starting TCP DNS server at addr :26789
100
+
* Serving Flask app 'app'
101
+
* Debug mode: on
102
+
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
103
+
* Running on all addresses (0.0.0.0)
104
+
* Running on http://127.0.0.1:6000
105
+
* Running on http://127.0.0.1:6000
106
+
Press CTRL+C to quit
107
+
* Restarting with stat
108
+
* Debugger is active!
109
+
* Debugger PIN: 100-754-563
110
+
🐰 Keploy: 2025-04-14T16:23:04Z INFO starting test for of {"test case": "[test-1]", "test set": "[test-set-0]"}
🐰 Keploy: 2024-06-05T06:32:53Z INFO keploy initialized and probes added to the kernel.
82
-
🐰 Keploy: 2024-06-05T06:32:54Z INFO Keploy has taken control of the DNS resolution mechanism, your application may misbehave if you have provided wrong domain name in your application code.
83
-
🐰 Keploy: 2024-06-05T06:32:54Z INFO starting TCP DNS server at addr :26789
84
-
🐰 Keploy: 2024-06-05T06:32:54Z INFO Proxy started at port:16789
85
-
🐰 Keploy: 2024-06-05T06:32:54Z INFO running {"test-set": "test-set-0"}
86
-
🐰 Keploy: 2024-06-05T06:32:54Z INFO starting UDP DNS server at addr :26789
🐰 Keploy: 2024-06-05T06:32:54Z INFO result {"testcase id": "test-1", "testset id": "test-set-0", "passed": "true"}
99
-
100
-
<=========================================>
101
-
TESTRUN SUMMARY. For test-set: "test-set-0"
102
-
Total tests: 1
103
-
Total test passed: 1
104
-
Total test failed: 0
105
-
<=========================================>
106
-
...
107
-
🐰 Keploy: 2024-06-05T06:32:54Z INFO test run completed {"passed overall": true}
108
140
```
109
141
110
142
_And... voila! You have successfully integrated keploy in GitLab CI/CD pipeline 🌟_
111
143
112
144
Integrating Keploy with GitLab CI automates the testing process, ensuring that tests are run with every commit and merge request. And by running tests automatically in CI pipeline, you can catch issues early and ensure that your application remains stable and reliable.
113
145
146
+
### 📦 Need the Full Pipeline?
147
+
148
+
If you’re thinking, “This pipeline looks cool, but I need the _whole thing_ to integrate with your application!” — well, you're in luck! Check it out [here](https://github.com/keploy/samples-python) and get ready to copy-paste your way to success! ✨🚀
149
+
114
150
Hope this helps you out, if you still have any questions, reach out to us .
0 commit comments