Skip to content

Commit a7febfc

Browse files
committed
docs(README): update README.md
Closes #14
1 parent 20efb1a commit a7febfc

1 file changed

Lines changed: 76 additions & 30 deletions

File tree

README.md

Lines changed: 76 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,88 @@ BalatroBench is a benchmark analysis tool and leaderboard for [BalatroLLM](https
2020

2121
### Requirements
2222

23-
- [uv](https://docs.astral.sh/uv/) - Python package manager
24-
- [npm](https://www.npmjs.com/) - Node.js package manager
23+
- [uv](https://docs.astral.sh/uv/) - Python package manager (installation steps below)
24+
- [Node.js](https://nodejs.org/) - JavaScript runtime (includes npm) required just for Playwright tests
2525

2626
### Installation
2727

28-
Install Python and npm dependencies:
28+
Follow these steps to set up BalatroBench:
2929

30-
```bash
31-
make install
32-
source .venv/bin/activate
33-
```
30+
1. **Install uv**
3431

35-
This runs `uv sync` for Python packages and `npm install` for Playwright tests.
32+
Install the [uv](https://docs.astral.sh/uv/) Python package manager:
3633

37-
For browser binaries (first time only):
34+
```bash
35+
# macOS/Linux
36+
curl -LsSf https://astral.sh/uv/install.sh | sh
3837

39-
```bash
40-
npx playwright install
41-
```
38+
# Windows
39+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
40+
```
41+
42+
See the [uv installation docs](https://docs.astral.sh/uv/getting-started/installation/) for more options.
43+
44+
2. **Clone the repository**
45+
46+
```bash
47+
git clone https://github.com/coder/balatrobench.git
48+
cd balatrobench
49+
```
50+
51+
3. **Configure environment variables**
52+
53+
Copy the example environment file and fill in your values:
54+
55+
```bash
56+
cp .envrc.example .envrc
57+
```
58+
59+
Edit `.envrc` and set the following variables (required for uploading benchmarks to CDN):
60+
61+
- `BUNNY_BASE_URL` - BunnyCDN base URL
62+
- `BUNNY_STORAGE_ZONE` - Storage zone name
63+
- `BUNNY_API_KEY` - API key for authentication
64+
65+
4. **Install dependencies**
66+
67+
```bash
68+
make install
69+
```
70+
71+
This runs `uv sync` for Python packages and `npm install` for Playwright tests.
72+
73+
5. **Activate the environment**
74+
75+
```bash
76+
source .envrc
77+
```
78+
79+
Alternatively, use [direnv](https://direnv.net/) to automatically load the environment:
80+
81+
```bash
82+
# Install direnv, then allow the directory
83+
direnv allow
84+
```
85+
86+
6. **Install browser binaries (first time only)**
87+
88+
```bash
89+
npx playwright install chromium
90+
```
4291

4392
### Generating Benchmarks
4493

4594
Generate benchmark data from BalatroLLM runs:
4695

4796
```bash
48-
# Default: reads from ../balatrollm/runs/v1.0.0, writes to site/benchmarks
49-
uv run balatrobench
97+
# Analyze runs from a specific directory
98+
balatrobench --input-dir /path/to/runs/v1.0.0
5099
51-
# Custom paths
52-
uv run balatrobench --input-dir /path/to/runs/v1.0.0 --output-dir /path/to/output
100+
# Custom output directory
101+
balatrobench --input-dir /path/to/runs/v1.0.0 --output-dir /path/to/output
53102
54103
# Enable WebP conversion for screenshots
55-
uv run balatrobench --webp
104+
balatrobench --input-dir /path/to/runs/v1.0.0 --webp
56105
```
57106

58107
### Starting the Website
@@ -65,28 +114,25 @@ make serve
65114

66115
This will start a local server at [http://localhost:8000](http://localhost:8000) and automatically open it in your browser.
67116

68-
To use local benchmark data, set `environment: 'development'` in `site/config.js`.
117+
The environment is automatically detected (localhost = development, otherwise = production).
118+
To override, use the query parameter: `?env=development` or `?env=production`.
69119

70120
### Running Tests
71121

72-
End-to-end tests use Playwright:
122+
End-to-end tests use Playwright and `balatrobench` tests:
73123

74124
```bash
75-
# Run tests headless (default)
76-
npm test
77-
78-
# Run tests with interactive UI
79-
npm run test:ui
125+
make test
126+
```
80127

81-
# Run tests with browser visible
82-
npm run test:headed
128+
> [!NOTE]
129+
> Although `playwright.config.js` includes webServer configuration, the server may not auto-start reliably. If tests fail to connect, manually start the server first:
83130

84-
# Run tests in debug mode
85-
npm run test:debug
131+
```bash
132+
make serve # In a separate terminal
133+
make test # Run tests
86134
```
87135

88-
The test server is automatically started by Playwright (see `playwright.config.js`).
89-
90136
## 🚀 Related Projects
91137

92138
- [**BalatroBot**](https://github.com/coder/balatrobot): API for developing Balatro bots

0 commit comments

Comments
 (0)