Skip to content

Commit 616d564

Browse files
authored
chore: Allow CI testing locally (RooCodeInc#1708)
* doc: Adding install for WebIDE Settings * adding * test:dev * Revert "test:dev" This reverts commit 91eb6a6510b23b7948d5a7be5d17e8420000c4fc. * update * updated * changeset * update ci script * update
1 parent efd28b3 commit 616d564

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed

.changeset/metal-cheetahs-care.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": patch
3+
---
4+
5+
Can test on WebIDE

CONTRIBUTING.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,36 @@ If you're planning to work on a bigger feature, please create a [feature request
3131
- Run `npm run test` to run tests locally
3232
- Before submitting PR, run `npm run format:fix` to format your code
3333

34+
3. **Linux-specific Setup**
35+
VS Code extension tests on Linux require the following system libraries:
36+
37+
- `libatk1.0-0`
38+
- `libatk-bridge2.0-0`
39+
- `libxkbfile1`
40+
- `libx11-xcb1`
41+
- `libxcomposite1`
42+
- `libxdamage1`
43+
- `libxfixes3`
44+
- `libxrandr2`
45+
- `libgbm1`
46+
- `libdrm2`
47+
- `libgtk-3-0`
48+
- `dbus`
49+
- `xvfb`
50+
51+
These libraries provide necessary GUI components and system services for the test environment.
52+
53+
For example, on Debian-based distributions (e.g., Ubuntu), you can install these libraries using apt:
54+
```bash
55+
sudo apt update
56+
sudo apt install -y \
57+
libatk1.0-0 libatk-bridge2.0-0 libxkbfile1 libx11-xcb1 \
58+
libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 \
59+
libdrm2 libgtk-3-0 dbus xvfb
60+
```
61+
62+
- Run `npm run test:ci` to run tests locally
63+
3464
## Writing and Submitting Code
3565

3666
Anyone can contribute code to Cline, but we ask that you follow these guidelines to ensure your contributions can be smoothly integrated:

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@
280280
"format": "prettier . --check",
281281
"format:fix": "prettier . --write",
282282
"test": "vscode-test",
283+
"test:ci": "node scripts/test-ci.js",
283284
"install:all": "npm install && cd webview-ui && npm install",
284285
"dev:webview": "cd webview-ui && npm run dev",
285286
"build:webview": "cd webview-ui && npm run build",

scripts/test-ci.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env node
2+
const { execSync } = require("child_process")
3+
const process = require("process")
4+
5+
try {
6+
if (process.platform === "linux") {
7+
console.log("Detected Linux environment.")
8+
9+
execSync("which xvfb-run", { stdio: "ignore" })
10+
11+
console.log("xvfb-run is installed. Running tests with xvfb-run...")
12+
execSync("xvfb-run -a npm run test", { stdio: "inherit" })
13+
} else {
14+
console.log("Non-Linux environment detected. Running tests normally.")
15+
execSync("npm run test", { stdio: "inherit" })
16+
}
17+
} catch (error) {
18+
if (process.platform === "linux") {
19+
console.error(
20+
`Error: xvfb-run is not installed.\n` +
21+
`Please install it using the following command:\n` +
22+
` Debian/Ubuntu: sudo apt install xvfb\n` +
23+
` RHEL/CentOS: sudo yum install xvfb\n` +
24+
` Arch Linux: sudo pacman -S xvfb`,
25+
)
26+
} else {
27+
console.error("Error running tests:", error.message)
28+
}
29+
process.exit(1)
30+
}

0 commit comments

Comments
 (0)