decdb74ade
Bump export_presets.cfg version to 2.3.5. Update CHANGELOG_DRAFT.md. Refactor lobby.gd into LobbyChat, LobbyMainMenu, LobbyRoomList, LobbyRoom. Move Nakama config to environment variables in nakama_manager.gd. Derive auth_manager.gd encryption key from OS.get_unique_id().sha256_text(). Remove Steam email auth fallback. Require auth ticket. Make GachaManager.pull() async in gacha_panel.gd. Remove dummy wallet seeding. Add store_type to IAP payload. Validate IAP receipts server-side in economy.lua. Register gacha module in main.lua. Clean backend_service.gd stubs. Fix featured_banners type safety in gacha_manager.gd. Guards non-array responses. Move tiles_armagedon_a1.res to assets/models/meshes/. Fix import fallback_path.
101 lines
3.2 KiB
GDScript
101 lines
3.2 KiB
GDScript
# tests/test_versioning_integrity.gd
|
|
# Tests for Task [045]: Versioning & Patch Integrity
|
|
# Validates single release version source, checksums, compatibility rules, changelog
|
|
|
|
extends GutTest
|
|
|
|
var version_config: Dictionary
|
|
|
|
func before_all():
|
|
gut.p("=== Versioning Integrity Tests [Task 045] ===")
|
|
|
|
func before_each():
|
|
version_config = {
|
|
"version": "2.3.4",
|
|
"build_number": 234,
|
|
"release_date": "2026-05-21",
|
|
"changelog": "Fixed bugs, added features",
|
|
"checksum": "abc123def456",
|
|
"compatibility": {
|
|
"min_version": "2.0.0",
|
|
"max_version": "3.0.0"
|
|
}
|
|
}
|
|
|
|
func after_each():
|
|
pass
|
|
|
|
# Test 1: Version has single source
|
|
func test_version_single_source():
|
|
var version = version_config.get("version", "")
|
|
assert_true(version.length() > 0, "Version should have single source")
|
|
|
|
# Test 2: Version format is valid
|
|
func test_version_format_valid():
|
|
var version = version_config.get("version", "")
|
|
var parts = version.split(".")
|
|
assert_eq(parts.size(), 3, "Version should be semantic (major.minor.patch)")
|
|
|
|
# Test 3: Build number exists
|
|
func test_build_number_exists():
|
|
var build = version_config.get("build_number", 0)
|
|
assert_true(build > 0, "Build number should exist")
|
|
|
|
# Test 4: Checksum is present
|
|
func test_checksum_present():
|
|
var checksum = version_config.get("checksum", "")
|
|
assert_true(checksum.length() > 0, "Checksum should be present")
|
|
|
|
# Test 5: Changelog is documented
|
|
func test_changelog_documented():
|
|
var changelog = version_config.get("changelog", "")
|
|
assert_true(changelog.length() > 0, "Changelog should be documented")
|
|
|
|
# Test 6: Compatibility rules defined
|
|
func test_compatibility_rules_defined():
|
|
var compat = version_config.get("compatibility", {})
|
|
assert_has(compat, "min_version", "Min version should be defined")
|
|
assert_has(compat, "max_version", "Max version should be defined")
|
|
|
|
# Test 7: Release date recorded
|
|
func test_release_date_recorded():
|
|
var date = version_config.get("release_date", "")
|
|
assert_true(date.length() > 0, "Release date should be recorded")
|
|
|
|
# Test 8: Version can be incremented
|
|
func test_version_increment():
|
|
var current = "2.3.4"
|
|
var parts = current.split(".")
|
|
parts[2] = str(int(parts[2]) + 1)
|
|
var new_version = ".".join(parts)
|
|
assert_eq(new_version, "2.3.5", "Version should increment")
|
|
|
|
# Test 9: Checksum validates integrity
|
|
func test_checksum_validates_integrity():
|
|
var checksum = version_config.get("checksum", "")
|
|
var is_valid = _validate_checksum(checksum)
|
|
assert_true(is_valid, "Checksum should validate integrity")
|
|
|
|
# Test 10: Compatibility prevents incompatible versions
|
|
func test_compatibility_prevents_incompatible():
|
|
var current = "2.3.4"
|
|
var min_version = version_config["compatibility"]["min_version"]
|
|
var is_compatible = _is_version_compatible(current, min_version)
|
|
assert_true(is_compatible, "Current version should be compatible")
|
|
|
|
# Helper functions
|
|
func _validate_checksum(checksum: String) -> bool:
|
|
return checksum.length() > 0
|
|
|
|
func _is_version_compatible(current: String, min_version: String) -> bool:
|
|
var current_parts = current.split(".")
|
|
var min_parts = min_version.split(".")
|
|
|
|
var current_major = int(current_parts[0])
|
|
var min_major = int(min_parts[0])
|
|
|
|
return current_major >= min_major
|
|
|
|
func after_all():
|
|
gut.p("=== Versioning Integrity Tests Complete ===")
|