Skip to content

Commit d30853c

Browse files
Merge branch 'main' into 404-redir
2 parents b3cf907 + 7d4787c commit d30853c

File tree

14 files changed

+2334
-57
lines changed

14 files changed

+2334
-57
lines changed

src/components/CollapsibleCode.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import React, {useState} from "react";
2+
import CodeBlock from "@theme/CodeBlock";
3+
4+
export default function CollapsibleCode({
5+
code,
6+
language = "json",
7+
previewLines = 10,
8+
}) {
9+
const [expanded, setExpanded] = useState(false);
10+
const codeLines = code.trim().split("\n");
11+
const visibleCode = expanded
12+
? code.trim()
13+
: codeLines.slice(0, previewLines).join("\n") + "\n# ...";
14+
15+
const handleCopy = () => {
16+
try {
17+
navigator.clipboard.writeText(code.trim());
18+
const btn = document.getElementById("copy-full-code");
19+
if (btn) {
20+
const originalText = btn.innerText;
21+
btn.innerText = "Copied!";
22+
setTimeout(() => (btn.innerText = originalText), 2000);
23+
}
24+
} catch (err) {
25+
console.error("Failed to copy code:", err);
26+
}
27+
};
28+
29+
return (
30+
<div className="margin-vert--md">
31+
{/* Pass the full code to CodeBlock so default copy button works */}
32+
<CodeBlock language={language}>{visibleCode}</CodeBlock>
33+
34+
<div
35+
style={{
36+
display: "flex",
37+
gap: "10px",
38+
justifyContent: "flex-end",
39+
marginTop: "-8px", // Pulls buttons closer to code block
40+
}}
41+
>
42+
{codeLines.length > previewLines && (
43+
<button
44+
onClick={() => setExpanded(!expanded)}
45+
className="button button--sm button--secondary"
46+
>
47+
{expanded ? "Show Less" : "Show More"}
48+
</button>
49+
)}
50+
<button
51+
id="copy-full-code"
52+
onClick={handleCopy}
53+
className="button button--sm button--primary"
54+
>
55+
Copy
56+
</button>
57+
</div>
58+
</div>
59+
);
60+
}

versioned_docs/version-3.0.0/ci-cd/github.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ GitHub scripts are the easiest way to integrate Keploy with GitHub. We will be u
3434
...
3535
```
3636

37-
> **Note: if you are using `arm_64` as runner use below to download keploy binary**
38-
39-
`curl --silent --location "https://github.com/keploy/keploy/releases/latest/download/keploy_linux_arm64.tar.gz" | tar xz --overwrite -C /tmp`
40-
4137
### Example with Scripts
4238

4339
While using [express-mongoose](https://github.com/keploy/samples-typescript/tree/main/express-mongoose) sample-application with keploy test in GitHub CI, the workflow would like:-

versioned_docs/version-3.0.0/ci-cd/gitlab.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ keploy-test-job: # This job runs in the test stage.
4141
...
4242
```
4343

44-
> **Note: if you are using `arm_64` as runner use below to download keploy binary**
45-
46-
`curl --silent --location "https://github.com/keploy/keploy/releases/latest/download/keploy_linux_arm64.tar.gz" | tar xz --overwrite -C /tmp`
47-
4844
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:-
4945

5046
```yaml
@@ -66,17 +62,15 @@ In your `.gitlab-ci.yml file`, in last step we have `keploy test` command to run
6662

6763
### 📝 Note
6864

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?"_ 😅
65+
Did you notice some weird stuff in the pipeline? Like `kmod`, `linux-headers`, `/sys/kernel/debug`
7066

7167
Don’t worry — these are just there because **Keploy uses eBPF** (a cool Linux feature) to trace your app’s behavior.
7268

7369
So we install `kmod`, `linux-headers-generic`, and `bpfcc-tools` to make that tracing possible.
7470

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! 🪄✨
71+
Some CI systems don’t have `/sys/kernel/debug` and `/sys/kernel/tracing` by default, so we create them and mount `debugfs` and `tracefs`
7872

79-
We will get to see output : -
73+
We would output something like below:-
8074

8175
```sh
8276
$ keploy test -c "python3 app.py" --delay 50

versioned_docs/version-3.0.0/ci-cd/jenkins.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ pipeline {
4747

4848
```
4949

50-
> **Note: if you are using `arm_64` as runner use below to download keploy binary**
51-
52-
`curl --silent --location "https://github.com/keploy/keploy/releases/latest/download/keploy_linux_arm64.tar.gz" | tar xz --overwrite -C /tmp`
53-
5450
### Example
5551

5652
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 [gin-mongo](https://github.com/keploy/samples-go/tree/main/gin-mongo) sample-application, steps in our `script` would look like below:-
@@ -106,15 +102,13 @@ pipeline {
106102

107103
### 📝 Note
108104

109-
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?"_ 😅
105+
Did you notice some weird stuff in the pipeline? Like `kmod`, `linux-headers`, `/sys/kernel/debug`
110106

111107
Don’t worry — these are just there because **Keploy uses eBPF** (a cool Linux feature) to trace your app’s behavior.
112108

113109
So we install `kmod`, `linux-headers-generic`, and `bpfcc-tools` to make that tracing possible.
114110

115-
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.
116-
117-
No black magic. Just some low-level Linux stuff helping your tests run like magic! 🪄✨
111+
Some CI systems don’t have `/sys/kernel/debug` and `/sys/kernel/tracing` by default, so we create them and mount `debugfs` and `tracefs`
118112

119113
We would output something like below:-
120114

versioned_docs/version-3.0.0/keploy-cloud/deduplication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: deduplication
3-
title: Remove Duplicates Tests 🧹
4-
sidebar_label: Remove Duplicate Tests 🧹
3+
title: Remove Duplicates Tests
4+
sidebar_label: Remove Duplicate Tests
55
tags:
66
- explanation
77
- feature guide

versioned_docs/version-3.0.0/keploy-cloud/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: cloud-installation
33
title: Keploy Cloud Installation
4-
sidebar_label: Installation 🛠️
4+
sidebar_label: Installation
55
tags:
66
- explanation
77
- feature guide

versioned_docs/version-3.0.0/keploy-cloud/keploy-console.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: keploy-console
3-
title: Keploy Console 📘
4-
sidebar_label: Keploy Console 🛠️
3+
title: Keploy Console
4+
sidebar_label: Keploy Console
55
tags:
66
- explanation
77
- feature guide

versioned_docs/version-3.0.0/keploy-cloud/mock-registry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: mock-registry
33
title: Mock Registry
4-
sidebar_label: Mock Registry 📦
4+
sidebar_label: Mock Registry
55
tags:
66
- explanation
77
- feature guide

versioned_docs/version-3.0.0/keploy-cloud/new-application.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: application-settings
33
title: Keploy Cloud Application Settings Guide
44
description: Learn how to configure application settings in Keploy Cloud. Manage environments, toggle features, and optimize your testing setup with this step-by-step guide.
55

6-
sidebar_label: Add Application 📝
6+
sidebar_label: Add Application
77
tags:
88
- explanation
99
- feature guide

versioned_docs/version-3.0.0/keploy-cloud/testgeneration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: auto-test-generation
3-
title: Auto Test Generation 🚀
4-
sidebar_label: Test Generation 🚀
3+
title: Auto Test Generation
4+
sidebar_label: Test Generation
55
tags:
66
- Auto Test Generation
77
- OpenAPI

0 commit comments

Comments
 (0)