Running Tests
Standard Test Suite
To run the default test suite:- Maximum heap size: 4GB
- Parallel execution where applicable
- Excluded tags:
LongRunning
Long-Running Tests
Some tests are excluded from the default suite because they can take over 30 minutes to complete. To run these tests:- Maximum heap size: 8GB
- No tag exclusions (runs all tests)
Skip Tests During Build
If you need to build without running tests:Test Structure
Chunker’s tests are organized into several categories:Unit Tests
Tests for core functionality and data structures:NBT Tests
- Tag serialization/deserialization
- Reader/writer implementations
- Java and Bedrock NBT formats
Resolver Tests
- Block identifier validation
- Item identifier validation
- Biome mappings
- Property resolvers
Mapping Tests
- Block mapping files
- Item mapping files
- Identifier state handling
Utility Tests
- Basic property handling
- Vanilla block groups
- Helper functions
Integration Tests
The most comprehensive test suite validates world conversions across all supported formats:- Convert sample worlds between Java and Bedrock editions
- Test all supported version combinations
- Validate that
level.datis correctly written - Check for exceptions during conversion
- Verify world settings and preview generation
Validation Tests
Chunker performs automated validation to catch mapping errors:- Block Identifier Validation: Ensures all block identifiers match the palette for Java and Bedrock editions
- Item Identifier Validation: Validates item identifiers against game data
- Biome Validation: Checks biome ID and name mappings
These validation tests help identify faulty mappings during the build process, preventing issues from reaching production.
Test Configuration
Tests are configured incli/build.gradle.kts:
Running Specific Tests
By Class
Run tests from a specific class:By Pattern
Run tests matching a pattern:By Package
Run all tests in a package:Continuous Integration
Chunker uses GitHub Actions for automated testing on every push and pull request.CI Workflow
The main CI workflow (.github/workflows/build_test_linux.yml) runs on:
- Push to
mainbranch - Approved pull requests
Setup Environment
- Installs JDK 17 (Temurin distribution)
- Configures Gradle
- Makes gradlew executable
Build and Test
Runs
./gradlew build which includes:- Compilation
- Running the test suite
- Packaging artifacts
Test Resources
Integration tests use sample worlds stored incli/src/test/resources/integration/worlds/:
JAVA_1_20_5.zipJAVA_1_19_4.zipJAVA_1_15_2.zipJAVA_1_16_5.zipJAVA_1_12_2.zipBEDROCK_R20_80.zipBEDROCK_R19_30.zipBEDROCK_R18_30.zipBEDROCK_R12.zip
Writing Tests
When contributing to Chunker, follow these testing guidelines:- Use JUnit 5: Leverage
@Test,@ParameterizedTest, and other JUnit 5 annotations - Tag Long Tests: Use
@Tag("LongRunning")for tests that take significant time - Parallel Execution: Use
@Execution(ExecutionMode.CONCURRENT)where safe - Validate Data: Always assert expected outcomes and check for exceptions
- Clean Up Resources: Use try-finally blocks to clean up test files and directories
Debugging Test Failures
Verbose Output
Get more detailed test output:Stack Traces
Show full stack traces for failures:Test Reports
After running tests, view detailed HTML reports at:Performance Testing
Integration tests automatically measure conversion performance as they process real world data. Monitor test execution times to identify performance regressions.
Next Steps
- Review building instructions
- Learn about contributing
- Explore the project structure