Skip to content

Commit 63280ad

Browse files
committed
Fix evals repo path
1 parent afc1278 commit 63280ad

File tree

6 files changed

+68
-52
lines changed

6 files changed

+68
-52
lines changed

benchmark/README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,4 @@ cd benchmark
1212
./scripts/setup.sh
1313
```
1414

15-
[Install](https://docs.docker.com/desktop/) and run Docker Desktop.
16-
17-
Build a container to run the Roo Code evals:
18-
19-
```sh
20-
cd benchmark
21-
pnpm install
22-
cp .env.sample .env
23-
# Update OPENROUTER_API_KEY=... with your actual API key.
24-
pnpm docker:start
25-
```
26-
2715
Navigate to [localhost:3000](http://localhost:3000/) in your browser.

benchmark/apps/cli/src/index.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,7 @@ const runExercise = async ({ run, task, server }: { run: Run; task: Task; server
171171

172172
// If debugging:
173173
// Use --wait --log trace or --verbose.
174-
let codeCommand = `code --disable-workspace-trust`
175-
const isDocker = fs.existsSync("/.dockerenv")
176-
177-
if (isDocker) {
178-
codeCommand = `xvfb-run --auto-servernum --server-num=1 ${codeCommand} --wait --log trace --disable-gpu --password-store="basic"`
179-
}
174+
const codeCommand = `code --disable-workspace-trust`
180175

181176
const subprocess = execa({
182177
env: {
@@ -190,7 +185,7 @@ const runExercise = async ({ run, task, server }: { run: Run; task: Task; server
190185
// subprocess.stdout.pipe(process.stdout)
191186

192187
// Give VSCode some time to spawn before connectint to its unix socket.
193-
await new Promise((resolve) => setTimeout(resolve, isDocker ? 5_000 : 1_000))
188+
await new Promise((resolve) => setTimeout(resolve, 1_000))
194189
console.log(`Connecting to ${taskSocketPath} (pid: ${subprocess.pid})`)
195190

196191
const createClient = (taskSocketPath: string) => {

benchmark/apps/cli/src/paths.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import { fileURLToPath } from "url"
44
export const __dirname = path.dirname(fileURLToPath(import.meta.url))
55

66
export const extensionDevelopmentPath = path.resolve(__dirname, "..", "..", "..", "..")
7-
export const exercisesPath = path.resolve(extensionDevelopmentPath, "..", "exercises")
7+
export const exercisesPath = path.resolve(extensionDevelopmentPath, "..", "evals")

benchmark/apps/web/src/lib/server/exercises.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const listDirectories = async (relativePath: string) => {
2020
}
2121

2222
// __dirname = <repo>/benchmark/apps/web/src/lib/server
23-
const EXERCISES_BASE_PATH = path.resolve(__dirname, "../../../../../../../exercises")
23+
const EXERCISES_BASE_PATH = path.resolve(__dirname, "../../../../../../../evals")
2424

2525
export const getExercises = async () => {
2626
const result = await Promise.all(

benchmark/packages/types/src/exercises.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* ExerciseLanguage
33
*/
44

5-
export const exerciseLanguages = ["cpp", "go", "java", "javascript", "python", "rust"] as const
5+
export const exerciseLanguages = ["go", "java", "javascript", "python", "rust"] as const
66

77
export type ExerciseLanguage = (typeof exerciseLanguages)[number]
88

benchmark/scripts/setup.sh

Lines changed: 63 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
11
#!/usr/bin/env bash
22

3-
if [[ "$(uname -s)" != "Darwin" ]]; then
4-
echo "Only macOS is currently supported."
5-
exit 1
6-
fi
7-
8-
options=("nodejs" "python" "golang" "rust" "java")
9-
binaries=("node" "python" "go" "rustc" "javac")
10-
11-
declare -A has_asdf_plugin
12-
has_asdf_plugin=([nodejs]=true [python]=true [golang]=true [rust]=true [java]=false)
13-
14-
for i in "${!options[@]}"; do
15-
choices[i]="*"
16-
done
17-
183
menu() {
194
echo -e "\nWhich eval types would you like to support?\n"
205

@@ -31,6 +16,33 @@ menu() {
3116
echo
3217
}
3318

19+
build_extension() {
20+
echo "Building the Roo Code extension..."
21+
cd ..
22+
mkdir -p bin
23+
npm run install-extension -- --silent --no-audit || exit 1
24+
npm run install-webview -- --silent --no-audit || exit 1
25+
npm run install-e2e -- --silent --no-audit || exit 1
26+
npx vsce package --out bin/roo-code-latest.vsix || exit 1
27+
code --install-extension bin/roo-code-latest.vsix || exit 1
28+
cd benchmark
29+
}
30+
31+
if [[ "$(uname -s)" != "Darwin" ]]; then
32+
echo "Only macOS is currently supported."
33+
exit 1
34+
fi
35+
36+
options=("nodejs" "python" "golang" "rust" "java")
37+
binaries=("node" "python" "go" "rustc" "javac")
38+
39+
declare -A has_asdf_plugin
40+
has_asdf_plugin=([nodejs]=true [python]=true [golang]=true [rust]=true [java]=false)
41+
42+
for i in "${!options[@]}"; do
43+
choices[i]="*"
44+
done
45+
3446
prompt="Type 🔢 to select, 'a' for all, 'q' to quit, ⏎ to continue: "
3547

3648
while menu && read -rp "$prompt" num && [[ "$num" ]]; do
@@ -136,6 +148,7 @@ if ! command -v asdf &>/dev/null; then
136148
else
137149
ASDF_VERSION=$(asdf --version)
138150
echo "✅ asdf is installed ($ASDF_VERSION)"
151+
. "$ASDF_PATH"
139152
fi
140153

141154
if ! command -v gh &>/dev/null; then
@@ -159,9 +172,7 @@ for i in "${!options[@]}"; do
159172
binary="${binaries[$i]}"
160173

161174
if [[ "${has_asdf_plugin[$plugin]}" == "true" ]]; then
162-
missing_plugin=$(! asdf plugin list | grep -q "^${plugin}$")
163-
164-
if [[ "$missing_plugin" == true ]] && ! command -v "${binary}" &>/dev/null; then
175+
if ! asdf plugin list | grep -q "^${plugin}$" && ! command -v "${binary}" &>/dev/null; then
165176
echo "Installing ${plugin} asdf plugin..."
166177
asdf plugin add "${plugin}" || exit 1
167178
echo "✅ asdf ${plugin} plugin installed"
@@ -234,12 +245,22 @@ for i in "${!options[@]}"; do
234245
;;
235246

236247
"java")
237-
if ! command -v javac &>/dev/null; then
248+
if ! command -v javac &>/dev/null || ! javac --version &>/dev/null; then
249+
echo "Installing Java..."
238250
brew install openjdk@17 || exit 1
239-
JAVA_VERSION=$(java --version | head -n 1)
251+
252+
export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
253+
254+
if [[ "$SHELL" == "/bin/zsh" ]] && ! grep -q 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' ~/.zprofile; then
255+
echo 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' >> ~/.zprofile
256+
elif [[ "$SHELL" == "/bin/bash" ]] && ! grep -q 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' ~/.bash_profile; then
257+
echo 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' >> ~/.bash_profile
258+
fi
259+
260+
JAVA_VERSION=$(javac --version | head -n 1)
240261
echo "✅ Java is installed ($JAVA_VERSION)"
241262
else
242-
JAVA_VERSION=$(java --version | head -n 1)
263+
JAVA_VERSION=$(javac --version | head -n 1)
243264
echo "✅ Java is installed ($JAVA_VERSION)"
244265
fi
245266
;;
@@ -257,17 +278,17 @@ fi
257278

258279
pnpm install --silent || exit 1
259280

260-
if [[ ! -d "evals" ]]; then
281+
if [[ ! -d "../../evals" ]]; then
261282
if gh auth status &>/dev/null; then
262283
read -p "Would you like to be able to share eval results? (Y/n): " fork_evals
263284

264285
if [[ "$fork_evals" =~ ^[Yy]|^$ ]]; then
265-
gh repo fork cte/evals || exit 1
286+
gh repo fork cte/evals ../../evals || exit 1
266287
else
267-
gh repo clone cte/evals || exit 1
288+
gh repo clone cte/evals ../../evals || exit 1
268289
fi
269290
else
270-
git clone https://github.com/cte/evals.git || exit 1
291+
git clone https://github.com/cte/evals.git ../../evals || exit 1
271292
fi
272293
fi
273294

@@ -282,12 +303,24 @@ if ! grep -q "OPENROUTER_API_KEY" .env; then
282303
echo "OPENROUTER_API_KEY=$openrouter_api_key" >>.env
283304
fi
284305

306+
if ! command -v code &>/dev/null; then
307+
echo "Visual Studio Code cli is not installed"
308+
exit 1
309+
else
310+
VSCODE_VERSION=$(code --version | head -n 1)
311+
echo "✅ Visual Studio Code is installed ($VSCODE_VERSION)"
312+
fi
313+
285314
if [[ ! -s "../bin/roo-code-latest.vsix" ]]; then
286-
echo "Building the Roo Code extension..."
287-
cd .. &&
288-
npm run install-extension -- --silent --no-audit &&
289-
npm run install-webview -- --silent --no-audit &&
290-
npx vsce package --out bin/roo-code-latest.vsix || exit 1
315+
build_extension
316+
else
317+
read -p "Do you want to build a new version of the Roo Code extension? (y/N): " build_extension
318+
319+
if [[ "$build_extension" =~ ^[Yy]$ ]]; then
320+
build_extension
321+
code --install-extension bin/roo-code-latest.vsix || exit 1
322+
cd benchmark
323+
fi
291324
fi
292325

293326
echo -e "\n🤘 You're ready to rock and roll!\n"

0 commit comments

Comments
 (0)