Overview
Oyasai Server Platform provides multiple approaches for testing:- Local Purpur Server: Test plugins in a real Minecraft environment
- Nix Flake Checks: Automated build and test validation
- CI Pipeline: Continuous integration testing
Local Purpur Server Testing
Using oyasai-minecraft-minimal
Theoyasai-minecraft-minimal package is designed for local plugin testing.
1. Configure Your Test Server
Editpackages/oyasai-minecraft-minimal.nix:
2. Build Your Plugins
3. Run the Test Server
- Create the
local/directory - Install all configured plugins
- Accept the EULA automatically
- Start Purpur 1.21.8 on port 25565
4. Connect and Test
Connect tolocalhost:25565 with your Minecraft client (version 1.21.8).
Custom Test Configurations
Create a dedicated test configuration:1. Create Test Package
2. Register and Run
Stage the file:nix/oyasai-scope.nix exports if desired, then:
Iterative Development Workflow
Fast Iteration Loop
- Make Code Changes to your plugin
-
Rebuild Plugin:
-
Update Nix Lock (if dependencies changed):
-
Rebuild Server Package:
-
Restart Server:
- Test In-Game
Hot Reloading Plugins
Use PlugManX for hot reloading during development:-
Include
plugmanxin your test server configuration -
Build your plugin:
-
Copy to server:
-
In-game or console:
Testing Specific Features
Testing Commands
- Start the server with your plugin
- Join the server
- Run commands in-game or via console:
- Check server logs for output
Testing Event Listeners
-
Enable debug logging in your plugin:
- Trigger the event in-game (join, break block, etc.)
-
Check
local/logs/latest.log
Testing Configuration Files
-
Run server once to generate default config:
-
Stop server and modify
local/plugins/YourPlugin/config.yml - Restart and verify changes are applied
Testing Database Integration
For plugins with database dependencies:Nix Flake Checks
Running All Checks
- Builds all packages
- Builds all plugins
- Runs any defined tests
- Validates Nix expressions
CONTRIBUTING.md:46-50.
Check Output
Checking Specific Packages
Continuous Integration
The CI pipeline automatically runs on all pull requests.CI Checks
- Build Validation: All packages must build successfully
- Format Checking: Code must be formatted (see below)
- Lockfile Sync:
gradle.lockmust be up to date
Format Checking
Code must be formatted before committing:- Nix files (
.nix) - Kotlin files (
.kt) - Other configured file types
CONTRIBUTING.md:33-37.
Pre-Commit Validation
Before pushing, run:Debugging
Server Logs
Checklocal/logs/latest.log for server output:
Plugin Logs
Add logging to your plugin:Verbose Nix Output
For build debugging:Gradle Debug
Enable Gradle debug output:Common Testing Scenarios
Testing Plugin Interactions
Test how multiple plugins interact:- Load order is correct
- Events fire in expected sequence
- Shared resources don’t conflict
Testing with External Plugins
Test your plugin alongside popular external plugins:Performance Testing
For load testing:-
Configure server with JVM options:
- Use tools like spark plugin for profiling
-
Monitor
local/logs/latest.logfor lag warnings
Best Practices
1. Isolate Test Environments
Use separate directories for different test configurations:2. Clean State Testing
For clean testing, delete the server directory:3. Version Testing
If supporting multiple Minecraft versions:4. Document Test Cases
Create test documentation in your plugin:5. Automated Testing
For unit tests, use JUnit in your plugin:Troubleshooting
Server Won’t Start
-
Check Java version:
-
Check port availability:
-
Review logs:
Plugin Not Loading
-
Verify plugin is in configuration:
-
Check build output:
-
Check server plugins directory:
-
Check server console:
Gradle Lock Out of Sync
Next Steps
Plugin Development
Continue developing your plugins
Contributing
Submit your tested changes
Gradle Workflow
Deep dive into build system
Nix Packages
Create advanced server configurations