Skip to content

Commit c2e6d33

Browse files
committed
chore: add README for endstone-test plugin detailing usage, structure, and test categories
1 parent 7a9f4f0 commit c2e6d33

File tree

3 files changed

+77
-4
lines changed

3 files changed

+77
-4
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,10 @@ endstone/
292292
│ └── python/ # Python bindings via pybind11
293293
├── endstone/ # Python package (CLI, plugin loader, metrics)
294294
├── tests/ # Test files
295-
│ ├── endstone/python/ # Python unit tests
295+
│ ├── bedrock/ # C++ tests for bedrock layer
296296
│ ├── endstone_test/ # Runtime test plugin (pip install -e tests/endstone_test)
297-
│ └── [C++ test files]
297+
│ ├── *.cpp # C++ unit tests
298+
│ └── *.py # Python unit tests
298299
└── conanfile.py # Dependency management
299300
```
300301

tests/endstone_test/README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# endstone-test
2+
3+
An Endstone plugin that runs pytest-based tests against a live Bedrock Dedicated Server to verify API functionality.
4+
5+
## Overview
6+
7+
This plugin is used for runtime testing of the Endstone API. Unlike unit tests that run in isolation, these tests execute within a running server environment, allowing verification of actual API behavior against the Bedrock Dedicated Server.
8+
9+
## Installation
10+
11+
Install the plugin as a Python package from the project root:
12+
13+
```shell
14+
pip install -e tests/endstone_test
15+
```
16+
17+
The plugin will be automatically discovered and loaded by Endstone on server startup.
18+
19+
## Usage
20+
21+
Tests run automatically when the plugin is enabled (after the world loads). Test results are output to the server console.
22+
23+
## Project Structure
24+
25+
```
26+
tests/endstone_test/
27+
├── pyproject.toml # Package configuration
28+
├── README.md
29+
└── src/
30+
└── endstone_test/
31+
├── __init__.py
32+
├── plugin.py # Plugin entry point
33+
└── tests/
34+
├── __init__.py
35+
├── conftest.py # Pytest fixtures (server, plugin)
36+
└── test_server.py # Server API tests
37+
```
38+
39+
## Writing Tests
40+
41+
Tests use pytest and have access to the live `server` and `plugin` fixtures:
42+
43+
```python
44+
from endstone import Server
45+
46+
def test_server_name(server: Server) -> None:
47+
"""Verify server name is 'Endstone'."""
48+
assert server.name == "Endstone"
49+
```
50+
51+
### Available Fixtures
52+
53+
- `server` - The Endstone `Server` instance
54+
- `plugin` - The `EndstoneTest` plugin instance
55+
56+
### Test Categories
57+
58+
Current test coverage includes:
59+
60+
- **Server Information** - Version, protocol, and metadata
61+
- **Server Components** - Logger, language, plugin manager, scheduler
62+
- **Level Access** - World/dimension access
63+
- **Player Management** - Online players, max players
64+
- **Network Configuration** - Ports, online mode
65+
- **Performance Metrics** - TPS, MSPT, tick usage
66+
- **Item Factory** - Item creation APIs
67+
- **Map System** - Map creation and retrieval
68+
- **Broadcasting** - Message broadcast functionality
69+
70+
## Dependencies
71+
72+
- `pytest` - Test framework
73+
- `babel` - Internationalization support
74+
- `pillow` - Image processing (for map tests)

tests/endstone_test/src/endstone_test/tests/test_server.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
from pathlib import Path
55

66
import pytest
7-
87
from endstone import Server
98
from endstone.plugin import Plugin
109

11-
1210
# =============================================================================
1311
# Fixtures
1412
# =============================================================================

0 commit comments

Comments
 (0)