Skip to content

Commit 9f0cd89

Browse files
committed
skip bot tests for 26.x: minecraft-protocol doesn't support the new version yet
The mineflayer test bot crashes on 26.1.2 with "unsupported protocol version: 26.1.2" because minecraft-protocol/minecraft-data haven't added protocol mappings for the new Minecraft versioning scheme yet. See failing run: https://github.com/def9a2a4/BlockShips/actions/runs/25650786286/job/75288572862 For 26.x, CI now runs a server-startup-only test (new Makefile target) that verifies the server starts and BlockShips loads without errors, skipping the bot integration tests. All 1.21.x versions still run the full bot test suite. Depends on upstream support: - PrismarineJS/minecraft-data#1184 - PrismarineJS/node-minecraft-protocol#1481
1 parent a86f761 commit 9f0cd89

3 files changed

Lines changed: 82 additions & 0 deletions

File tree

.github/workflows/server-test.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ jobs:
2525
distribution: 'temurin'
2626
java-version: ${{ startsWith(matrix.minecraft, '26.') && '25' || '21' }}
2727

28+
# TODO: remove 26.x skip conditions once minecraft-protocol supports 26.x
29+
# tracking: https://github.com/PrismarineJS/minecraft-data/pull/1184
2830
- name: Set up Node.js
31+
if: ${{ !startsWith(matrix.minecraft, '26.') }}
2932
uses: actions/setup-node@v4
3033
with:
3134
node-version: '20'
3235

3336
- name: Install bot dependencies
37+
if: ${{ !startsWith(matrix.minecraft, '26.') }}
3438
run: make test-bot-install
3539

3640
- name: Download plugin JAR
@@ -46,8 +50,13 @@ jobs:
4650
run: make test-server-setup
4751

4852
- name: Run test server with bot
53+
if: ${{ !startsWith(matrix.minecraft, '26.') }}
4954
run: make test-server-ci MINECRAFT_VERSION=${{ matrix.minecraft }}
5055

56+
- name: Server startup test (no bot)
57+
if: ${{ startsWith(matrix.minecraft, '26.') }}
58+
run: make test-server-startup-only MINECRAFT_VERSION=${{ matrix.minecraft }}
59+
5160
- name: Check for errors
5261
if: always()
5362
run: |

Makefile

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,76 @@ test-bot-run: test-bot-enable-debug-glow test-bot-write-version
142142
test-chunk-bot-run: test-bot-write-version
143143
cd test-bot && npm run test:chunk
144144

145+
# Server startup test only (used by CI for versions where the bot doesn't work yet)
146+
# Starts server, verifies plugin loads, checks for errors, then shuts down
147+
.PHONY: test-server-startup-only
148+
test-server-startup-only:
149+
@cd $(TEST_SERVER_DIR) && \
150+
mkfifo server_input 2>/dev/null || true; \
151+
tail -f server_input | java -Xmx1G -Xms1G -jar server.jar nogui > server.log 2>&1 & \
152+
SERVER_PID=$$!; \
153+
sleep 0.5; \
154+
tail -f server.log & \
155+
TAIL_PID=$$!; \
156+
echo "Waiting for server to start..."; \
157+
for i in $$(seq 1 600); do \
158+
if grep -q "Done.*For help" server.log 2>/dev/null; then \
159+
echo ""; \
160+
echo "========== Server started successfully =========="; \
161+
break; \
162+
fi; \
163+
if ! kill -0 $$SERVER_PID 2>/dev/null; then \
164+
echo ""; \
165+
echo "========== Server process died unexpectedly =========="; \
166+
cat server.log; \
167+
exit 1; \
168+
fi; \
169+
sleep 1; \
170+
done; \
171+
if ! grep -q "Done.*For help" server.log 2>/dev/null; then \
172+
echo ""; \
173+
echo "========== Server startup timed out =========="; \
174+
cat server.log; \
175+
kill $$TAIL_PID 2>/dev/null || true; \
176+
kill $$SERVER_PID 2>/dev/null || true; \
177+
rm -f server_input; \
178+
exit 1; \
179+
fi; \
180+
if ! grep -q "BlockShips.*enabled" server.log; then \
181+
echo "✗ BlockShips plugin failed to load"; \
182+
cat server.log; \
183+
kill $$TAIL_PID 2>/dev/null || true; \
184+
kill $$SERVER_PID 2>/dev/null || true; \
185+
rm -f server_input; \
186+
exit 1; \
187+
fi; \
188+
echo "✓ BlockShips plugin loaded"; \
189+
echo ""; \
190+
echo "========== Shutting down server =========="; \
191+
echo "stop" > server_input; \
192+
for i in $$(seq 1 30); do \
193+
if ! kill -0 $$SERVER_PID 2>/dev/null; then \
194+
break; \
195+
fi; \
196+
sleep 1; \
197+
done; \
198+
kill $$TAIL_PID 2>/dev/null || true; \
199+
kill $$SERVER_PID 2>/dev/null || true; \
200+
rm -f server_input; \
201+
rm -f errors.log; \
202+
FAILED=0; \
203+
if grep -qE "ERROR.*BlockShips|BlockShips.*Exception" server.log 2>/dev/null; then \
204+
echo "=== SERVER ERRORS ===" | tee -a errors.log; \
205+
grep -E "ERROR.*BlockShips|BlockShips.*Exception" server.log | tee -a errors.log; \
206+
FAILED=1; \
207+
fi; \
208+
if [ $$FAILED -eq 1 ]; then \
209+
echo "✗ Tests failed"; \
210+
exit 1; \
211+
else \
212+
echo "✓ Server startup test passed"; \
213+
fi
214+
145215
# Full integration test with bot (used by CI)
146216
# Starts server, waits for ready, OPs the bot, runs bot tests, then shuts down
147217
.PHONY: test-server-ci

TODO.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
## LONG TERM
1919

20+
- [ ] Re-enable bot tests for 26.x once `minecraft-protocol` supports it. Currently only server startup is tested.
21+
- https://github.com/PrismarineJS/minecraft-data/pull/1184
22+
- https://github.com/PrismarineJS/node-minecraft-protocol/pull/1481
2023
- [ ] ShipRegistry uses non-thread-safe HashMap but is accessed from multiple threads (chunk events, periodic saves). Use ConcurrentHashMap to prevent ConcurrentModificationException.
2124
- [ ] (pre-1.21.9) Rotation logic bug - delta rotation math in ShipInstance.java:1110-1130 has inconsistencies, displays may rotate incorrectly
2225
- [ ] (pre-1.21.9) Custom ship spawnYaw mismatch - initial spawn uses vehicle.getYaw() but recovery uses model.initialRotation.x, causing rotation snap after restart

0 commit comments

Comments
 (0)