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
# Run specific test file - stops after first failure
28
-
pytest -x tests/test_api_functions.py
31
+
pytest -x tests/lua/test_api_functions.py
29
32
30
33
# Run tests with verbose output - stops after first failure
31
34
pytest -vx
@@ -35,42 +38,45 @@ pytest -vx
35
38
36
39
1.**Always start Balatro first**:
37
40
38
-
```bash
39
-
# Check if game is running
40
-
ps aux | grep -E "(Balatro\.app|balatro\.sh)"| grep -v grep
41
+
```bash
42
+
# Check if game is running
43
+
ps aux | grep -E "(Balatro\.app|balatro\.sh)"| grep -v grep
41
44
42
-
# Start if not running
43
-
./balatro.sh > balatro.log 2>&1& sleep 10 &&echo'Balatro started and ready'
44
-
```
45
+
# Start if not running
46
+
./balatro.sh > balatro.log 2>&1& sleep 10 &&echo'Balatro started and ready'
47
+
```
45
48
46
49
2.**Monitor game startup**:
47
50
48
-
```bash
49
-
# Check logs for successful mod loading
50
-
tail -n 100 balatro.log
51
+
```bash
52
+
# Check logs for successful mod loading
53
+
tail -n 100 balatro.log
51
54
52
-
# Look for these success indicators:
53
-
# - "BalatrobotAPI initialized"
54
-
# - "BalatroBot loaded - version X.X.X"
55
-
# - "TCP socket created on port 12346"
56
-
```
55
+
# Look for these success indicators:
56
+
# - "BalatrobotAPI initialized"
57
+
# - "BalatroBot loaded - version X.X.X"
58
+
# - "TCP socket created on port 12346"
59
+
```
57
60
58
61
3.**Common startup issues and fixes**:
59
-
-**Game crashes on mod load**: Review full log for Lua stack traces
60
-
-**Steam connection warnings**: Can be ignored - game works without Steam in development
61
-
-**JSON metadata errors**: Normal for development files (.vscode, .luarc.json) - can be ignored
62
+
63
+
-**Game crashes on mod load**: Review full log for Lua stack traces
64
+
-**Steam connection warnings**: Can be ignored - game works without Steam in development
65
+
-**JSON metadata errors**: Normal for development files (.vscode, .luarc.json) - can be ignored
62
66
63
67
4.**Test execution**:
64
-
-**Test suite**: 55 tests covering API functions and TCP communication
65
-
-**Execution time**: ~160 seconds (includes game state transitions)
66
-
-**Coverage**: API function calls, socket communication, error handling, edge cases
68
+
69
+
-**Test suite**: 102 tests covering API functions and TCP communication
70
+
-**Execution time**: ~210 seconds (includes game state transitions)
71
+
-**Coverage**: API function calls, socket communication, error handling, edge cases
67
72
68
73
5.**Troubleshooting test failures**:
69
-
-**Connection timeouts**: Ensure TCP port 12346 is available
70
-
-**Game state errors**: Check if game is responsive and not crashed
71
-
-**Invalid responses**: Verify mod loaded correctly by checking logs
72
-
-**If test/s fail for timeout the reasons is that Balatro crash because there was an error in the Balatro mod (i.e. @balatrobot.lua and @src/lua/ ). The error should be logged in the `balatro.log` file.**
73
-
-**Balatro app crashes**: When the Balatro app crashes during testing, **do not run the remaining tests**. The crash usually indicates an issue with the Lua mod code that causes cryptic errors in `balatro.log`. Stop test execution and investigate the crash logs before continuing. Before running the tests again, ALWAYS kill the current Balatro instance running and start it again.
74
+
75
+
-**Connection timeouts**: Ensure TCP port 12346 is available
76
+
-**Game state errors**: Check if game is responsive and not crashed
77
+
-**Invalid responses**: Verify mod loaded correctly by checking logs
78
+
-**If test/s fail for timeout the reasons is that Balatro crash because there was an error in the Balatro mod (i.e. @balatrobot.lua and @src/lua/ ). The error should be logged in the `balatro.log` file.**
79
+
-**Balatro app crashes**: When the Balatro app crashes during testing, **do not run the remaining tests**. The crash usually indicates an issue with the Lua mod code that causes cryptic errors in `balatro.log`. Stop test execution and investigate the crash logs before continuing. Before running the tests again, ALWAYS kill the current Balatro instance running and start it again.
74
80
75
81
### Documentation
76
82
@@ -107,7 +113,7 @@ I keep the old code around for reference.
107
113
108
114
### Python Code Style (from `.cursor/rules/`)
109
115
110
-
- Use modern Python 3.12+ syntax with built-in collection types
116
+
- Use modern Python 3.13+ syntax with built-in collection types
111
117
- Type annotations with pipe operator for unions: `str | int | None`
112
118
- Use `type` statement for type aliases
113
119
- Google-style docstrings without type information (since type annotations are present)
0 commit comments